Takashi Iwai [Tue, 30 Jun 2009 09:11:34 +0000 (11:11 +0200)]
Manage dlobj lifetime in pcm_hooks.c
The shared object may be still needed depending on the implementation
of hook-installation functions. When any hooks are registered in the
installation function, the dlobj has to be kept opened until closing
the PCM instance.
Clemens Ladisch [Mon, 22 Jun 2009 08:00:46 +0000 (10:00 +0200)]
seq_midi_event: fix decoding of (N)RPN events
When decoding (N)RPN sequencer events into raw MIDI commands, the
extra_decode_xrpn() function had accidentally swapped the MSB and LSB
controller values of both the parameter number and the data value.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Clemens Ladisch [Mon, 22 Jun 2009 08:00:03 +0000 (10:00 +0200)]
MIDI event decoder: prevent running status after sysex
Running status cannot be using in the command immediately following
a system exclusive command, so we have to reset the running status
state in that case.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Takashi Iwai [Tue, 2 Jun 2009 14:13:01 +0000 (16:13 +0200)]
Query the supported rate ranges from rate plugins
Extend the PCM-rate plugin protocol to allow the host to query the
supported sample rates. The protocol version is bumped to 0x010002,
and the version number negotiaion is slightly changed.
Now the plugin is supposed to fill the version it supports in return.
The old versioned plugins are still supported, but they may spew
version-mismatch warning prints.
Takashi Iwai [Mon, 23 Mar 2009 08:06:23 +0000 (09:06 +0100)]
Add route_policy copy to HDA-Intel.conf for capture
Since some digital mics have the phase-inversion problem in one channel,
adding both channels for mono stream results in the noise.
Use route_policy copy to avoid that situation.
Takashi Iwai [Tue, 17 Feb 2009 15:58:12 +0000 (16:58 +0100)]
Change numid properly with external ctl plugins
So far, external ctl plugins don't change numid. Some apps expect the
non-zero numids with list, and the plugin doesn't work for them.
This patch adds a fake numid to each control based on the offset
number. The lookup with non-zero numid is supported but is pretty
inefficient. Eventually the plugin side may be optimized to look
at the numid, too.
Takashi Iwai [Fri, 13 Feb 2009 16:14:51 +0000 (17:14 +0100)]
Add hint.device = 0 to pcm.default of HDA-Intel.conf
The hd-audio driver may have no analog stream but only a digital one
which has usually non-zero device number. To avoid the bogus namehint,
set hint.device 0 for pcm.default (it wasn't handled properly due to
asym).
Clemens Ladisch [Wed, 11 Feb 2009 08:53:29 +0000 (09:53 +0100)]
fix pcm_set_params() documentation
The documentation for the latency parameter of pcm_set_params() says
that the value 0 uses an optimal value. This is wrong, as there is no
special handling for 0, and the result will be a buffer of minimal size.
Therefore, remove that incorrect statement.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Takashi Iwai [Mon, 2 Feb 2009 15:11:39 +0000 (16:11 +0100)]
Fix misc compile warnings
Shut up misc compile warnings from gcc:
pcm_plug.c: In function ‘snd_pcm_plug_change_mmap’:
pcm_plug.c:608: warning: enumeration value ‘SND_PCM_ACCESS_MMAP_INTERLEAVED’ not handled in switch
pcm_plug.c:608: warning: enumeration value ‘SND_PCM_ACCESS_MMAP_NONINTERLEAVED’ not handled in switch
pcm_plug.c:608: warning: enumeration value ‘SND_PCM_ACCESS_MMAP_COMPLEX’ not handled in switch
Pavel Hofman [Thu, 29 Jan 2009 10:59:27 +0000 (11:59 +0100)]
PCM parameters in file plugin
* added support for including pcm stream params in the output filename
* added support for piping the stream to a shell command if the filename
string starts with a pipe char
Signed-off-by: Pavel Hofman <pavel.hofman@insite.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 28 Jan 2009 14:00:35 +0000 (15:00 +0100)]
Fix off_t in kernel struct
The off_t in kernel struct (for ioctls) is actually different from the
definition of user-space off_t. The kernel off_t is equial with long
while user-space off_t depends on the large-file support.
Takashi Iwai [Tue, 27 Jan 2009 16:21:34 +0000 (17:21 +0100)]
Fix plug conversion with mmap emulation
If the slave PCM supports only another type of interleaved format,
plug did convert it wrongly and resulted in an unused access type
error. For example, if a slave PCM supporst only RW_NONINTERLEAVE
access and you try to play an interleaved format file, it resulted
in an error.
Takashi Iwai [Wed, 10 Dec 2008 17:20:50 +0000 (18:20 +0100)]
Don't accept an empty string for $ALSA_CONFIG_PATH
The variable $ALSA_CONFIG_PATH specifies the config path, but the current
code accepts the empty string and results in a mysterious error because
no config file is found.
This patch fixes the check of the variable and takes the default value
if the string is empty.
Make seq, rawmidi and control operation structures static const.
Since they are never changed it does not make sense to have them in
the writeable .data section, just make sure to add const to the ops
member in the structure definitions so that there are no extra
warnings added.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
By doing this we move them from the .data section to .rodata setion,
or from .data.rel to .data.rel.ro.
The .rodata section is mapped directly from the on-disk file, which is
always a save, while .data.rel.ro is mapped directly when using
prelink, which is a save in a lot of cases.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Add the attributes.m4 macro file from xine/lscube.
This is a shared macro file that is currently maintained in both xine
and lscube repositories and contains a series of utility macros to
check compiler and linker features.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Takashi Iwai [Wed, 19 Nov 2008 13:59:03 +0000 (14:59 +0100)]
Add linear plugin wrapping iec958 PCM for ice1724-based boards
The ice1724-based cards can handle only 32bit while the apps almost
expet 16bit format for SPDIF I/O. This prevents the default config
working on many apps like mplayer, xine, etc.
This patch simply adds the least automatic conversion by linear plugin.
Note that "plug" isn't used here. Otherwise we get a problem of the
routing (plug over plug is buggy).
Takashi Iwai [Fri, 17 Oct 2008 15:51:45 +0000 (17:51 +0200)]
Fix sort-out of non-existing devices in namehint
get_dev_name() checks wrongly the device_output, and it doesn't check
properly the case when only device is set and device_input and output
are unset. This resulted in listing of non-existing HDMI device, for
example. The patch fixes both issues.
Takashi Iwai [Tue, 7 Oct 2008 10:08:29 +0000 (12:08 +0200)]
Increase the components array size
Increase the components array size from 80 to 128 chars.
The string there is supposed to be null-terminated, so it can cover
the smaller array size in the older version, too.
Jaroslav Kysela [Tue, 9 Sep 2008 11:07:39 +0000 (13:07 +0200)]
pcm_softvol plugin: remove access type change for refine
The softvol plugin does in-place sample recalculation. The access type
cannot be changed like in linear plugins. Remove access type change
in refine functions.
This bug was detected with PulseAudio on Sony PS3 platform.
Jaroslav Kysela [Mon, 1 Sep 2008 09:38:53 +0000 (11:38 +0200)]
Add snd_pcm_avail() and snd_pcm_avail_delay() functions. Make snd_pcm_hwsync() deprecated.
As proposed in http://mailman.alsa-project.org/pipermail/alsa-devel/2008-June/008558.html
the snd_pcm_avail() and snd_pcm_avail_delay() functions are now available
to get accurate stream position in a straight way. The snd_pcm_avail_delay()
function was added to ensure full sync between avail and delay values. It's
actually implemented using delay() + avail_update() calls but it might be
changed in future.
snd_pcm_delay() is for synchronization purposes, it returns the overall latency
of the stream, not just the latency induced by the hardware playback buffer.
The documentation is a bit misleading about this fact, and some people already
misunderstood it. So let's reword this to make the explanation clearer and
explicit.
This is a result of the discussions of the thread this mail belongs to:
alsa-lib: Make sure SND_PCM_NO_xxx flags don't get lost when nonblocking mode is enabled
The plug PCM copies the 'mode' field from the slave PCM. If blocking mode is
enabled for the plug PCM the mode is subsequently overwritten with the original
requested 'mode'. If non-blocking mode is requested this does not happen.
Because the hw PCM synthesizes the 'mode' from the actual file descriptor flags
no SND_PCM_NO_xxx will ever be set for it. This has the effect that the 'mode'
of the plug PCM will also not include those flags anymore -- unless they are
overwritten as mentioned above. This basically means SND_PCM_NO_xxx is ignored
for plug:hw:4711 style device strings opened in non-blocking mode.
You can easily test this with "aplay --channels 7 --disable-channels -f S16_LE
-r 44100 -D plug:hw:0" on a device that cannot do 7 channels. Normally this
call should fail, however if you add "-N" to the command line this call will
succeed.
This patch simply copies the SND_PCM_NO_xxx flags back into the 'mode' field in
case we don't overwrite it with the original anyway.
Probably closes bug 3571 for good.
From: Lennart Poettering <mznyfn@0pointer.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
fix return value of snd_pcm_rewind()/snd_pcm_forward() to return how much actually has been rewound, instead of what actually could have rewound
Make snd_pcm_plugin_rewind()/_forward() actually return how much has
been rewound/forwarded instead of how much could have been
rewounded/forwarded. This makes the code actually do what the
documentation of snd_pcm_rewind() suggests.
Signed-off-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
fix type of internally used sframes variable, to avoid unnecessary casts
This minor patch fixes the type of the sframes variable in
snd_pcm_plugin_forward(). With this fix we need to cast less and the
code is less confusing.
Signed-off-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add boolean (mute) functionality to softvol plugin
When the resolution is set to 2, a boolean control is created as a
mute switch instead of a volume control.
Also, fixed the possible zero-division error.
Josh Green [Sat, 7 Jun 2008 08:10:49 +0000 (10:10 +0200)]
Fix segfault with dmix of 3-bytes formats
The i386 and x86-64 dmix may cause segfaults when 3-bytes formats are used
due to btsl asm code, which may overcome the buffer end-boundary.
The patch changes btsl to btsw so that it doesn't happen.
Takashi Iwai [Fri, 6 Jun 2008 15:10:41 +0000 (17:10 +0200)]
PCM: allow mmap-access conversion in plug
The plug plugin has a long-standing problem that it can handle only
slaves that support mmap because of format/rate/access conversions
(these corresponding plugins work only with mmap).
This patch adds the support of automatic mmap->rw conversion via
mmap_emul plugin.