~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/synth/emux/emux_proc.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  *  Copyright (C) 2000 Takashi Iwai <tiwai@suse.de>
  4  *
  5  *  Proc interface for Emu8k/Emu10k1 WaveTable synth
  6  */
  7 
  8 #include <linux/wait.h>
  9 #include <sound/core.h>
 10 #include <sound/emux_synth.h>
 11 #include <sound/info.h>
 12 #include "emux_voice.h"
 13 
 14 static void
 15 snd_emux_proc_info_read(struct snd_info_entry *entry, 
 16                         struct snd_info_buffer *buf)
 17 {
 18         struct snd_emux *emu;
 19         int i;
 20 
 21         emu = entry->private_data;
 22         mutex_lock(&emu->register_mutex);
 23         if (emu->name)
 24                 snd_iprintf(buf, "Device: %s\n", emu->name);
 25         snd_iprintf(buf, "Ports: %d\n", emu->num_ports);
 26         snd_iprintf(buf, "Addresses:");
 27         for (i = 0; i < emu->num_ports; i++)
 28                 snd_iprintf(buf, " %d:%d", emu->client, emu->ports[i]);
 29         snd_iprintf(buf, "\n");
 30         snd_iprintf(buf, "Use Counter: %d\n", emu->used);
 31         snd_iprintf(buf, "Max Voices: %d\n", emu->max_voices);
 32         snd_iprintf(buf, "Allocated Voices: %d\n", emu->num_voices);
 33         if (emu->memhdr) {
 34                 snd_iprintf(buf, "Memory Size: %d\n", emu->memhdr->size);
 35                 snd_iprintf(buf, "Memory Available: %d\n", snd_util_mem_avail(emu->memhdr));
 36                 snd_iprintf(buf, "Allocated Blocks: %d\n", emu->memhdr->nblocks);
 37         } else {
 38                 snd_iprintf(buf, "Memory Size: 0\n");
 39         }
 40         if (emu->sflist) {
 41                 mutex_lock(&emu->sflist->presets_mutex);
 42                 snd_iprintf(buf, "SoundFonts: %d\n", emu->sflist->fonts_size);
 43                 snd_iprintf(buf, "Instruments: %d\n", emu->sflist->zone_counter);
 44                 snd_iprintf(buf, "Samples: %d\n", emu->sflist->sample_counter);
 45                 snd_iprintf(buf, "Locked Instruments: %d\n", emu->sflist->zone_locked);
 46                 snd_iprintf(buf, "Locked Samples: %d\n", emu->sflist->sample_locked);
 47                 mutex_unlock(&emu->sflist->presets_mutex);
 48         }
 49 #if 0  /* debug */
 50         if (emu->voices[0].state != SNDRV_EMUX_ST_OFF && emu->voices[0].ch >= 0) {
 51                 struct snd_emux_voice *vp = &emu->voices[0];
 52                 snd_iprintf(buf, "voice 0: on\n");
 53                 snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n",
 54                             vp->reg.parm.moddelay,
 55                             vp->reg.parm.modatkhld,
 56                             vp->reg.parm.moddcysus,
 57                             vp->reg.parm.modrelease);
 58                 snd_iprintf(buf, "vol delay=%x, atkhld=%x, dcysus=%x, rel=%x\n",
 59                             vp->reg.parm.voldelay,
 60                             vp->reg.parm.volatkhld,
 61                             vp->reg.parm.voldcysus,
 62                             vp->reg.parm.volrelease);
 63                 snd_iprintf(buf, "lfo1 delay=%x, lfo2 delay=%x, pefe=%x\n",
 64                             vp->reg.parm.lfo1delay,
 65                             vp->reg.parm.lfo2delay,
 66                             vp->reg.parm.pefe);
 67                 snd_iprintf(buf, "fmmod=%x, tremfrq=%x, fm2frq2=%x\n",
 68                             vp->reg.parm.fmmod,
 69                             vp->reg.parm.tremfrq,
 70                             vp->reg.parm.fm2frq2);
 71                 snd_iprintf(buf, "cutoff=%x, filterQ=%x, chorus=%x, reverb=%x\n",
 72                             vp->reg.parm.cutoff,
 73                             vp->reg.parm.filterQ,
 74                             vp->reg.parm.chorus,
 75                             vp->reg.parm.reverb);
 76                 snd_iprintf(buf, "avol=%x, acutoff=%x, apitch=%x\n",
 77                             vp->avol, vp->acutoff, vp->apitch);
 78                 snd_iprintf(buf, "apan=%x, aaux=%x, ptarget=%x, vtarget=%x, ftarget=%x\n",
 79                             vp->apan, vp->aaux,
 80                             vp->ptarget,
 81                             vp->vtarget,
 82                             vp->ftarget);
 83                 snd_iprintf(buf, "start=%x, end=%x, loopstart=%x, loopend=%x\n",
 84                             vp->reg.start, vp->reg.end, vp->reg.loopstart, vp->reg.loopend);
 85                 snd_iprintf(buf, "sample_mode=%x, rate=%x\n", vp->reg.sample_mode, vp->reg.rate_offset);
 86         }
 87 #endif
 88         mutex_unlock(&emu->register_mutex);
 89 }
 90 
 91 
 92 void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device)
 93 {
 94         struct snd_info_entry *entry;
 95         char name[64];
 96 
 97         sprintf(name, "wavetableD%d", device);
 98         entry = snd_info_create_card_entry(card, name, card->proc_root);
 99         if (entry == NULL)
100                 return;
101 
102         entry->content = SNDRV_INFO_CONTENT_TEXT;
103         entry->private_data = emu;
104         entry->c.text.read = snd_emux_proc_info_read;
105         emu->proc = entry;
106 }
107 
108 void snd_emux_proc_free(struct snd_emux *emu)
109 {
110         snd_info_free_entry(emu->proc);
111         emu->proc = NULL;
112 }
113 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php