You are not logged in.

#1 2013-02-01 14:24:35

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,485

[SOLVED]how to tell alsa to forget deleted controls from ~/.asoundrc?

I'm tweaking my .asoundrc to add a softvol plugin to my audiophile2496, but the real issue is that as i try over and over new control names, alsamixer doesn't forget about olders/removed ones.
you can try by yourself, you just need extra/alsa-utils

add this to your ~.asoundrc

pcm.newdevice {
    type            softvol
    slave.pcm       "default"
    control.name    "softmaster1"
    control.card    0
}

Then play something on the new device; this way the new control will be available.

aplay /tmp/out.wav -D newdevice

now you'll find it onto the audio controls, check:

# amixer controls |grep -i softmaster
numid=50,iface=MIXER,name='softmaster1'

But now,
if you edit .asoundrc by changing the control name from softmaster1 to (say) softmaster2,
issue aplay /tmp/out.wav -D newdevice
and check amixer controls |grep -i softmaster again, you'll get:

# amixer controls |grep -i softmaster
numid=50,iface=MIXER,name='softmaster1'
numid=51,iface=MIXER,name='softmaster2'

So the question is... what can i do to make alsa forget abount non existant controls !?

-EDIT-
It is even worst, i tried to delete .asoundrc and tried:

# aplay /tmp/out.wav -D newdevice
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM newdevice
aplay: main:696: audio open error: File o directory non esistente

...but still:

# amixer controls |grep -i softmaster
numid=49,iface=MIXER,name='Softmaster'
numid=50,iface=MIXER,name='Softmaster1'
numid=51,iface=MIXER,name='Softmaster2'
numid=52,iface=MIXER,name='Softmaster3'
numid=53,iface=MIXER,name='Softmaster4'

WTH!?!?

Last edited by kokoko3k (2013-04-12 13:44:15)

Offline

#2 2013-02-01 14:59:13

ximun
Member
From: Montreal, QC
Registered: 2012-08-14
Posts: 26

Re: [SOLVED]how to tell alsa to forget deleted controls from ~/.asoundrc?

Changing things

Most programs require a restart to reread .asoundrc or asound.conf! This includes desktop environment audio daemons, such as PulseAudio. For most changes to .asoundrc you will need to restart the sound server (ie. sudo /etc/init.d/alsa-utils restart) for the changes to take effect.

http://alsa.opensrc.org/.asoundrc#Changing_things


"The problem is, after a week of intense googling, we’ve started to burn out on knowing the answer to everything. God must feel that way all the time. I think people in the year 2020 are going to be nostalgic for the sensation of feeling clueless." Douglas Coupland - jPod

Offline

#3 2013-02-01 15:06:16

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,485

Re: [SOLVED]how to tell alsa to forget deleted controls from ~/.asoundrc?

I saw that, but i'm not using pulseaudio, nor any sound server,
and in arch we haven't any /etc/init.d/alsa-utils.
systemctl|grep alsa reports nothing
and the old alsa service located in /etc/rc.d/alsa just set powersave parameters and restores alsa states (alsactl restore #, which i've manually tried without solving the problem).

The issue here is not that applications are not aware that things are changed (in fact the application amixer show the controls as i add them), the problem is that they are not notified that some controls are just... gone!

Offline

#4 2013-04-10 22:43:36

ooo
Member
Registered: 2013-04-10
Posts: 1,019

Re: [SOLVED]how to tell alsa to forget deleted controls from ~/.asoundrc?

old post, but I just had this issue as well, and here's how to fix it:

from https://github.com/opensrc/alsa/blob/master/Softvol.md

Removing a volume control
This task is not as easy at it seems, if you don't know the trick. If the correspondant part of the configuration file is just deleted and alsactl store has been executed after the usage of the device in question, the volume control won't disappear. alsactl store stores the value of all controls (among them the softvol device) in /etc/asound.state and is most likely executed on every shutdown of your computer.

To make the volume control disappear finally, you have to delete its values in /etc/asound.state or just the whole file (it will be recreated with default values on next reboot). After that, your computer has to be restarted once without the execution of alsactl store on shutdown. On Debian, this can be achieved by temporarily renaming /etc/rc6.d/K50alsa-utils (or similar). Pressing the reset button also works, but should be avoided.

what I did was:

rm /var/lib/alsa/asound.state # remove the state file
chmod -x /usr/sbin/alsactl # make alsactl non-executable to prevent settings being written on shutdown
<REBOOT>
chmod +x /usr/sbin/alsactl

alsamixer is back to defaults :)

Offline

#5 2013-04-11 09:15:31

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,485

Re: [SOLVED]how to tell alsa to forget deleted controls from ~/.asoundrc?

Oh thanks, i'll try asap!

Offline

#6 2013-04-12 13:43:48

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,485

Re: [SOLVED]how to tell alsa to forget deleted controls from ~/.asoundrc?

It was tricky, but it worked, thank you again smile

Offline

Board footer

Powered by FluxBB