Commit graph

1016 commits

Author SHA1 Message Date
Clemens Ladisch
6e6f4b9c93 dmix: add U8 support
Add support for direct mixing of U8 samples (for devices like some USB
headsets or the Tux Droid).
2007-12-10 12:35:08 +01:00
Clemens Ladisch
a3fe1f7800 dmix: simplify mix_areas()
The code for the three supported sample widths is almost the same, so it
makes sense to merge the three cases.
2007-12-10 12:32:36 +01:00
Clemens Ladisch
79db4a6bfa dmix: rename mix_areas*
Rename all mix_areas* symbols so that they contain the sample width
instead of some meaningless number.
2007-12-10 12:31:29 +01:00
Takashi Iwai
7dca3ab1ea Make local functions really local
Rename the local functions to snd1_* so that they won't be exported
out of alsa-lib.

Some functions are still kept because aserver requires them.  Sigh.
2007-11-30 18:26:13 +01:00
Takashi Iwai
2ae2bbf190 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.
2007-11-28 14:24:26 +01:00
Takashi Iwai
72ede8a12d 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.
2007-11-26 12:29:37 +01:00
Takashi Iwai
0b66de95a9 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.
2007-11-23 15:46:48 +01:00
Takashi Iwai
683c8bc4a2 Clean up using gettimestamp()
Introduce a new local function gettimestamp() to get the current timestamp.
2007-11-21 12:19:43 +01:00
Takashi Iwai
7379b061eb 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.
2007-11-21 12:10:35 +01:00
Takashi Iwai
b0b7d0280f pcm - Limit the avail_min minimum size
Fix avail_min if it's less than period_size.  The too small avail_min
is simply useless and the cause of CPU hog with rate plugin.
2007-11-20 15:29:10 +01:00
Takashi Iwai
408af4b675 Fix wrong return values in direct plugins
Fixed the codes returning error values that are not set properly
via errno.
2007-11-16 12:06:43 +01:00
Stas Sergeev
c13b8dc986 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.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>
2007-11-12 12:01:16 +01:00
Takashi Iwai
07137c0267 ioplug - Fix the refinement of period_* after periods
When changing only PERIODS after BUFFER_*, ioplug doesn't update
the corresponding PERIOD_* parameters properly.  This should fix
ALSA bug#2601.
2007-11-05 12:46:46 +01:00
Takashi Iwai
9eb272c753 Fix gcc compile warnings
Fix gcc compile warnings with nasty const cast.  Let's use simply macros
instead of inline functions.  It's just an array access after all...
2007-10-25 15:34:43 +02:00
Takashi Iwai
d6093c58f3 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.

From: Mike Gorse <mgorse@mgorse.dhs.org>
2007-10-18 11:10:35 +02:00
Jaroslav Kysela
d25e281230 Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
Jaroslav Kysela
4f70a301ac release 1.0.15rc3
Patch-level: Merged
2007-09-21 10:40:55 +02:00
Takashi Iwai
67399e35ff Fix wrong offset calculation in snd_pcm_{read|write}_mmap()
The offset used in snd_pcm_{read|write}_mmap() is not the linear offset
but the offset in a ring buffer.  It has to be rounded.
2007-09-20 13:20:03 +02:00
Takashi Iwai
c7e1676dcd Don't set PCM pointer at error in snd_pcm_hw_open()
snd_pcm_hw_open() may set a non-NULL to pcmp even if it returns an error.
Some codes like dmix expects it's NULL, and cause the double free().
2007-08-06 16:09:27 +02:00
Clemens Ladisch
fca29a6172 remove unused variables
Remove some unused variables that the compiler warned about.
2007-07-13 12:44:43 +02:00
Takashi Iwai
4cdb17c601 Split mmap-emulation code from hw layer
Move out mmap-emulation code from hw layer to its own plugin.
This cleans up the mess in pcm_hw.c.
2007-07-11 17:44:09 +02:00
Takashi Iwai
845d9222b2 fix mmap emulation bug of recording doesn't work
From: Roy Huang <royhuang9@gmail.com>

Record doesn't work if enabling mmap emulation and rate conversion
needed, this patch fix this bug.
2007-07-05 12:15:16 +02:00
Takashi Iwai
267d7c7281 Add support of little-endian on i386/x86_64 dmix
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.
2007-07-03 19:52:33 +02:00
Clemens Ladisch
a03ddea415 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.
2007-05-21 09:13:19 +02:00
Steve Longerbeam
63e4c591f9 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>
2007-05-18 15:04:12 +02:00
Takashi Iwai
577959ec87 Revert the wrong change in src/pcm/Makefile.am
Reverted the wrong change in src/pcm/Makefile.am, accidentally merged
from my own development version...
2007-05-15 15:58:58 +02:00
Takashi Iwai
21888c5f50 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.
2007-05-03 20:55:54 +02:00
Takashi Iwai
7f9dd4ac65 Fixed an access to uninitialized variable in pcm_rate.c
Fixed an access to uninitialized variable in pcm_rate.c (in error message).
2007-03-28 14:31:46 +02:00
Takashi Iwai
c16111516f Define an array of default rate plugins
Define an array of default rate plugins, set speexrate as the first
entry.  The linear is used as a fallback.
2007-03-28 12:38:27 +02:00
Takashi Iwai
c6bebac05e Trivial fix of compile warning
Fix unused variable j.
2007-03-22 01:17:22 +01:00
Takashi Iwai
36987b02c0 String array for default rate plugin list
Change the rate converter type to allow string arrays in addition to
a string.  When a string array is given, the rate plugin probes each
string and try to load the converter plugin in the order of the list.

