Master Volume controls were removed from Xonar D2/D2X cards; add the
softvol plugin so that we have at least PCM volume.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The commit a13707da6b
pcm_softvol plugin: remove access type change for refine
breaks the softvol in the case of RW -> MMAP. The slave of softvol
must be an mmap although the previous fix forces RW access.
This patch reverts the commit, and the fixed access refine method
to hanle non-interleaved <-> interleaved changes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This makes it possible to write them to .data.rel.ro or to .rodata if
there is no relocation involved (arrays of character arrays).
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Use "const char *const []" as type for string arrays, or convert to
"const char [][x]" when it makes sense.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
This ensures they are emitted in .data.rel.ro rather than .data.rel,
which should make a nice difference when using prelink.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
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>
This adds extra safety that the built libraries will have all the
correct dependencies linked in.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
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>
Since alsa-lib is not a tool generating architecture code, the target
definition does not matter, instead use $host and $build properly.
See http://blog.flameeyes.eu/2008/10/11 for a detailed explanation of
the problem and the fix.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
snd_pcm_meter_add_scope_conf() may cause a segfault when pcm_scope_type
isn't defined.
Initialize type_conf properly to avoid it.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fixed a long-standing bug that the values of global or simple mixer
elements aren't updated when dir = SM_CAPT is given.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The simpler mixer interface is not legacy, so the header file shouldn't claim
otherwise.
Fixes bug#3569
From: Lennart Poettering <mznyfn@0pointer.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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:
http://mailman.alsa-project.org/pipermail/alsa-devel/2008-June/008456.html
From: Lennart Poettering <mznyfn@0pointer.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>
Updated IEC958 consumer status channel definitions according
to the third edition of IEC60958-3 spec.
Signed-off-by: Pawel Moll <pawel.moll@st.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>
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>
The clamping of the input parameter in snd_pcm_rewind()/_forward() is
in the wrong direction.
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The program uses snd_pcm_format_width() wrongly to calculate the sample
size. It must be snd_pcm_format_physical_width() instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>