Commit graph

177 commits

Author SHA1 Message Date
Clemens Ladisch
762fe145e9 mixer: fix enum check
The recent CHECK_ENUM fix uncovered a bug in snd_mixer_selem_is_enumerated()
which would now return -EINVAL for any non-enum control, which would be
interpreted as 'true' by callers like amixer or alsamixer.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-11-23 10:56:46 +01:00
Michael Olbrich
13af48843d simple_none.c uses HAVE_SOFT_FLOAT it has to include config.h
for this to work properly.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-16 11:31:53 +01:00
Takashi Iwai
3440994f68 Fix CHECK_ENUM() in simple.c
simple.c: In function ‘snd_mixer_selem_is_enumerated’:
simple.c:881: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-08 09:26:59 +01:00
Takashi Iwai
ac9de424bc mixer: Add Speaker and Beep names to the weight list
Added strings "Speaker" and "Beep" to the weight list so that the entries
appear in more appropriate positions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-31 16:41:12 +02:00
Takashi Iwai
a789b66d00 Fix build with softfloat option
Fix build of alsa-lib when --with-softfloat is used:
 - disable ladspa plugin
 - don't use sqrt() function

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-21 09:25:48 +01:00
Diego E. 'Flameeyes' Pettenò
03388ca6d3 Mark static tables as constant when possible.
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>
2008-11-21 22:39:38 +01:00
Diego E. 'Flameeyes' Pettenò
fc8d8bb2e6 Make string arrays as constant as possible.
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>
2008-11-21 22:14:52 +01:00
Takashi Iwai
55c77d0ec2 Fix volume/switch updates for global/simple mixer elements
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>
2008-11-10 17:39:11 +01:00
Jaroslav Kysela
058dde8b7d implemented integer volume <-> dB volume conversion functions for simple mixer 2008-04-21 11:44:20 +02: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
Clemens Ladisch
7b51f62732 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.
2007-11-12 08:50:08 +01:00
Takashi Iwai
68e5771a6f Remove assert from header files
Putting assert in the public macros isn't good idea at all.
Let's get rid of them.

Also, clean up snd*_alloca() functions to use a helper macro
instead of copy and paste.
2007-10-25 15:36:03 +02:00
Takashi Iwai
f38e5feca3 Export dB conversion helper functions
Export helper functions to convert dB level and range.