For example, you can set
	defaults.pcm.rate_converter	[ "samplerate" "linear" ]
so that samplerate plugin is preferred to linear plugin if it's
installed.
2007-03-22 00:58:42 +01:00
Takashi Iwai
70e4ec9d08 Allow build without libdl and libpthread
Allow building alsa-lib without libdl and libpthread.
Added new options to configure, --with-libdl and --with-pthread.
2007-03-22 00:48:18 +01:00
Takashi Iwai
36cc1daad8 Remove _snd_pcm_link_descriptors() and more comments
Removed the obsoleted _snd_pcm_link_descriptors() from pcm_local.h.
Added more comments on multi plugin.
2007-03-13 10:44:28 +01:00
Takashi Iwai
8048321c76 More better fix for linked start/stop
Instead of link_fd, more generic callback link_slaves is introduced.
This is called for linking the slave streams as the source to the
given master stream.
2007-03-13 02:52:33 +01:00
Takashi Iwai
1753ae794f Fix start/stop of multi plugin
The start/stop of sync'ed stream of multi plugin.
This should make some JACK users with multiple devices happier.
2007-03-13 00:40:22 +01:00
Clemens Ladisch
ffcffac13d fix a signedness warning 2007-03-12 08:27:15 +01:00
Takashi Iwai
6329db3af1 Improve the sample conversion in plug layer
Improve the sample conversion in plug layer for the sample bits
reduction.  Use round instead of truncating, which introduces
more quantization noise.

Original patch by Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
2007-03-09 17:06:23 +01:00
Clemens Ladisch
f54f03bfc4 fix SNDERR() format strings/arguments 2007-02-12 13:45:57 +01:00
Takashi Iwai
c818bab2e3 Fix compile warning with internal function
Fixed the compile warning refering to the internal function
snd_pcm_hw_params_set_format_first.
2007-01-08 16:39:26 +01:00
Jaroslav Kysela
4a1cefd24d pcm_ladspa - fix none policy
In some configurations, channel samples were not copied correctly.
Also, fix memory leaks and remove extra end-of-line chars from SNDERR
strings.
2006-12-20 16:01:27 +01:00
Clemens Ladisch
8a36b67b9f direct pcm plugins: fix format selection
The old format tried to do something when the requested format was not
supported by the hardware, but did not actually select any other format.
Now we try to switch to any format supported by dmix, or any other
format when the plugin is not dmix.
2006-12-04 18:20:40 +01:00
Clemens Ladisch
9819099e0e direct pcm plugins: fix channel number selection
The code to set the number of channels did not work when the requested
channel count was not available and when the min/max channel counts were
not identical.

Replacing the entire selection code with
snd_pcm_hw_params_set_channels_near() gives the same result in the cases
where it previously worked, and works in all other cases.
2006-12-04 18:14:13 +01:00
Takashi Iwai
c9610c024d Fix build of static library
- Add missing pcm_empty entry
- Return the array pointer instead of the first array member.
  Otherwise only the first entry is linked to the binary.
2006-10-27 16:08:21 +02:00
Jaroslav Kysela
ddf9599542 pcm: fix ipc offset calculation for direct plugins
Also add more accurate description to x24 formats.
2006-10-23 11:34:00 +02:00
Jaroslav Kysela
a185898230 added pcm_empty plugin and .hgignore additions 2006-10-13 18:01:27 +02:00
Jaroslav Kysela
10cca7c03b pcm direct plugins - fix memory leak (sconf must be deleted) 2006-10-12 14:42:45 +02:00
Jaroslav Kysela
1300e70573 more name hint interace updates
- add long card name to device description
- create empty PCM plugin to allow right hint description parsing
- reorder devices in alsa.conf
- make namehint more configurable (using default.namehint.showall switch)
- add two levels basic and exteded for hints to default configuration files
- do not show direct device aliases
- removed all known memory leaks
2006-10-12 14:34:23 +02:00
Jaroslav Kysela
13fdc41785 add snd_device_name_hint() function and initial implementation
- add snd_device_name_hint() and snd_device_name_free_hint() functions
- add snd_ctl_iface_conf_name() functions
- do not accept parameters for the plugin definition without @args section
- add defaults.pcm.dmix.card/device and dsnoop.card/device definitions
- add hints for HDA-Intel.conf, pcm/dmix.conf, pcm/dsnoop.conf and alsa.conf
- add test/namehint test utility
- doxygen related cleanups
2006-10-11 13:18:57 +02:00
Jaroslav Kysela
57eb3145b8 fix various warnings
See also ALSA bug#1689
2006-10-06 13:18:34 +02:00
Takashi Iwai
1827d9ccff Fix snd_pcm_open_noupdate() to refer alias
Fixed snd_pcm_open_noupdate() to refer alias.  This fixes the call like

	% aplay -Dplug:bah

where bah is an alias of a certain definition.
2006-10-04 17:32:22 +02:00