The rounding done when converting to smaller sample widths fails for
saturated positive samples; in this case, the sample value overflows and
becomes negative. We are better off without rounding, even if we then
have quantization noise (of at most half the resolution of the least
significant bit).
Takashi Iwai [Fri, 30 Nov 2007 17:29:01 +0000 (18:29 +0100)]
Clean up Versions file
The entries in the current Versions file don't work as expected.
Since the first ALSA_0.9 has already snd_* global definitions, all
the rest are simply ignored. Some symbols (e.g. snd_hw_params_*)
indeed work because they have explicit symver definitions, but
ALSA_0.9.6 and later are all superfluous.
This patch clean up these useless entries. Also, the patch restricts
the matching patterns for _snd_* and __snd_* entries to reduce the
unneeded export symbols.
Takashi Iwai [Wed, 28 Nov 2007 13:24:26 +0000 (14:24 +0100)]
softvol - add missing name
softvol can be also a pass-thru when the given control already exists
as a hardware control, and the name isn't set properly because of
slave creation. This patch fixes it.
Takashi Iwai [Mon, 26 Nov 2007 11:29:37 +0000 (12:29 +0100)]
Set PCM name properly in empty and asym plugins
The PCM name isn't set properly on empty and asym plugins due to its call
of snd_pcm_open_slave(). Now a new function snd_pcm_open_named_slave()
is created and make snd_pcm_open_slave() an inline function calling the
new one with name=NULL.
Takashi Iwai [Fri, 23 Nov 2007 14:46:48 +0000 (15:46 +0100)]
Fix mmap with multi plugin
The mmap of multi plugin seems broken (for a long time!) due to its
creation of local buffer via snd_pcm_mmap(). Since the multi plugin
just needs to shadow the mmap buffer of each slave, it now has
mmap_shadow=1 and its own mmap/unmap method to do shadowing.
Takashi Iwai [Wed, 21 Nov 2007 11:10:35 +0000 (12:10 +0100)]
Fix timestamp in status in PCM direct plugins
PCM direct plugins didn't update the timestamp properly.
Now it always starts the slave PCM with MMAP tstamp_mode so that the
timestamp will be being updated. When a client is set up as MMAP
tstamp_mode as well, simply copy this slave timestamp. Otherwise
status callback calculates the current timestamp as usual.
Stas Sergeev [Mon, 12 Nov 2007 11:01:16 +0000 (12:01 +0100)]
Remove ugly hack in rate plugin poll_descriptors callback
The rate plugin has ugly hacks in poll_descriptors callback to adjust
avail_min when partial read/write occurs. This causes often unexpected
problems like XRUNs, especially with two-period cases.
Let's remove that beast, it's rather harmful than useful.
Clemens Ladisch [Mon, 12 Nov 2007 07:50:08 +0000 (08:50 +0100)]
simple mixer: fix calculation of control range
When calculating the value range of a control, the variables cannot be
initialized with zero because this would prevent the minimum from having
a value above zero or the maximum from having a value below zero.
Takashi Iwai [Tue, 30 Oct 2007 11:31:55 +0000 (12:31 +0100)]
Remove sequencer instrument layer
Remove obsoleted sequencer instrument layer from alsa-lib.
The old symbols are compiled in as default as dummy functions
(unless --disable-old-symbols is given to configure) so that
the old binaries can still work more or less.
Takashi Iwai [Wed, 24 Oct 2007 10:53:08 +0000 (12:53 +0200)]
Change assert condition in error message handler
Activating assert() in the default error message handler isn't always
good for producitve systems. Make this optional and enable only when
a special configure option is given (i.e. for explicit debugging).
Takashi Iwai [Thu, 18 Oct 2007 09:10:35 +0000 (11:10 +0200)]
snd_pcm_dmix_close: raise semaphore if unable to discard
This patch causes snd_pcm_dmix_close() to up a semaphore after downing it
if it is unable to discard it. It prevents some deadlock that I am
getting when a couple of applications interact and one of them closes the
device and later re-opens it.
Takashi Iwai [Wed, 29 Aug 2007 12:48:31 +0000 (14:48 +0200)]
Handle "Input Source" as a capture element
Some drivers use "Input Source" as the capture source mixer element because
mixer abstraction layer can't handle multiple "Capture Source" elements.
This patch adds a hack to handle Input Source as a capture route, and let
mixer apps know that it's a capture stuff, at least.
Takashi Iwai [Wed, 22 Aug 2007 09:41:58 +0000 (11:41 +0200)]
Continue build even if python-config doesn't exist
It's annoying that the configure script stops with an error if
python-config doesn't exist. It's no fatal error, so the configure
should disable the python components and continue.
Clemens Ladisch [Fri, 10 Aug 2007 07:39:24 +0000 (09:39 +0200)]
seq_midi_event: prevent running status after system messages
Reset the event type after encoding a system message to prevent any
following data bytes from being interpreted as data for a running status
system message, which is not allowed in MIDI.
Clemens Ladisch [Fri, 10 Aug 2007 07:38:47 +0000 (09:38 +0200)]
seq_midi_event: fix encoding of data bytes after end of sysex
Create a new state ST_INVALID for the encoder to prevent data bytes at
the beginning of a stream or after a sysex message being interpreted as
note-off parameters.
Jaroslav Kysela [Wed, 11 Jul 2007 08:10:12 +0000 (10:10 +0200)]
mixer simple basic abstraction - added python binding
reasons:
- rapid development
- class-like code structure
- more readable code
features:
- hcontrol binding is managed from python (opportunity to create
virtual mixer without driver or join multiple cards to behave as one)
i386/x86_64 alsa-lib may need to handle big-endian formats, e.g.
when running via qemu on PPC. The generic dmix code already has
both endian support, so let's use it as fallback.
Clemens Ladisch [Mon, 21 May 2007 07:13:19 +0000 (09:13 +0200)]
dmix/dshare/dsnoop plugin: enable slowptr by default
Enabling the slowptr options does not make snd_pcm_delay() and related
functions much slower than they would have been with a hw device, while
disabling this option greatly reduces the accuracy of those functions,
thus creating more jitter in any media player application that
synchronizes its output to the sound device.
Therefore, it is preferrable to have this option enabled by default.
Steve Longerbeam [Fri, 18 May 2007 13:04:12 +0000 (15:04 +0200)]
Add support for gain in softvol plugin
This patch allows for gain in the softvol plugin, in addition to attenuation.
The plugin now has a "max_dB" parameter (up to 50 dB) as well as the
original "min_dB" parameter (down to -51 dB). max_dB defaults to 0 dB, so
unless max_dB is specified in a device conf, the behavior of the plugin will
be the same as before (attenuation only).
HDA-Intel.conf is also modified to use softvol for its default capture.
So now, capture is filtered through softvol (range -30 to +30 dB) before
being passed on to dsnoop as before.
The softvol plugin allows a range of -51 to +50 dB, so max_dB could be
increased to 50. But eventually samples are going to get clipped. At 40
dB I was beginning to get clipping when recording a sample sound at a
"reasonably soft" volume using a digital mic on the stac9205 HDA codec.
The motivation for this work is that some HDA codecs have no hardware gain
control for some paths. For instance, the stac9205 has support for digital
mics, but there is no gain control widget for this signal before it is placed
on the Azalia link (only a mute). Therefore gain can only be accomplished
via software.
Signed-off-by: Steve Longerbeam <stevel@embeddedalley.com>
Takashi Iwai [Thu, 3 May 2007 18:55:54 +0000 (20:55 +0200)]
Add config and plugin directory options to configure
Added --with-configdir and --with-plugindir options to configure
which specify the directories for config files and plugin objects
respectively. The default paths when these options are not
specified are unchanged.
Added --enable-symbolic-functions configure option. This will detect
and pass -Bsymbolic-functions linker option, which gives you better
performance and smaller binary size. Only recent binutils supports
this option.