Commit graph

33 commits

Author SHA1 Message Date
Jaroslav Kysela
eefc2c61cf alsactl: use card iterator functions for all card loops
Take the card iterator idea from the monitor code and
use it for all card loops. It reduces the code duplications
and makes things easy to review.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-11 09:23:33 +01:00
Jaroslav Kysela
9a2115b5cc alsactl: Add ucm support for the FixedBootSequence
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-11 09:23:31 +01:00
Jaroslav Kysela
c1474594dc alsactl: add dump-cfg and dump-state commands
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-07 19:58:33 +01:00
Jaroslav Kysela
17b4129e6c alsactl: add 'clean' command to remove the application controls
It is handy to remove all card controls created by applications.

This change allows to remove those controls for all cards, selected
card or selected card with a control id filter list like:

   alsactl clean 0 "name='PCM'" "name='Mic Phantom'"

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-04 21:15:56 +01:00
Andrew Hlynskyi
d7bf45edc3 alsactl: init - add -U option to disable UCM based init
The reason is to use it with internal init extra commands like:
  alsactl -U -E CMD=info init

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-06 13:03:03 +02:00
Jaroslav Kysela
b68e854d28 alsactl: add -D argument to execute also the UCM defaults section
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-14 19:34:18 +02:00
Jaroslav Kysela
8fb4016a17 alsactl: redirect alsa-lib errors
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-14 19:09:53 +02:00
Jaroslav Kysela
4bea8fe3a7 alsactl: add initial support for UCM init
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-14 18:19:20 +02:00
Michael Forney
f80a290153 Use __func__ instead of __FUNCTION__
They are equivalent, but __func__ is in C99. __FUNCTION__ exists only
for backwards compatibility with old gcc versions.

Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-10 12:38:28 +01:00
Jaroslav Kysela
74e5d57c99 alsactl: aded missing monitor() prototype 2014-09-24 10:46:02 +02:00
Jaroslav Kysela
1363f852e9 alsactl: Fix the file locking routines (for the state management) 2014-09-24 10:35:53 +02:00
Jaroslav Kysela
158a67f6f5 alsactl: add -L (no-lock) and change -D (lock-dir) to -O (state-lock-file)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2014-05-07 11:20:16 +02:00
Julian Scheel
2607d8deee alsactl: Store lockfile in /var/lock, add -D option to specify the lock dir
It can not be generally assumed that the directories in which asound.state
resides are writable. Use /var/lock and allow users to alter this path.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2014-05-07 10:55:51 +02:00
Jaroslav Kysela
067f4f3256 alsactl: Improved command line argument handling...
Improve command line argument handling for future extensions.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-05 13:47:21 +02:00
Jaroslav Kysela
cc5c3357cf alsactl: add the daemon mode
For the plug-and-play hardware, like USB devices, it may be helpful
to manage the sound state periodically, before the devices are removed.

This change implements new commands 'daemon' and 'rdaemon' to save
the sound state in defined intervals when the sound controls are changed.

The udev rules can notify the daemon using the 'kill' or 'nrestore'
commands to rescan available cards in the system.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-05 13:47:18 +02:00
Clemens Ladisch
b4ff58b685 Revert wrong parts of "alsactl: use snd_config_imake* functions"
This reverts the parts of commit e509df69a5
that accidentally reverted a bunch of earlier commits.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-05-26 10:37:58 +02:00
Clemens Ladisch
e509df69a5 alsactl: use snd_config_imake* functions
To save a call to snd_config_set_xxx, replace the calls to
snd_config_make_xxx with snd_config_imake_xxx.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-05-26 10:07:47 +02:00
Jaroslav Kysela
5c35aa8b69 alsactl: improve -d to get warnings and store exitcode to runstate file
Also, make the initialization & restore logic for one card similar to
multiple card initialization & restore.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-02-25 09:22:26 +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
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
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
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
Jaroslav Kysela
31efc323b1 split source per command and added command 'names'
- sources are splitted to separate files
- added initial code for 'names' command
2005-05-10 10:55:24 +00:00
Abramo Bagnara
8c4e1aa769 Rewritten alsactl 2000-08-25 14:34:26 +00:00
Jaroslav Kysela
9d5b8f205d Changes reflecting the new control API and kernel mixer API removal. 2000-07-15 10:21:59 +00:00
Jaroslav Kysela
2e02eadd72 Mixer v2.0 merged to the main CVS tree... 1999-05-02 16:21:40 +00:00
Jaroslav Kysela
daab0cd6d0 New universal switch v2.0 interface. 1999-03-27 19:45:01 +00:00
Jaroslav Kysela
4db1fd02ce Merged new-mixer branch... 1999-03-08 16:51:53 +00:00
Jaroslav Kysela
88cdd83d0f Changes for record volume... 1999-02-15 15:42:34 +00:00
Jaroslav Kysela
fbbaa7239e Coding style... 1998-11-27 15:13:57 +00:00
Jaroslav Kysela
18fa888b68 Now is alsactl restore <card> hhandled ok when configuration file doesn't exist... 1998-11-20 20:02:51 +00:00
Jaroslav Kysela
ec275f84ed Changed version... 1998-10-31 19:50:16 +00:00
Jaroslav Kysela
72ff837506 Initial version of alsactl... 1998-10-29 22:45:59 +00:00