mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
37745918e0
Implement two ioctl calls in order to support virtual userspace-driven ALSA timers. The first ioctl is SNDRV_TIMER_IOCTL_CREATE, which gets the snd_timer_uinfo struct as a parameter and puts a file descriptor of a virtual timer into the `fd` field of the snd_timer_unfo structure. It also updates the `id` field of the snd_timer_uinfo struct, which provides a unique identifier for the timer (basically, the subdevice number which can be used when creating timer instances). This patch also introduces a tiny id allocator for the userspace-driven timers, which guarantees that we don't have more than 128 of them in the system. Another ioctl is SNDRV_TIMER_IOCTL_TRIGGER, which allows us to trigger the virtual timer (and calls snd_timer_interrupt for the timer under the hood), causing all of the timer instances binded to this timer to execute their callbacks. The maximum amount of ticks available for the timer is 1 for the sake of simplicity of the userspace API. 'start', 'stop', 'open' and 'close' callbacks for the userspace-driven timers are empty since we don't really do any hardware initialization here. Suggested-by: Axel Holzinger <aholzinger@gmx.de> Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240813120701.171743-4-ivan.orlov0322@gmail.com
268 lines
7.5 KiB
Plaintext
268 lines
7.5 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
# ALSA soundcard-configuration
|
|
config SND_TIMER
|
|
tristate
|
|
|
|
config SND_PCM
|
|
tristate
|
|
select SND_TIMER if SND_PCM_TIMER
|
|
|
|
config SND_PCM_ELD
|
|
bool
|
|
|
|
config SND_PCM_IEC958
|
|
bool
|
|
|
|
config SND_DMAENGINE_PCM
|
|
tristate
|
|
|
|
config SND_HWDEP
|
|
tristate
|
|
|
|
config SND_SEQ_DEVICE
|
|
tristate
|
|
|
|
config SND_RAWMIDI
|
|
tristate
|
|
select SND_SEQ_DEVICE if SND_SEQUENCER != n
|
|
|
|
config SND_UMP
|
|
tristate
|
|
select SND_RAWMIDI
|
|
|
|
config SND_UMP_LEGACY_RAWMIDI
|
|
bool "Legacy raw MIDI support for UMP streams"
|
|
depends on SND_UMP
|
|
help
|
|
This option enables the legacy raw MIDI support for UMP streams.
|
|
When this option is set, an additional rawmidi device for the
|
|
legacy MIDI 1.0 byte streams is created for each UMP Endpoint.
|
|
The device contains 16 substreams corresponding to UMP groups.
|
|
|
|
config SND_CORE_TEST
|
|
tristate "Sound core KUnit test"
|
|
depends on KUNIT
|
|
select SND_PCM
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This options enables the sound core functions KUnit test.
|
|
|
|
KUnit tests run during boot and output the results to the debug
|
|
log in TAP format (https://testanything.org/). Only useful for
|
|
kernel devs running KUnit test harness and are not for inclusion
|
|
into a production build.
|
|
|
|
For more information on KUnit and unit tests in general, refer
|
|
to the KUnit documentation in Documentation/dev-tools/kunit/.
|
|
|
|
|
|
config SND_COMPRESS_OFFLOAD
|
|
tristate
|
|
|
|
config SND_JACK
|
|
bool
|
|
|
|
# enable input device support in jack layer
|
|
config SND_JACK_INPUT_DEV
|
|
bool
|
|
depends on SND_JACK
|
|
default y if INPUT=y || INPUT=SND
|
|
|
|
config SND_OSSEMUL
|
|
bool "Enable OSS Emulation"
|
|
select SOUND_OSS_CORE
|
|
help
|
|
This option enables the build of OSS emulation layer.
|
|
|
|
config SND_MIXER_OSS
|
|
tristate "OSS Mixer API"
|
|
depends on SND_OSSEMUL
|
|
help
|
|
To enable OSS mixer API emulation (/dev/mixer*), say Y here
|
|
and read <file:Documentation/sound/designs/oss-emulation.rst>.
|
|
|
|
Many programs still use the OSS API, so say Y.
|
|
|
|
To compile this driver as a module, choose M here: the module
|
|
will be called snd-mixer-oss.
|
|
|
|
config SND_PCM_OSS
|
|
tristate "OSS PCM (digital audio) API"
|
|
depends on SND_OSSEMUL
|
|
select SND_PCM
|
|
help
|
|
To enable OSS digital audio (PCM) emulation (/dev/dsp*), say Y
|
|
here and read <file:Documentation/sound/designs/oss-emulation.rst>.
|
|
|
|
Many programs still use the OSS API, so say Y.
|
|
|
|
To compile this driver as a module, choose M here: the module
|
|
will be called snd-pcm-oss.
|
|
|
|
config SND_PCM_OSS_PLUGINS
|
|
bool "OSS PCM (digital audio) API - Include plugin system"
|
|
depends on SND_PCM_OSS
|
|
default y
|
|
help
|
|
If you disable this option, the ALSA's OSS PCM API will not
|
|
support conversion of channels, formats and rates. It will
|
|
behave like most of new OSS/Free drivers in 2.4/2.6 kernels.
|
|
|
|
config SND_PCM_TIMER
|
|
bool "PCM timer interface" if EXPERT
|
|
default y
|
|
help
|
|
If you disable this option, pcm timer will be unavailable, so
|
|
those stubs that use pcm timer (e.g. dmix, dsnoop & co) may work
|
|
incorrectly.
|
|
|
|
For some embedded devices, we may disable it to reduce memory
|
|
footprint, about 20KB on x86_64 platform.
|
|
|
|
config SND_HRTIMER
|
|
tristate "HR-timer backend support"
|
|
depends on HIGH_RES_TIMERS
|
|
select SND_TIMER
|
|
help
|
|
Say Y here to enable HR-timer backend for ALSA timer. ALSA uses
|
|
the hrtimer as a precise timing source. The ALSA sequencer code
|
|
also can use this timing source.
|
|
|
|
To compile this driver as a module, choose M here: the module
|
|
will be called snd-hrtimer.
|
|
|
|
config SND_DYNAMIC_MINORS
|
|
bool "Dynamic device file minor numbers"
|
|
help
|
|
If you say Y here, the minor numbers of ALSA device files in
|
|
/dev/snd/ are allocated dynamically. This allows you to have
|
|
more than 8 sound cards, but requires a dynamic device file
|
|
system like udev.
|
|
|
|
If you are unsure about this, say N here.
|
|
|
|
config SND_MAX_CARDS
|
|
int "Max number of sound cards"
|
|
range 4 256
|
|
default 32
|
|
depends on SND_DYNAMIC_MINORS
|
|
help
|
|
Specify the max number of sound cards that can be assigned
|
|
on a single machine.
|
|
|
|
config SND_SUPPORT_OLD_API
|
|
bool "Support old ALSA API"
|
|
default y
|
|
help
|
|
Say Y here to support the obsolete ALSA PCM API (ver.0.9.0 rc3
|
|
or older).
|
|
|
|
config SND_PROC_FS
|
|
bool "Sound Proc FS Support" if EXPERT
|
|
depends on PROC_FS
|
|
default y
|
|
help
|
|
Say 'N' to disable Sound proc FS, which may reduce code size about
|
|
9KB on x86_64 platform.
|
|
If unsure say Y.
|
|
|
|
config SND_VERBOSE_PROCFS
|
|
bool "Verbose procfs contents"
|
|
depends on SND_PROC_FS
|
|
default y
|
|
help
|
|
Say Y here to include code for verbose procfs contents (provides
|
|
useful information to developers when a problem occurs). On the
|
|
other side, it makes the ALSA subsystem larger.
|
|
|
|
config SND_CTL_FAST_LOOKUP
|
|
bool "Fast lookup of control elements" if EXPERT
|
|
default y
|
|
select XARRAY_MULTI
|
|
help
|
|
This option enables the faster lookup of control elements.
|
|
It will consume more memory because of the additional Xarray.
|
|
If you want to choose the memory footprint over the performance
|
|
inevitably, turn this off.
|
|
|
|
config SND_DEBUG
|
|
bool "Debug"
|
|
help
|
|
Say Y here to enable ALSA debug code.
|
|
|
|
config SND_DEBUG_VERBOSE
|
|
bool "More verbose debug"
|
|
depends on SND_DEBUG
|
|
help
|
|
Say Y here to enable extra-verbose debugging messages.
|
|
|
|
Let me repeat: it enables EXTRA-VERBOSE DEBUGGING messages.
|
|
So, say Y only if you are ready to be annoyed.
|
|
|
|
config SND_PCM_XRUN_DEBUG
|
|
bool "Enable PCM ring buffer overrun/underrun debugging"
|
|
default n
|
|
depends on SND_DEBUG && SND_VERBOSE_PROCFS
|
|
help
|
|
Say Y to enable the PCM ring buffer overrun/underrun debugging.
|
|
It is usually not required, but if you have trouble with
|
|
sound clicking when system is loaded, it may help to determine
|
|
the process or driver which causes the scheduling gaps.
|
|
|
|
config SND_CTL_INPUT_VALIDATION
|
|
bool "Validate input data to control API"
|
|
help
|
|
Say Y to enable the additional validation for the input data to
|
|
each control element, including the value range checks.
|
|
An error is returned from ALSA core for invalid inputs without
|
|
passing to the driver. This is a kind of hardening for drivers
|
|
that have no proper error checks, at the cost of a slight
|
|
performance overhead.
|
|
|
|
config SND_CTL_DEBUG
|
|
bool "Enable debugging feature for control API"
|
|
depends on SND_DEBUG
|
|
help
|
|
Say Y to enable the debugging feature for ALSA control API.
|
|
It performs the additional sanity-checks for each control element
|
|
read access, such as whether the values returned from the driver
|
|
are in the proper ranges or the check of the invalid access at
|
|
out-of-array areas. The error is printed when the driver gives
|
|
such unexpected values.
|
|
When you develop a driver that deals with control elements, it's
|
|
strongly recommended to try this one once and verify whether you see
|
|
any relevant errors or not.
|
|
|
|
config SND_JACK_INJECTION_DEBUG
|
|
bool "Sound jack injection interface via debugfs"
|
|
depends on SND_JACK && SND_DEBUG && DEBUG_FS
|
|
help
|
|
This option can be used to enable or disable sound jack
|
|
software injection.
|
|
Say Y if you are debugging via jack injection interface.
|
|
If unsure select "N".
|
|
|
|
config SND_UTIMER
|
|
bool "Enable support for userspace-controlled virtual timers"
|
|
depends on SND_TIMER
|
|
help
|
|
Say Y to enable the support of userspace-controlled timers. These
|
|
timers are purely virtual, and they are supposed to be triggered
|
|
from userspace. They could be quite useful when synchronizing the
|
|
sound timing with userspace applications (for instance, when sending
|
|
data through snd-aloop).
|
|
|
|
config SND_VMASTER
|
|
bool
|
|
|
|
config SND_DMA_SGBUF
|
|
def_bool y
|
|
depends on X86
|
|
|
|
config SND_CTL_LED
|
|
tristate
|
|
select NEW_LEDS if SND_CTL_LED
|
|
select LEDS_TRIGGERS if SND_CTL_LED
|
|
|
|
source "sound/core/seq/Kconfig"
|