Remove several memory leaks by not aborting prematurely from a
snd_xxx_close() function when some operation fails.
This can happen when a USB device was unplugged.
Fix the check of nonblock option for all hw layer.
Instead of passing in asound.conf, check the option in snd_pcm_hw_open()
so that the nonblock option is referred in the case of "type hw ..." style
definition, too.
From: Pierre Ossman <drzeus-list@drzeus.cx>
Freeing the global config update structure when it had been created
without any configs present caused an assertion to trigger. Since this
is a valid scenario and the assertion didn't really protect against
anything, it should simply be removed. Attached patch does exactly that.
It turned out that plugins that had control outputs were not being set
up properly if there was no corresponding "output" section.
Signed-off-by: Nathan Kurz <nate@verse.com>
- Support multi-card/device for dmix/dsnoop/dshare plugins
The unique ipc key is calculated based on card/device/sub index
- Clean up and share the code among all d* plugins
- Refer the defaults.pcm.* configuration
The base ipc_key number, ipc_gid and ipc_perm are referred.
Added a new "nonblock" option for hw layer. This controls the non-blocking
"open" mode as default.
This option is set to TRUE as the default configuration. If the old behavior
is preferred, set "defaults.pcm.nonblock" to 0 in /etc/asound.conf.
The previous code did not allocated a separate buffer for all channels
when a NONINTERLEAVED access was used. The result was that only one
"shared" buffer was incorrectly allocated.
Also, the code was a bit cleaned (cosmetic change only).
Add to the dmix plugin support for the S24_3LE sample format which is
used by 24-bit USB devices.
The optimized assembler version uses only 23 bits for sample data so
that the lowest bit can be used for synchronization because there is no
24-bit cmpxchg instruction.
Example failure error message before fix:
speaker-test 0.0.8
Playback device is spdif
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
ALSA lib setup.c:549:(add_elem) Cannot obtain info for CTL elem (MIXER,'SPDIF Front',0,0,0): No such file or directory
Playback open error: -2,No such file or directory
Reduce the maximum possible number of global clients to 16 to make
more numbers available for card clients, and allow dynamically allocated
card client numbers to share the same range as application client
numbers to make sure that all 32 cards can be used at the same time.