The fix to enable finer sync of dmix in delay callback seems
rather harmful for some apps like xmms on SMP.
The problem of aoss was solved by max_periods=0, so better to
revert this change.
Sync pointers in delay callback in dmix. This solves some problems
of aoss with apps that don't check poll_revents.
The rate plugin is fixed to call delay of slave appropriately, too.
Introduce "max_periods" option to specify the max number of periods
per buffer to each plugin.
- When max_periods = -1, the fixed buffer size as the slave size is
used (old behavior).
- When max_periods = 0 (or 1), the number of periods is variable
between 2 and the slave buffer size.
- When max_periods greater than 2 is given, it specifies the max
periods of that pcm explicitly.
When no option is given in the PCM defintion, the value
"defaults.pcm.dmix_max_periods" is referred as default.
The default value is 0, as defined in alsa.conf.
You can override this in ~/.asoundrc or /etc/asound.conf as you like.
Created a new rate converter plugin SDK.
A rate converter can be replaced as an extra plugin now.
The default rate converter is a built-in linear converter.
You can find a sample external converter in alsa-plugins package.
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.