DEV Community

Bianca Luísa
Bianca Luísa

Posted on

How to fix alsactl store that does not save alsamixer settings

These days I had problems with alsamixer settings on my Ubuntu version 18.04.5, it wasnt being restored when restarting the system. I solved the problem by doing this:

Open the alsamixer

1- sudo alsamixer

Make the changes you want. Save changes with

2- sudo alsactl --file ~/.config/asound.state store

Open bashrc

3- sudo nano ~/.bashrc

Add this line at the end

4- alsactl --file ~/.config/asound.state restore

save and reboot.

Top comments (9)

Collapse
 
abhishekgeek profile image
Abhishek Dubey

Every time i am starting my PC, Alsamixer changes don't work until I start the terminal once. It is working fine after i just open the terminal and close it.
Is there any way i don't have to open the terminal to see the changes.
Please tell me if you have any idea.

Collapse
 
maga_23 profile image
Maga

To solve it I did the next thing.
Only execute in a terminal the first and second command of the guide above.
Then you have to make a .sh file, launch a text editor and then save the file with the .sh at the end.
In the file you have to type this:

#! /bin/bash
alsactl --file ~/.config/asound.state restore

Enter fullscreen mode Exit fullscreen mode

Then save the file, in my case is get_sound.sh .After that, you have to launch "startup application" and click on add. In the name part you can type whatever you want but in command you have to put this:

gnome-terminal --command "path_to_the_script/get_sound.sh"
Enter fullscreen mode Exit fullscreen mode

You can find out the path to the file by clicking on Properties.
Then click on save and you are ready, every time you log in your computer this command will be executed.
Sorry for my English, it is not my native language.

Collapse
 
almutawakkiel profile image
mktbt elshafie

Here are the steps I would recommend to save ALSA mixer settings automatically on startup

  1. Open a terminal and run alsamixer to verify it works. Make any changes and exit.

  2. Run alsactl store to manually save the changes.

  3. Create a shell script called alsa-save.sh containing:

#!/bin/bash

alsactl store
Enter fullscreen mode Exit fullscreen mode
  1. Make the script executable:

chmod +x alsa-save.sh

  1. Move the script to a standard location:

sudo mv alsa-save.sh /usr/local/bin/

  1. Open System Settings > Applications > Startup

  2. Click the "+" button and select "Custom"

  3. For Command, enter:

/usr/local/bin/alsa-save.sh

  1. Give it a name like "Save ALSA Mixer"

  2. Ensure it's toggled On

  3. Log out and back in to test

This creates a simple executable script that runs alsactl store on startup. Let me know if any of these steps don't work or if the settings are still not saving automatically.

Collapse
 
iloveturtels9 profile image
iloveturtles9

Did you ever figure out a fix? I'm having the exact same issue

Collapse
 
almutawakkiel profile image
mktbt elshafie • Edited

Here are the steps I would recommend to save ALSA mixer settings automatically on startup in

  1. Open a terminal and run alsamixer to verify it works. Make any changes and exit.

  2. Run alsactl store to manually save the changes.

  3. Create a shell script called alsa-save.sh containing:

#!/bin/bash

alsactl store
Enter fullscreen mode Exit fullscreen mode
  1. Make the script executable:

chmod +x alsa-save.sh

  1. Move the script to a standard location:

sudo mv alsa-save.sh /usr/local/bin/

  1. Open System Settings > Applications > Startup

  2. Click the "+" button and select "Custom"

  3. For Command, enter:

/usr/local/bin/alsa-save.sh

  1. Give it a name like "Save ALSA Mixer"

  2. Ensure it's toggled On

  3. Log out and back in to test

This creates a simple executable script that runs alsactl store on startup. Let me know if any of these steps don't work or if the settings are still not saving automatically.

Collapse
 
dave_gutz_a9d5d0093506492 profile image
Dave Gutz

This worked for my 3 Ubuntu-based distros. And I tried so many other things for so long to fix the inability to unmute S/PDIF HDMI outputs. I hope others see this post and it saves you some trouble too.

Collapse
 
neutron7 profile image
G

I have the exact same problem as Abhishek Dubey. Any suggestions on how to fix this?

Collapse
 
iloveturtels9 profile image
iloveturtles9

Did you ever figure out a fix? I'm having the exact same issue

Collapse
 
lzo_e3e9941ac912b98d14c profile image
L.Z.O

Thanks a lot !
It works perfectly