Commit graph

22 commits

Author SHA1 Message Date
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
Clemens Ladisch
fca29a6172 remove unused variables
Remove some unused variables that the compiler warned about.
2007-07-13 12:44:43 +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
5c71dd3ee7 Add dB range information to PCM softvol plugin
Added the dB range information to PCM softvol plugin.
Also, fixed the coefficient table to match with the
accurate dB step 0.20dB.
2006-08-25 11:46:19 +02:00
Takashi Iwai
504a2e34a4 Fix compile warnings
Fix compile warnings by adding cast.
2006-03-29 09:29:44 +00:00
Juergen Kreileder
5ba4634ab5 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)

Signed-off-by: Juergen Kreileder <jk@blackdown.de>
2006-03-21 16:55:25 +00:00
Takashi Iwai
eccc92a34d Fix infinite parse of recursive definitions
Fixed the infinite parse (and eventually segfault) of recursive definitions.
Also fixed the parse of a string slave PCM of direct plugins.
2006-01-30 14:41:51 +00:00
Takashi Iwai
ffdb04c3ea Fix buffer allocation and mmap with plugins
Fixed the bug producing silent tones with some combinations of plugins.
The internal buffer handling is now better (cleaner) integrated with
snd_pcm_generic_*().
2005-09-02 16:36:40 +00:00
Takashi Iwai
087184b0f9 Fix doxygen documents
Fix the warnings of doxygen parsing.
Add some missing documentation.
2005-05-24 14:14:28 +00:00
Takashi Iwai
dd37bb20ee Move poll_* callbacks to fast_ops
Moved poll_* callbacks to fast_ops.
These callbacks may be called frequently indeed.
2005-05-23 09:03:16 +00:00
Takashi Iwai
842b573424 Add poll_descriptors and poll_descriptors_count callbacks
Added poll_descriptors and poll_descriptors_count callbacks for multiple
poll_fd's.
2005-05-18 10:45:06 +00:00
Takashi Iwai
73008debc3 Add snd_pcm_parse_control_id()
Added a new function snd_pcm_parse_control_id() for the user controls.
This can be used in external plugins, too.
2005-03-09 11:57:54 +00:00
Takashi Iwai
145f85fff8 Accept string type card
Accept string type card entry to be compatible with others.
2005-02-22 20:21:23 +00:00
Takashi Iwai
7e74f2ef1b Fix the available formats
Fixed the available formats to be set in hw_refine.
2005-01-21 19:38:10 +00:00
Jaroslav Kysela
836987aa99 improved stream linking and plugin code cleanups
- added link/unlink/link_fd fast_ops callbacks
- moved code from snd_pcm_link to pcm_hw.c
- moved "empty" routines pointing to slave to pcm_generic.c
- introduced snd_pcm_generic_t
2005-01-20 15:07:51 +00:00
Takashi Iwai
ff9c030e65 Use snd_config_get_bool()
Clean up the code, using snd_config_get_bool().
2005-01-13 15:46:34 +00:00
Takashi Iwai
5211c26927 Fix compile warning
Fixed compile warning due to signed/unsigned comparison.
2005-01-12 11:19:47 +00:00
Takashi Iwai
c7feb066b1 Support stereo volume control
softvol supports stereo volume controls.
Fixed the dB calculation, too.
2005-01-04 11:37:29 +00:00
Takashi Iwai
82e408d08b Set max volume as default for softvol
Set max volume as default for softvol.
2005-01-03 17:12:51 +00:00
Takashi Iwai
199d207423 Change the behavior with hardware volume controls
When a hardware volume control is given, softvol plugin simply
passes the slave PCM without any additional changes.
2005-01-03 14:37:39 +00:00
Takashi Iwai
0732cce6f0 Add accessor to user control elements
Added accessor functions to user control elements, snd_ctl_elem_add_*(),
and_ctl_elem_remove() and snd_ctl_elem_info_is_user().
2005-01-03 11:52:39 +00:00
Takashi Iwai
30f35c1f7a Add softvol PCM plugin
The softvol PCM plugin is added.  It applies the software volume attenuation,
which may be useful for codecs without volume controls.

Currently, the control is only mono.  The attenuation is applied to all
channels equally.  The control is probed and automatically created
when not exists yet.
2004-12-27 14:40:19 +00:00