Commit graph

162 commits

Author SHA1 Message Date
Jaroslav Kysela
d01bbbd706 alsactl/init: Fix CTL{value} assigning - make it relevant to documentation
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-04-15 08:57:39 +02:00
Takashi Iwai
ba38c92e69 alsactl - Add missing -I option
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-20 18:01:58 +01:00
Takashi Iwai
08837a80e0 Fix misc compile warnings in alsactl
alsactl.c:166: warning: assignment from incompatible pointer type
  init_utils_string.c:21: warning: ‘string_is_true’ defined but not used

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-18 15:34:57 +01:00
Jaroslav Kysela
c1bc8d61dd alsactl: init - modify default rule to better support some HDA codecs
Some HDA codecs have shifted dB range (-34.5dB - 12dB) for PCM and CD
inputs. Use default 0dB value for them.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-02-05 12:58:42 +01:00
Will Wagner
9662a167d8 Use ANSI C functions
Replace non-ANSI C functions index() and rindex() with strchr() and
strrchr(), respectively.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-19 14:19:10 +01:00
Hans-Christian Egtvedt
e3dfc7470e alsa-utils check if __USE_BSD is defined before compiling "BSD functions"
Another bug/issue I tripped over when compiling alsa-utils in an
environment using uClibc to supply the C library functions. Here I have
enabled some old BSD style functions. The attached patch will honor
them if they are enabled.

Without this patch I get a redefined error during compile.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-08 11:55:27 +01:00
Jaroslav Kysela
05f78cc681 alsactl: Fix restore / init call behaviour when driver contains more controls
Fix check when driver contains more controls than state file. In this case,
initialization procedure should be run, too.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-11-21 14:44:31 +01:00
Diego E. 'Flameeyes' Pettenò
6232f1c96c Make some static tables and strings constants.
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>
2008-11-21 13:10:02 +01:00
Diego E. 'Flameeyes' Pettenò
ca1ea1e904 Mark static the functions not used outside their unit.
This way the compiler can assume more information about their
interface for optimisation.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 13:09:56 +01:00
Diego E. 'Flameeyes' Pettenò
50f01e48af Remove some dead code (comparisons between 0 and unsigned integers).
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 13:09:45 +01:00
Takashi Iwai
1797b2c290 Add -I option to alsactl
Add -I option to alsactl to take back the old restore behavior without
initialization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-13 09:28:43 +01:00
Takashi Iwai
bbd71560bc Add --disable-xmlto configure option
Added the check of xmlto program in configure script.
Also added --disable-xmlto configure option for systems with a broken
or older xmlto that doesn't work properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-30 11:50:17 +01:00
Jaroslav Kysela
f63ff476f3 alsactl: Add -g,--ignore option to ignore 'No soundcards found' error
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-18 09:40:02 +02:00
Jaroslav Kysela
0a8e8d581e alsactl: Fix oops (when parsing card argument)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-11 13:39:42 +02:00
Takashi Iwai
02c978dbec Add missing files to be included in alsactl/Makefile.am
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-08-25 08:07:13 +02:00
Jaroslav Kysela
eb345d92ed alsactl.1 - explicitly notify about ALSA_CONFIG_PATH environment variable
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-19 13:38:26 +02:00
Jaroslav Kysela
cdf5a9b824 alsactl init - fix memory leaks (valgrind helped)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-19 13:28:22 +02:00
Jaroslav Kysela
2e7bb3caf5 alsactl init - fixed EXTRA_DIST typo in alsactl/init subdirectory
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-18 17:02:17 +02:00
Jaroslav Kysela
30744c02e7 alsactl: Allow card specification by device name (support for udev)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-18 16:57:18 +02:00
Jaroslav Kysela
ef8bfcecda alsactl - remove 'names' command, fix alsactl man page
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-18 16:47:33 +02:00
Jaroslav Kysela
a227a9ad52 alsactl init - add default command to help config and fix packaging
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-18 16:27:45 +02:00
Jaroslav Kysela
9a748178d1 alsactl init - CTL{values}, CTL{enums} and default "guess method" initialization
Implemented CTL{values)=value to set all values at once.
Implemented CTL{enums} to match against strings in enum list.
Added 'default' (guess method) initialization configuration.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-18 15:01:44 +02:00
Jaroslav Kysela
0c02a4e3d2 alsactl init - add ATTR{dBmin} and ATTR{dBmax}
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-18 12:39:26 +02:00
Jaroslav Kysela
460ff35c39 alsactl init - fixed enumeration string setting, update Lenovo T61 config (dB)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-14 17:51:46 +02:00
Jaroslav Kysela
e5b4241976 alsactl init - modified configuration for Acer Travelmate 8100 2008-08-14 17:48:48 +02:00
Jaroslav Kysela
b8560a6bbb alsactl init - restore calls also init on failure
The initialization procedure consist from default initialization and
state restoration. When restore fails for a reason or the config file
contains inaccurate information, then init is called.

