Add support for S32_3LE and byte-swapped S16/S32 to softvol
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)
Takashi Iwai [Tue, 21 Mar 2006 10:39:49 +0000 (10:39 +0000)]
Fix timer read from 32bit user-space on 64bit kernel
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.
Takashi Iwai [Tue, 21 Mar 2006 10:27:35 +0000 (10:27 +0000)]
dmix - Allow more flexible buffer sizes
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
Takashi Iwai [Fri, 17 Mar 2006 18:09:07 +0000 (18:09 +0000)]
Add restriction parameters to pcm hw layer
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.
Clemens Ladisch [Mon, 13 Mar 2006 10:40:21 +0000 (10:40 +0000)]
rate plugin: fix fragment size calculation
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.
Clemens Ladisch [Mon, 13 Mar 2006 10:38:51 +0000 (10:38 +0000)]
rate plugin: optimize calculation of the continuous buffer part
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().
Takashi Iwai [Fri, 3 Mar 2006 17:51:33 +0000 (17:51 +0000)]
Portability fix for alsa-lib on mips
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.
Clemens Ladisch [Mon, 27 Feb 2006 10:03:19 +0000 (10:03 +0000)]
allow changing of device directory path
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.
Clemens Ladisch [Mon, 27 Feb 2006 09:54:57 +0000 (09:54 +0000)]
Do not abort in snd_xxx_close() functions
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.
Takashi Iwai [Fri, 17 Feb 2006 20:49:21 +0000 (20:49 +0000)]
Fix check of nonblock option
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.
Takashi Iwai [Fri, 27 Jan 2006 11:54:06 +0000 (11:54 +0000)]
Remove bad assert
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.
Jaroslav Kysela [Mon, 2 Jan 2006 12:16:59 +0000 (12:16 +0000)]
pcm - fix the buffer allocation for NONINTERLEAVED mmap access
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).
Clemens Ladisch [Mon, 19 Dec 2005 07:39:03 +0000 (07:39 +0000)]
dmix: add S24_3LE support
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.
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
Clemens Ladisch [Mon, 12 Dec 2005 09:36:02 +0000 (09:36 +0000)]
seq: reorganize sequencer client numbers
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.
Takashi Iwai [Wed, 30 Nov 2005 11:38:24 +0000 (11:38 +0000)]
Allow partial build with selected components
Add --enable-* and --with-pcm-plugins configure options for partial builds.
User can choose the core components (pcm, mixer, rawmidi, hwdep, seq, instr)
via --enable-xxx or --disable-xxx option. As default, all components are
enabled.
The PCM plugins to build can be selected via --with-pcm-plugins option.
For example, to build only rate and linear plugin, pass
--with-pcm-plugins=rate,linear
Passing "all" will select all plugins (it's the default value).
The plug plugin will select linear and copy plugins automatically.
The other auto conversions of plug plugin are enabled only when the
corresponding plugin is selected.
Takashi Iwai [Mon, 21 Nov 2005 10:47:42 +0000 (10:47 +0000)]
abort snd_pcm_dmix_drain when state is SND_PCM_STATE_XRU
From: Sascha Sommer <saschasommer@freenet.de>
this is a fix for bug 0001559.
Unlike my first guesses the real problem is not in the kernel driver but in
alsa-lib. Whenever the current dmix status is xrun and snd_pcm_dmix_drain
gets called the process will hang forever in the poll function. The reason is
that poll gets called even though the timer already stopped.
As described in the bugtracking system this bug was not noticable with alsa
versions that used the old IOCTLS because the SNDRV_TIMER_IOCTL_STOP ioctl
never reached the timer kernel module.
Attached patch fixes this problem for alsa-lib 1.0.10 by simply calling
snd_pcm_dmix_drop when snd_pcm_dmix_drain gets called in the state
SND_PCM_STATE_XRUN.
Takashi Iwai [Thu, 17 Nov 2005 12:08:32 +0000 (12:08 +0000)]
Fix generation of IEC958 subframes
From: Nicolas Boullis <nboullis@debian.org>
While working on an ALSA driver for the audio part of em8300-based MPEG
decoder boards (Sigma Designs' Hollywood+ boards and Creative Labs' DXR3
boards), I think I discovered a bug in the code that generates IEC958
subframes from linear samples (iec958 plugin): M and W preambles are
swapped, and B preambles should only be used on even subframes. The
attached patch fixes this issue.