LMDE ALSA bug

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read this

LMDE ALSA bug

Postby HTD on Sat Jul 02, 2011 3:05 pm

Excuse me editing this post the third time.

I've made some changes with alsamixer (changed microphone input from front mic to rear mic). It worked.
My change is lost after reboot. Why?

There is a file: /etc/init.d/alsa-utils which should be executed on each startup, shutdown and reboot, am I right?

I've checked this file - it should save ALSA settings and restore them on each reboot.
And this is exactly what it does - when executed manually.

I check my microphone input after reboot - "front mic" - wrong.
Now the unexplainable part: I type "sudo /etc/init.d/alsa-utils start" in terminal. Input switches to "rear mic".

Why do I have to execute this file manually? What's wrong with this?
HTD
Level 1
Level 1
 
Posts: 46
Joined: Sun May 22, 2011 7:31 pm

Linux Mint is funded by ads and donations.
 

Re: LMDE ALSA bug

Postby richyrich on Sat Jul 02, 2011 5:53 pm

Not able to determine what version or flavour of Mint you are running . . but most are using PulseAudio . . not ALSA
User avatar
richyrich
Level 13
Level 13
 
Posts: 4638
Joined: Mon May 04, 2009 8:31 pm

Re: LMDE ALSA bug

Postby HTD on Sat Jul 02, 2011 6:10 pm

It's LMDE, x64.
I thought PulseAudio uses ALSA somehow. However - alsamixer works, GNOME alsamixer works too. Alsamixer is the only way to switch input to rear microphone. The problem is - its settings are not restored on reboot. I see ALSA starts on reboot (there is a message "Starting ALSA" or something like this), but the microphone setting is not restored. It IS restored when I run
Code: Select all
sudo /etc/init.d/alsa-utils start
. I don't know - is this script ignored on reboot, or it's run, but too early or with wrong param? (It accepts card name).
HTD
Level 1
Level 1
 
Posts: 46
Joined: Sun May 22, 2011 7:31 pm

Re: LMDE ALSA bug

Postby richyrich on Sat Jul 02, 2011 6:15 pm

Any Pulse Audio controls in your Gnome Control Center ?

Anything autostarting or running that starts with "pau" ?
User avatar
richyrich
Level 13
Level 13
 
Posts: 4638
Joined: Mon May 04, 2009 8:31 pm

Re: LMDE ALSA bug

Postby HTD on Sun Jul 03, 2011 7:25 am

Yes, there are Pulse Audio Preferences and Sound icons. The only Pulse Audio process running is "pulseaudio". No process with name starting with "pau".
Skype uses Pulse Audio (nothing else is selectable in its audio preferences).
In Audacious I can select Pulse Audio and ALSA plugins, they both produce exactly the same sound.

Code: Select all
pulseaudio -k
pulseaudio -D


makes change to sound volume (it's louder) and changes sound preferences look (I get mixer instead of ordinary panel) - I mean this shown after right clicking on speaker icon.
I have no other problems with sound. 2 soundcards (internal and PCI) work properly. The only problem is the setting I made with alsamixer is not restored on reboot, but can be restored by running
Code: Select all
sudo /etc/init.d/alsa-utils start
from terminal.

I've tried following:
Code: Select all
sudo ln -sf ../init.d/alsa-utils /etc/rc5.d/S20alsa-utils
sudo update-rc.d alsa-utils defaults

which should run this script every start just before pulseaudio, but no joy.

I don't understand update-rc.d well. I guess messing with it was not a good idea, so I reverted it to previous state. The problem remains - if I want to have working microphone in skype - I have to run alsa-utils manually once each reboot.

PS:
Previously I got alsactl permission errors on alsa-utils start (alsactl restore), now I get alsactl permission error on alsa-utils stop (alsactl store).

Code: Select all
$ /etc/init.d/alsa-utils restart
Shutting down ALSA...warning: 'alsactl store' failed with error message 'alsactl: save_state:1532: Cannot open /var/lib/alsa/asound.state for writing: Permission denied'...failed.
Setting up ALSA...done.


It's important the settings are stored and restored properly regardless of those errors. What's interesting:

Code: Select all
$ sudo cat /var/log/boot | grep ALSA
Sat Jul  2 23:47:05 2011: Setting up ALSA...done.


No errors here. Ever.

Could I have broken it with running alsactl store / restore manualy as root? I did it the first time I used alsamixer and got an error message (about permissions denied), but it worked (I tried changing the setting and restoring state - errors present, but state restored).

PS2:
WAIT. I said restarting pulseaudio daemon changes sound volume AND alsa-utils looks like started each reboot BEFORE pulseaudio. Maybe this is the answer? Maybe pulseaudio overwrites properly restored alsa mixer settings? How could I check it? alsautils script is present only in /etc/rc0.s, /etc/rc1.s and /etc/rc6.s. pulseaudio is in 2, 3, 4 and 5. It seems wrong somehow.

PS3:
Reboot (no error messages during shutdown and start).
Microphone dead.
Code: Select all
$ sudo /etc/init.d/alsa-utils start
Setting up ALSA...warning: 'alsactl restore' failed with error message 'alsactl: set_control:1388: Cannot write control '2:0:0:IEC958 Playback Default:0' : Operation not permitted
alsactl: set_control:1388: Cannot write control '2:0:0:IEC958 Playback Switch:0' : Operation not permitted'...amixer: Invalid command!
done.

Microphone ok.
HTD
Level 1
Level 1
 
Posts: 46
Joined: Sun May 22, 2011 7:31 pm

Re: LMDE ALSA bug

Postby ukbrian on Sun Jul 03, 2011 9:15 am

I think "pavucontrol" is the command but that's the one you can access from skype>options
The one that might sort it for you is "gnome-volume-control" in the terminal and set the input tab to your mic.
User avatar
ukbrian
Level 4
Level 4
 
Posts: 276
Joined: Thu Jul 29, 2010 6:03 am
Location: Cheltenham, UK

Re: LMDE ALSA bug

Postby HTD on Sun Jul 03, 2011 9:30 am

Both commands work and give the two panels I wrote about.
None of them provides microphone selection. (In Ubuntu - gnome-volume-control allows to select the microphone, in LMDE - it doesn't - I have only "Microphone" instead of "Front Mic" and "Rear Mic").
The only way I can change my default microphone input is alsamixer (not GUI, only console one has this option).
HTD
Level 1
Level 1
 
Posts: 46
Joined: Sun May 22, 2011 7:31 pm

Re: LMDE ALSA bug

Postby rarsa on Sat Sep 17, 2011 9:08 pm

Did you find a way to restore the alsa settings on boot?

I don't mind remembering to do it myself but I think it is too much to ask from other people that also use this computer.
rarsa
Level 1
Level 1
 
Posts: 8
Joined: Sun Jun 13, 2010 5:51 pm

[solved] LMDE ALSA bug

Postby on4aa on Tue May 29, 2012 9:35 am

User avatar
on4aa
Level 2
Level 2
 
Posts: 57
Joined: Wed Nov 18, 2009 5:30 am
Location: Hasselt, Belgium

Linux Mint is funded by ads and donations.
 

Return to Sound, Multimedia & Codecs

Who is online

Users browsing this forum: No registered users and 2 guests