Fixed the noisy output of dmix with two (or less) periods.
The dmix tends to give noise or XRUN when running with two periods
because of its implementation nature. To avoid this, the start
position is aligned to the period size, so that the updates are synced
with interrupts of slave PCM.
Fix the PCM auto-start conditions
- The capture stream should be started the PCM anyway before reads
- Fixed the endless poll() when the written size doesn't fit to the
buffer size due to lack of auto-start
Here's a patch which adds support for S24_3LE and byte-swapped S16 and
S32 to softvol. I've tested S24_3LE and byte-swapped S16 on powerpc
with snd-usb-audio. All other cases are untested so far.
(Config at http://blog.blackdown.de/static/alsa/USB-Audio.conf)
Signed-off-by: Juergen Kreileder <jk@blackdown.de>
snd_timer_tread struct is a bad design for 32/64bit compatibility,
and reading this struct on 32bit program returns zero. This results
in tight poll looping (bug#1938, #1945).
For avoiding this bug, now more bigger buffer is read to cover the
64bit tread struct, too. Also this optimizes the read without
checking -EAGAIN in the case both user-space and kernel have the same
tread size.
With the patch, dmix allows apps to use more flexible buffer sizes.
The max buffer size is unlimited, and the minimal buffer size is
(period size * 2). The buffer size is aligned to period size.
The period size is still bound to the period size of slave PCM.
To back to the old behavior (the fixed buffer size), you can set
defaults.pcm.dmix_variable_buffer false
in your configuration.
Here's a patch for generic dmix which fixes S16 byte swapping.
Tested on powerpc with snd-usb-audio. (Without the patch I get crackling.)
Signed-off-by: Juergen Kreileder <jk@blackdown.de>
Add restriction parameters to pcm hw layer.
The PCM hw has optional parameters, format, rate and channels, to restrict
the configuration. This is useful for definition of surround slave PCMs,
for example.
When calculating the size of the second fragment, do not assume that the
entire size is one period size (which is not true in the draining state)
but use the actual size passed by the caller.
When calculating the continuous part till the end of the buffer, we can
use the slave_frames value that has already been calculated by
snd_pcm_mmap_begin().
From: Henryk Plötz <henryk@ploetzli.ch>
I recently had problems building alsa-lib 1.0.10 on mips (for my
Netgear WGT634U). Turned out the problem was in include/alsa-symbols.h
were there was __asm__ code that wouldn't work with the mips assembler.
Attached is a patch that makes this work again.
Add configuration options to change the default device path from the
default /dev/snd. This is useful for embedded systems that do not want
subdirectories in /dev.
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>