Also, if something fails (init or restore), a file specified using -r
option can be created with description what failed. It can be useful
when user space decides to notify user to set the sound driver properly.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-14 16:46:27 +02:00
Jaroslav Kysela
e02535b1a8 alsactl init - add dB and percentual CTL{value} parsing for integer values
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-14 14:08:22 +02:00
Jaroslav Kysela
11684b3c8b alsactl init - allow enum specification by name strings
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-14 11:21:59 +02:00
Jaroslav Kysela
24fe765fa6 alsactl init configuration syntax changes
- change SYSFS_DEVICE to CONFIG{sysfs_device}
- INCLUDE key now handles also directories
- RESULT key can assign value now
- EXIT="return" operation returns from included file immediately

Default 00main and hda configuration files changes:

- handle preinit and postinit directories

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13 20:49:07 +02:00
Jaroslav Kysela
9957c66e46 alsactl - install initialization files
Also, spearate SOUNDSDIR and DATADIR in configure.in.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13 12:31:00 +02:00
Jaroslav Kysela
21bb9fb975 alsactl init - Fix Lenovo T61 configuraton 2008-08-13 11:40:43 +02:00
Jaroslav Kysela
e1afe00362 alsactl init: Changed support for Acer Travelmate 8100 (use subvendor and subdevice for matching)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-07-31 16:41:54 +02:00
Jaroslav Kysela
7b3c488e4e alsactl init: added support for Lenovo T61
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-07-31 16:40:06 +02:00
Jaroslav Kysela
b402cf543a Initial 'alsactl init' implementation
See 'man 7 alsactl_init' for more details.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-07-31 15:45:08 +02:00
Clemens Ladisch
8fc2c39dc8 alsactl: simplify and fix item type detection
Use snd_ctl_elem_type_name() to detect the value of the type comment
instead of using hardcoded strings.

The types list now also includes the BYTES type (Debian bug 481515).

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2008-06-06 09:02:55 +02:00
Takashi Iwai
b0828653c9 alsactl: skip inactive controls
When using alsactl to save or restore the card settings, it currently
skips over controls that don't have the appropriate read/write
permissions. It should also skip over inactive controls, otherwise it
will get an error when it tries to access that control, and will fail to
save the card state (or fully restore it.)

From: Dave Dillow <dave@thedillows.org>
2007-12-17 11:49:00 +01:00
Takashi Iwai
8d7759aa32 alsactl - Fix wrong restore
Fix a bug in alsactl that restores wrong values for elements with
multiple channels (counts).
2007-11-30 17:20:39 +01:00
Takashi Iwai
e5b2ab2a9f alsactl - Set -F option as default
Set -F option as default for restore.  There are still too many systems
that are too lazy to set -F option...

Added the new -P option to back to the old behavior.
2007-11-14 11:54:38 +01:00
Takashi Iwai
6f05fd4db2 alsactl - fix double entry of comment.tlv
The entry comment.tlv can be doubly written via alsactl store, and this
results in an error.  I forgot to remove the old code...
2007-11-12 17:24:27 +01:00
Takashi Iwai
c88c15a478 alsactl - restore dB level
When alsactl saved state has dB level information and an attribute
of a control element is changed after save (e.g. volume range is
changed), try to restore the values to keep the same dB level.

This change requires the new alsa-lib functions for TLV dB
conversion, so we check it in configure (until AM_PATH_ALSA(1.0.16)
works).
2007-10-24 13:53:14 +02:00
Takashi Iwai
030686a847 Make alsactl restore a bit more robust
Make "alsactl restore" a bit more robust.  Now it tries to parse the
compound items in the case that the number of channels was changed.
The former mono-value is expanded to all channels.
2007-10-24 13:08:28 +02:00
Jaroslav Kysela
48de580a7b Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:25:17 +02:00
Takashi Iwai
f13bea104b alsactl - Remove debug print
Remove an old debug print that simply annoys.
2007-08-15 15:38:01 +02:00
Takashi Iwai
6d32e055d7 alsactl - Display help for names command
shortly explain the "names" command in the help text

From: Tomas Pospisek <tpo2@sourcepole.ch>
2007-05-23 12:06:49 +02:00
Takashi Iwai
f5d76dde4e alsactl - More explicit open error message (#2)
same as last patch, this time for the store command

Tomas Pospisek <tpo2@sourcepole.ch>
2007-05-23 12:04:49 +02:00
Takashi Iwai
035cbc3f9b alsactl - More explicit open error message
Include more explicit error message when open config file in write
mode (this is for the "names" command)

From: Tomas Pospisek <tpo2@sourcepole.ch>
2007-05-23 12:03:29 +02:00
Takashi Iwai
cdccd6585f alsactl - adjust spaces in help texts
adds a space in the help text between "restore" and "<card>" and indents
the rest of the text accordingly to fit.

From: Tomas Pospisek <tpo2@sourcepole.ch>
2007-05-23 12:02:14 +02:00
Takashi Iwai
e3ccd2031b alsactl - Error message when failing to open the config file
Tells the user that it was not able to open the config file with the
precise error message.

From: Tomas Pospisek <tpo2@sourcepole.ch>
2007-05-23 11:58:27 +02:00
Jaroslav Kysela
8fa7c15229 alsactl - return error state, fail when no configuration is found
See bug#843
2006-10-04 10:14:24 +02:00
Takashi Iwai
0413ca230f Restore user-defined TLV
Restore user-defined TLV (mainly for PCM softvol plugin).
TLV is stored in comment.tlv as a hex string.
2006-08-25 11:48:10 +02:00