diff options
| author | Cheng-Min Chiang <chmnchiang@google.com> | 2020-07-14 16:43:13 -0700 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-07-16 09:11:03 +0200 |
| commit | a3e915fe9bac96541fed593a05bf5a16f08bf5c7 (patch) | |
| tree | 8584f954beb84d9e868c4b193984d57f678fba04 /sys/linux/dev_dsp.txt | |
| parent | 561f9a1f6f8652a8fa50569697eacdb0622ae831 (diff) | |
sys/linux: add descriptions for mixer devices
Add descriptions for OSS mixer devices, which includes `/dev/mixer` and
its proc file `/proc/asound/card*/oss_mixer`. These descriptions should
improve the coverage of `sound/core/oss/mixer_oss.c`.
Update #533.
Diffstat (limited to 'sys/linux/dev_dsp.txt')
| -rw-r--r-- | sys/linux/dev_dsp.txt | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/sys/linux/dev_dsp.txt b/sys/linux/dev_dsp.txt index d2f610615..18b014c24 100644 --- a/sys/linux/dev_dsp.txt +++ b/sys/linux/dev_dsp.txt @@ -43,9 +43,13 @@ ioctl$SNDCTL_DSP_GETODELAY(fd fd_dsp, cmd const[SNDCTL_DSP_GETODELAY], arg ptr[o ioctl$SOUND_PCM_READ_RATE(fd fd_dsp, cmd const[SOUND_PCM_READ_RATE], arg ptr[out, int32]) ioctl$SOUND_PCM_READ_CHANNELS(fd fd_dsp, cmd const[SOUND_PCM_READ_CHANNELS], arg ptr[out, int32]) ioctl$SOUND_PCM_READ_BITS(fd fd_dsp, cmd const[SOUND_PCM_READ_BITS], arg ptr[out, int32]) + +# /dev/mixer ioctl$SOUND_OLD_MIXER_INFO(fd fd_mixer, cmd const[SOUND_OLD_MIXER_INFO], arg ptr[out, array[int8, OLD_MIXED_INFO_SIZE]]) ioctl$SOUND_MIXER_INFO(fd fd_mixer, cmd const[SOUND_MIXER_INFO], arg ptr[out, array[int8, MIXER_INFO_SIZE]]) -ioctl$SOUND_MIXER_WRITE_RECSRC(fd fd_mixer, cmd const[SOUND_MIXER_WRITE_RECSRC], arg ptr[in, int32]) +ioctl$SOUND_MIXER_WRITE_RECSRC(fd fd_mixer, cmd const[SOUND_MIXER_WRITE_RECSRC], arg ptr[inout, int32]) +ioctl$mixer_OSS_GETVERSION(fd fd_mixer, cmd const[OSS_GETVERSION], arg ptr[out, int32]) +ioctl$mixer_OSS_ALSAEMULVER(fd fd_mixer, cmd const[OSS_ALSAEMULVER], arg ptr[out, int32]) ioctl$SOUND_MIXER_READ_DEVMASK(fd fd_mixer, cmd const[SOUND_MIXER_READ_DEVMASK], arg ptr[out, int32]) ioctl$SOUND_MIXER_READ_STEREODEVS(fd fd_mixer, cmd const[SOUND_MIXER_READ_STEREODEVS], arg ptr[out, int32]) ioctl$SOUND_MIXER_READ_RECMASK(fd fd_mixer, cmd const[SOUND_MIXER_READ_RECMASK], arg ptr[out, int32]) @@ -54,6 +58,37 @@ ioctl$SOUND_MIXER_READ_RECSRC(fd fd_mixer, cmd const[SOUND_MIXER_READ_RECSRC], a ioctl$SOUND_MIXER_WRITE_VOLUME(fd fd_mixer, cmd int32[SOUND_MIXER_WRITE_VOLUME:SOUND_MIXER_WRITE_ONOFF_MAX], arg ptr[in, int32[0:100]]) ioctl$SOUND_MIXER_READ_VOLUME(fd fd_mixer, cmd int32[SOUND_MIXER_READ_VOLUME:SOUND_MIXER_READ_ONOFF_MAX], arg ptr[out, int32]) +# /proc/asound/card*/oss_mixer +resource fd_proc_mixer[fd] +oss_mixer_proc_files = "/proc/asound/card0/oss_mixer", "/proc/asound/card1/oss_mixer", "/proc/asound/card2/oss_mixer", "/proc/asound/card3/oss_mixer" + +openat$proc_mixer(fd const[AT_FDCWD], file ptr[in, string[oss_mixer_proc_files]], flags flags[open_flags], mode const[0]) fd_proc_mixer +read$proc_mixer(fd fd_proc_mixer, data ptr[out, array[int8]], len bytesize[data]) +write$proc_mixer(fd fd_proc_mixer, data ptr[in, array[oss_mixer_input_line]], len bytesize[data]) + +# The input to write$proc_mixer can consist of several lines. +# The format of each line should be: +# <oss_mixer_name>[ '<alsa_source_names>' <index>]\n +# e.g. "VOLUME\nBASS 'Line Capture Switch' 123\n" + +# 10 = '\n' +oss_mixer_input_line { + name stringnoz[oss_mixer_names] + body optional[oss_mixer_input_body] + newline const[10, int8] +} [packed] + +# index should be intptr[0:0x4000], but only 0 works on qemu currently. +oss_mixer_input_body { + sep1 stringnoz[" '"] + alsa_source stringnoz[alsa_source_names] + sep2 stringnoz["' "] + index fmt[dec, intptr[0:0]] +} [packed] + +oss_mixer_names = "VOLUME", "BASS", "TREBLE", "SYNTH", "PCM", "SPEAKER", "LINE", "MIC", "CD", "IMIX", "ALTPCM", "RECLEV", "IGAIN", "OGAIN", "LINE1", "LINE2", "LINE3", "DIGITAL1", "DIGITAL2", "DIGITAL3", "PHONEIN", "PHONEOUT", "VIDEO", "RADIO", "MONITOR" +alsa_source_names = "Master", "Master Capture", "Master Capture Switch", "Master Playback", "Master Playback Volume", "Master Playback Switch", "Synth", "Synth Capture", "Synth Capture Switch", "Line", "Line Capture", "Line Capture Switch", "Mic", "Mic Capture", "Mic Capture Switch", "CD", "CD Capture", "CD Capture Switch", "Capture", "Capture Volume", "Capture Switch" + # NEED: we could provide a special support for this to save typing and duplication here. # It could be eigher: # csizeof[struct audio_buf_info] @@ -69,4 +104,5 @@ define MIXER_INFO_SIZE sizeof(struct mixer_info) define OLD_MIXED_INFO_SIZE sizeof(struct _old_mixer_info) define SOUND_MIXER_WRITE_ONOFF_MAX MIXER_WRITE(SOUND_ONOFF_MAX) define SOUND_MIXER_READ_ONOFF_MAX MIXER_READ(SOUND_ONOFF_MAX) +define OSS_ALSAEMULVER _SIOR ('M', 249, int) _ = __NR_mmap2 |
