Addition of "infile" parameter (virtual mic) to the file plugin
When this new parameter is specified, the behavior of opening a file PCM
for input is changed to the following: reads from the device, instead of
being passed down to the slave PCM, will read the raw data from the
specified file. No file writes will take place in this case. In the
absence of this parameter, previous behavior is unchanged.
The input file name and descriptor are kept in the snd_pcm_file_t struct
in a manner analogous to the already existing output file parameter.
TODO:
(1) Only interleaved reads (snd_pcm_file_readi) have been implemented
for now.
(2) File read()'s that return a number of bytes that's not a multiple of
the frame size will result in data loss (choppiness). The rbuf,
rbuf_size_bytes, and rbuf_used_bytes members of the snd_pcm_file_t
struct will be used to address this problem in the future.
(3) Mind whether the PCM was opened in blocking mode. If so, we'll have
to loop until the buffer has been filled with read()'s.
Signed-off-by: Juan Carlos Castro y Castro <jcastro@vialink.com.br>
Clemens Ladisch [Tue, 2 May 2006 14:08:36 +0000 (16:08 +0200)]
add more sequencer port type information bits
Add four new information flags SNDRV_SEQ_PORT_TYPE_HARDWARE, _SOFTWARE,
_SYNTHESIZER, _PORT for sequencer ports. This makes it easier for apps
like Rosegarden to make policy decisions based on the port type.
Fixed the segfault in the error path of snd_pcm_hook_add_conf()
(calling invalid install_func pointer).
Also, added the missing snd_dlclose() to release the handle properly.
Revert the last fix: finer sync of dmix in delay callback
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.
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.
Takashi Iwai [Fri, 24 Mar 2006 14:53:41 +0000 (14:53 +0000)]
Fix noisy output of dmix with two periods
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.
Takashi Iwai [Fri, 24 Mar 2006 14:51:24 +0000 (14:51 +0000)]
Fix PCM auto-start conditions
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
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.