snd_tlv_*dB*() are to convert dB level or range directly from TLV data.
snd_ctl_*dB*() are to get dB level or range from a control element.
2007-10-24 13:04:14 +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
Takashi Iwai
dac0e3b17c 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.
2007-08-29 14:48:31 +02:00
Jaroslav Kysela
e0d7bfcea6 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)
2007-07-11 10:10:12 +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
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
Clemens Ladisch
f54f03bfc4 fix SNDERR() format strings/arguments 2007-02-12 13:45:57 +01:00
James Courtier-Dutton
6d511eefa0 Implements support for capture/playback enums. 2006-10-13 22:06:17 +01: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
275afa4d70 simple mixer - fix error recovery path for volume / switch write
If volume or switch write fails, the internal contents for element
is changed, but it is wrong. Reread the whole simple element in this
case to get correct values.
2006-10-01 17:57:36 +02:00
Takashi Iwai
9d2518bb91 Fix wrong scales in linear volume calculation
Fixed wrong scales of dB values (TLV is 0.01dB unit) in the linear
volume calculation.
2006-09-07 20:51:41 +02:00
Takashi Iwai
fba26cd668 Add support of dB range compound TLV
Added the support of dB range compound TLV type in the simple mixer layer.
All get_dB, get_dB_range and set_dB ops are supported.
2006-09-06 12:17:29 +02:00
Takashi Iwai
b0bbcd0697 Add handling of linear volume in simple mixer
Added the handling of linear volume TLV in the simple mixer layer.
2006-08-28 13:27:41 +02:00
Takashi Iwai
4962ec5a5c Add set_dB ops to simple mixer
Added the set_dB ops to simple mixer.
2006-08-25 11:56:50 +02:00
Takashi Iwai
448cbb6141 Add dB_range ops for simple mixer
Added the dB_range ops for simple mixer.
2006-08-25 11:54:59 +02:00
Takashi Iwai
66f3749cab Fix segfault when invalid TLV is passed
Fix segfault when invalid TLV is passed.
The invalid TLV entries must be ignored as error.
2006-08-23 15:44:09 +02:00
Takashi Iwai
4165a5bfd1 Fix dB ops for global volume
Fixed dB ops for global volume.
2006-08-23 15:25:43 +02:00
Takashi Iwai
ae76129999 Move dB parser to mixer abstraction
Moved the parser of dB value to mixer abstraction from hcontrol layer.
Also, cleaned up codes.
2006-07-28 14:36:37 +02:00
Jaroslav Kysela
c4a5efeba3 mixer - cleanups for dB scale parsing 2006-07-27 10:45:25 +02:00
James Courtier-Dutton
5e3fc87888 Implement support for dB gain display in alsamixer. 2006-07-22 14:56:48 +01:00
Takashi Iwai
dc438157c5 Fix the description of snd_mixer_handle_events()
Fixed the description about the return value of snd_mixer_handle_events()
(ALSA bug#1932).
2006-03-21 16:58:32 +00:00
Clemens Ladisch
4433248bf3 remove superfluous free() checks
free() correctly handles NULL pointers, so we can omit explicit checks
for that condition.
2006-02-27 09:58:32 +00:00
Takashi Iwai
76f7af823b Fix compile warnings
Fix trivial compile warnings.
2005-12-16 18:43:49 +00:00
Takashi Iwai
33a40df1af Fix the handling of stereo capture source
Patch from bug#1610

The simple mixer doesn't handle the stereo "Capture Source" properly,
wrongly set cswitch-joined.
2005-12-02 13:39:24 +00:00
Clemens Ladisch
b5f50b06d2 fix doxygen warnings
Fix some wrong parameter names, hide some undocumented functions, and
correctly escape <> characters.
2005-10-12 16:08:53 +00:00
Jaroslav Kysela
5af75610f2 mixer API - extend simple enumerated controls for direction tests
Added snd_mixer_selem_is_enum_playback() and
snd_mixer_selem_is_enum_capture() functions.
2005-08-24 10:41:16 +00:00
Jaroslav Kysela
a33c78ddd8 moved simple mixer abstraction modules to modules/mixer/simple directory
Compile dynamic modules outside the alsa-lib tree to allow linking them
against libasound.so - proper versions of dynamic symbols.
2005-08-22 12:07:55 +00:00
Takashi Iwai
19ac270f1e Add missing header files
Added missing header files to Makefile.am.
2005-08-19 17:23:05 +00:00
Clemens Ladisch
8737d1843c simple mixer: fix compilation with gcc 2.x
Move a variable declaration to the top of the function for compatibility
with gcc 2.x.
2005-08-16 15:30:19 +00:00
Takashi Iwai
99005614ba Add -avoid-version for smixer plugins
Added -avoid-verstion linker option for smixer plugins.
2005-08-12 15:51:48 +00:00
Jaroslav Kysela
59a8226184 The simple mixer abstraction - more work
- separated the "base library" from ac97.c (dynamically loaded)
  - added necessary handling of all private structures
  - added selector and sid registration functions and handling code
- added basic code for hda.c (yeah, my notebook has this hw)
2005-07-31 09:08:43 +00:00
James Courtier-Dutton
c593c1d260 Fix bug when a sound card had a stereo mute element and would fail to unmute the right channel.
Fixes a typo. Fixes bug#[ALSA - lib 0001219]
2005-06-29 20:31:33 +00:00
Jaroslav Kysela
1596c8c355 Fixed #include statements 2005-06-27 08:16:06 +00:00
Clemens Ladisch
274bce69e7 fix file name for Doxygen
Use the correct file name for \file to make Doxygen happy.
2005-06-23 07:45:17 +00:00
Jaroslav Kysela
ce67d5389b more simple mixer - basic abstraction - work
- midlayer cleanups and simplification
- probably broke the "none" abstraction code somehow (not intensively tested
  midlayer changes)
- trying to implement ac97 module
  - far from finished
  - common code should be moved to alsa-lib as core for other modules
  - perhaps simple_abst.c can be based on this common code, too
2005-06-16 11:59:26 +00:00
Jaroslav Kysela
4c4849230c initial & empty smixer-ac97.so module (only the build framework) 2005-06-07 11:44:25 +00:00
Jaroslav Kysela
3bcf2f805d Implemented the top-level redirector code for simple mixer
- mixer_abst.c is almost finished (an example module should be created now)
- also fixed some error paths for name function
2005-06-06 14:01:13 +00:00
Jaroslav Kysela
157cb698ac mixer - fix typo and memory leak 2005-06-03 14:04:53 +00:00