Howto save AlsaMixer settings?












69















Hello I have tryed out the programm "EarCandy", now I had/have a lot of problems.
At first I did not get any sound and now it is very low volume. PS Earcandy is now deleted from my harddisk.



When Im opening the Alsamixer with:



alsamixer


I see that the volume for the speakers is zero. Now I push it to the max volume. But after every restart, I have to open alsamixer again and have to set the volume to max again. Can I save the settings for alsamixer or is there any other way to fix the problem ?
enter image description here










share|improve this question



























    69















    Hello I have tryed out the programm "EarCandy", now I had/have a lot of problems.
    At first I did not get any sound and now it is very low volume. PS Earcandy is now deleted from my harddisk.



    When Im opening the Alsamixer with:



    alsamixer


    I see that the volume for the speakers is zero. Now I push it to the max volume. But after every restart, I have to open alsamixer again and have to set the volume to max again. Can I save the settings for alsamixer or is there any other way to fix the problem ?
    enter image description here










    share|improve this question

























      69












      69








      69


      27






      Hello I have tryed out the programm "EarCandy", now I had/have a lot of problems.
      At first I did not get any sound and now it is very low volume. PS Earcandy is now deleted from my harddisk.



      When Im opening the Alsamixer with:



      alsamixer


      I see that the volume for the speakers is zero. Now I push it to the max volume. But after every restart, I have to open alsamixer again and have to set the volume to max again. Can I save the settings for alsamixer or is there any other way to fix the problem ?
      enter image description here










      share|improve this question














      Hello I have tryed out the programm "EarCandy", now I had/have a lot of problems.
      At first I did not get any sound and now it is very low volume. PS Earcandy is now deleted from my harddisk.



      When Im opening the Alsamixer with:



      alsamixer


      I see that the volume for the speakers is zero. Now I push it to the max volume. But after every restart, I have to open alsamixer again and have to set the volume to max again. Can I save the settings for alsamixer or is there any other way to fix the problem ?
      enter image description here







      alsa






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 22 '11 at 16:50









      jsterrjsterr

      1,12751927




      1,12751927






















          7 Answers
          7






          active

          oldest

          votes


















          64














          Execute:



          sudo alsactl store


          This should save alsamixer configurations to /etc/asound.state which gets loaded every startup.






          share|improve this answer





















          • 12





            My laptop continues to reset my configuration, even after running the above command. It claims to be storing it to /var/lib/alsa/asound.state. Is there any other reason for it not working?

            – Azmisov
            Aug 31 '13 at 3:35






          • 1





            I have exactly the same problem, and exactly the same behaviour when I try sudo alsactl store.

            – JeanSibelius
            Oct 18 '14 at 19:15






          • 1





            @Azmisov: You can further experiment with the system like following: (1) store the configuration (2) start alsamixer and change master level (2) restore the configuration (3) check that master level was restored. If above is as expected, check that restore is actually triggered at system boot (chkconfig alsa-utils should display alsa-utils on).

            – dma_k
            Mar 12 '15 at 10:54











          • This answer solved my SPDIF problem: askubuntu.com/questions/541847/…

            – neves
            Dec 5 '15 at 17:04











          • When I run sudo alsactl store it gives me the following error alsactl: get_controls:567: snd_ctl_open error: Invalid argument.

            – user2513149
            Nov 8 '16 at 20:36



















          18














          You could also save the mixer settings into a custom file with alsactl:



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


          Reloading:



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





          share|improve this answer



















          • 2





            The top answer didn't work for me but this did! I created a config file and placed it at /etc/asound.state and added the reload line to my /etc/rc.local.

            – John
            Aug 31 '15 at 13:21











          • This was the right solution for me... but I had to specify the absolute path to .config file inside the rc.local (although it should work even with relative because it's the same user.. but it didn't). thank you and I hope my hint also helps someone

            – davidhq
            Nov 29 '18 at 9:45





















          9














          Seppo Erviälä's answer is right but not complete. As dma_k already noted, man alsactl clearly states at the end that,




          /var/lib/alsa/asound.state (or whatever file you specify with the -f
          flag) is used to store current settings for
          your soundcards.




          palacsinit appropriately noted that you can store config into your file with



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


          and reload with



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


          This can be further improved with placing the second line, the restore command into a .desktop file.



          You will need to run nano ~/.config/autostart/alsarestore.desktop, which will open nano text editor and create ~/.config/autostart/alsarestore.desktop file. Entries in ~/.config/autostart/ directory are used to autostart programs and services for specific user on startup/graphical login.



          The contents of the .desktop file should be the following:



          [Desktop Entry]
          Type=Application
          Terminal=false
          Name=alsarestore
          Exec=alsactl --file ~/.config/asound.state restore


          Among other things, you could store your config in /etc/asound.state and symlink it to /var/lib/alsa/asound.state, but this one is more of a suggestion rather than tested solution






          share|improve this answer


























          • This was the only way I worked for me on Ubuntu Xenial 16.04

            – Francisco Tomé Costa
            Mar 18 '16 at 19:23








          • 1





            The "store" and "restore" command work fine for manual control. However, when I set up the autostart file with the "restore" command, I see the mic setting in alsamixer is being rewritten to mute and the result is static. If i manually do the restore command, all is fine. Why is the mic setting changing and not being corrected by an appropriately stored configuration file by autostart???

            – Brad Horn
            Oct 8 '16 at 11:40













          • @BradHorn it's possible you have something else overwriting your command. It runs, but then something else undoes its changes

            – Sergiy Kolodyazhnyy
            Oct 8 '16 at 11:43











          • any ideas what that could be?

            – Brad Horn
            Oct 8 '16 at 11:44






          • 1





            @BradHorn not of the top of my head, no. Try changing the Exec line in the .desktop file to be Exec=bash -c "sleep 5 && alsactl --file ~/.config/asound.state restore" . That will introduce a 5 second delay, so whatever is overwriting your settings will run first, and then your restore command will run after that. Try playing with the sleep values if that still overrides your settings.

            – Sergiy Kolodyazhnyy
            Oct 8 '16 at 11:49



















          1














          After 2 months of trying to make "sudo alsactl store" to work, I finally managed to do it.
          Firstly type in terminal "alsamixer" to enter the alsamixer UI. Then make the configurations you need(e.g increase speakers/headphones level or unmute something pressing "m" on keyboard).
          Now the most important part. Before you exit alsamixer, open a new terminal and do : "sudo su" to get high privileges (Be very careful with commands you use in "sudo su" mode because you may destroy your system) and then do "alsactl store" to save alsa settings. Then close both terminals and restart your computer. This will do the job.






          share|improve this answer
























          • This doesn’t work for me.

            – kleinfreund
            Aug 21 '18 at 7:28



















          0














          After running sudo alsamixer the mixer should should retain the changes you make.



          See Sound does not work once my profile loads on which answers you can find a clue also.



          Good luck!






          share|improve this answer

































            0














            Alsa-Json-Gateway https://github.com/fulup-bzh/AlsaJsonGateway supports store/restore of sound card sessions from JSON/REST API




            • list sessions /jsonapi?request=session-list&cardid=hw:0

            • store session /jsonapi?request=session-store&cardid=hw:0&args=MySoundConfig

            • restore /jsonapi?request=session-load&cardid=hw:0&args=MySoundConfig






            share|improve this answer































              0














              For those whom @Sergiy Kolodyazhnyy 's answer didn't work, try replacing alsactl by its complete path (whatever the which alsactl returned to you).






              share|improve this answer























                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "89"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f50067%2fhowto-save-alsamixer-settings%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                7 Answers
                7






                active

                oldest

                votes








                7 Answers
                7






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                64














                Execute:



                sudo alsactl store


                This should save alsamixer configurations to /etc/asound.state which gets loaded every startup.






                share|improve this answer





















                • 12





                  My laptop continues to reset my configuration, even after running the above command. It claims to be storing it to /var/lib/alsa/asound.state. Is there any other reason for it not working?

                  – Azmisov
                  Aug 31 '13 at 3:35






                • 1





                  I have exactly the same problem, and exactly the same behaviour when I try sudo alsactl store.

                  – JeanSibelius
                  Oct 18 '14 at 19:15






                • 1





                  @Azmisov: You can further experiment with the system like following: (1) store the configuration (2) start alsamixer and change master level (2) restore the configuration (3) check that master level was restored. If above is as expected, check that restore is actually triggered at system boot (chkconfig alsa-utils should display alsa-utils on).

                  – dma_k
                  Mar 12 '15 at 10:54











                • This answer solved my SPDIF problem: askubuntu.com/questions/541847/…

                  – neves
                  Dec 5 '15 at 17:04











                • When I run sudo alsactl store it gives me the following error alsactl: get_controls:567: snd_ctl_open error: Invalid argument.

                  – user2513149
                  Nov 8 '16 at 20:36
















                64














                Execute:



                sudo alsactl store


                This should save alsamixer configurations to /etc/asound.state which gets loaded every startup.






                share|improve this answer





















                • 12





                  My laptop continues to reset my configuration, even after running the above command. It claims to be storing it to /var/lib/alsa/asound.state. Is there any other reason for it not working?

                  – Azmisov
                  Aug 31 '13 at 3:35






                • 1





                  I have exactly the same problem, and exactly the same behaviour when I try sudo alsactl store.

                  – JeanSibelius
                  Oct 18 '14 at 19:15






                • 1





                  @Azmisov: You can further experiment with the system like following: (1) store the configuration (2) start alsamixer and change master level (2) restore the configuration (3) check that master level was restored. If above is as expected, check that restore is actually triggered at system boot (chkconfig alsa-utils should display alsa-utils on).

                  – dma_k
                  Mar 12 '15 at 10:54











                • This answer solved my SPDIF problem: askubuntu.com/questions/541847/…

                  – neves
                  Dec 5 '15 at 17:04











                • When I run sudo alsactl store it gives me the following error alsactl: get_controls:567: snd_ctl_open error: Invalid argument.

                  – user2513149
                  Nov 8 '16 at 20:36














                64












                64








                64







                Execute:



                sudo alsactl store


                This should save alsamixer configurations to /etc/asound.state which gets loaded every startup.






                share|improve this answer















                Execute:



                sudo alsactl store


                This should save alsamixer configurations to /etc/asound.state which gets loaded every startup.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jun 26 '11 at 21:12









                Isaiah

                43k20118138




                43k20118138










                answered Jun 22 '11 at 17:23









                Seppo ErviäläSeppo Erviälä

                2,71942337




                2,71942337








                • 12





                  My laptop continues to reset my configuration, even after running the above command. It claims to be storing it to /var/lib/alsa/asound.state. Is there any other reason for it not working?

                  – Azmisov
                  Aug 31 '13 at 3:35






                • 1





                  I have exactly the same problem, and exactly the same behaviour when I try sudo alsactl store.

                  – JeanSibelius
                  Oct 18 '14 at 19:15






                • 1





                  @Azmisov: You can further experiment with the system like following: (1) store the configuration (2) start alsamixer and change master level (2) restore the configuration (3) check that master level was restored. If above is as expected, check that restore is actually triggered at system boot (chkconfig alsa-utils should display alsa-utils on).

                  – dma_k
                  Mar 12 '15 at 10:54











                • This answer solved my SPDIF problem: askubuntu.com/questions/541847/…

                  – neves
                  Dec 5 '15 at 17:04











                • When I run sudo alsactl store it gives me the following error alsactl: get_controls:567: snd_ctl_open error: Invalid argument.

                  – user2513149
                  Nov 8 '16 at 20:36














                • 12





                  My laptop continues to reset my configuration, even after running the above command. It claims to be storing it to /var/lib/alsa/asound.state. Is there any other reason for it not working?

                  – Azmisov
                  Aug 31 '13 at 3:35






                • 1





                  I have exactly the same problem, and exactly the same behaviour when I try sudo alsactl store.

                  – JeanSibelius
                  Oct 18 '14 at 19:15






                • 1





                  @Azmisov: You can further experiment with the system like following: (1) store the configuration (2) start alsamixer and change master level (2) restore the configuration (3) check that master level was restored. If above is as expected, check that restore is actually triggered at system boot (chkconfig alsa-utils should display alsa-utils on).

                  – dma_k
                  Mar 12 '15 at 10:54











                • This answer solved my SPDIF problem: askubuntu.com/questions/541847/…

                  – neves
                  Dec 5 '15 at 17:04











                • When I run sudo alsactl store it gives me the following error alsactl: get_controls:567: snd_ctl_open error: Invalid argument.

                  – user2513149
                  Nov 8 '16 at 20:36








                12




                12





                My laptop continues to reset my configuration, even after running the above command. It claims to be storing it to /var/lib/alsa/asound.state. Is there any other reason for it not working?

                – Azmisov
                Aug 31 '13 at 3:35





                My laptop continues to reset my configuration, even after running the above command. It claims to be storing it to /var/lib/alsa/asound.state. Is there any other reason for it not working?

                – Azmisov
                Aug 31 '13 at 3:35




                1




                1





                I have exactly the same problem, and exactly the same behaviour when I try sudo alsactl store.

                – JeanSibelius
                Oct 18 '14 at 19:15





                I have exactly the same problem, and exactly the same behaviour when I try sudo alsactl store.

                – JeanSibelius
                Oct 18 '14 at 19:15




                1




                1





                @Azmisov: You can further experiment with the system like following: (1) store the configuration (2) start alsamixer and change master level (2) restore the configuration (3) check that master level was restored. If above is as expected, check that restore is actually triggered at system boot (chkconfig alsa-utils should display alsa-utils on).

                – dma_k
                Mar 12 '15 at 10:54





                @Azmisov: You can further experiment with the system like following: (1) store the configuration (2) start alsamixer and change master level (2) restore the configuration (3) check that master level was restored. If above is as expected, check that restore is actually triggered at system boot (chkconfig alsa-utils should display alsa-utils on).

                – dma_k
                Mar 12 '15 at 10:54













                This answer solved my SPDIF problem: askubuntu.com/questions/541847/…

                – neves
                Dec 5 '15 at 17:04





                This answer solved my SPDIF problem: askubuntu.com/questions/541847/…

                – neves
                Dec 5 '15 at 17:04













                When I run sudo alsactl store it gives me the following error alsactl: get_controls:567: snd_ctl_open error: Invalid argument.

                – user2513149
                Nov 8 '16 at 20:36





                When I run sudo alsactl store it gives me the following error alsactl: get_controls:567: snd_ctl_open error: Invalid argument.

                – user2513149
                Nov 8 '16 at 20:36













                18














                You could also save the mixer settings into a custom file with alsactl:



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


                Reloading:



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





                share|improve this answer



















                • 2





                  The top answer didn't work for me but this did! I created a config file and placed it at /etc/asound.state and added the reload line to my /etc/rc.local.

                  – John
                  Aug 31 '15 at 13:21











                • This was the right solution for me... but I had to specify the absolute path to .config file inside the rc.local (although it should work even with relative because it's the same user.. but it didn't). thank you and I hope my hint also helps someone

                  – davidhq
                  Nov 29 '18 at 9:45


















                18














                You could also save the mixer settings into a custom file with alsactl:



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


                Reloading:



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





                share|improve this answer



















                • 2





                  The top answer didn't work for me but this did! I created a config file and placed it at /etc/asound.state and added the reload line to my /etc/rc.local.

                  – John
                  Aug 31 '15 at 13:21











                • This was the right solution for me... but I had to specify the absolute path to .config file inside the rc.local (although it should work even with relative because it's the same user.. but it didn't). thank you and I hope my hint also helps someone

                  – davidhq
                  Nov 29 '18 at 9:45
















                18












                18








                18







                You could also save the mixer settings into a custom file with alsactl:



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


                Reloading:



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





                share|improve this answer













                You could also save the mixer settings into a custom file with alsactl:



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


                Reloading:



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






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 14 '14 at 7:36









                palacsintpalacsint

                1,227109




                1,227109








                • 2





                  The top answer didn't work for me but this did! I created a config file and placed it at /etc/asound.state and added the reload line to my /etc/rc.local.

                  – John
                  Aug 31 '15 at 13:21











                • This was the right solution for me... but I had to specify the absolute path to .config file inside the rc.local (although it should work even with relative because it's the same user.. but it didn't). thank you and I hope my hint also helps someone

                  – davidhq
                  Nov 29 '18 at 9:45
















                • 2





                  The top answer didn't work for me but this did! I created a config file and placed it at /etc/asound.state and added the reload line to my /etc/rc.local.

                  – John
                  Aug 31 '15 at 13:21











                • This was the right solution for me... but I had to specify the absolute path to .config file inside the rc.local (although it should work even with relative because it's the same user.. but it didn't). thank you and I hope my hint also helps someone

                  – davidhq
                  Nov 29 '18 at 9:45










                2




                2





                The top answer didn't work for me but this did! I created a config file and placed it at /etc/asound.state and added the reload line to my /etc/rc.local.

                – John
                Aug 31 '15 at 13:21





                The top answer didn't work for me but this did! I created a config file and placed it at /etc/asound.state and added the reload line to my /etc/rc.local.

                – John
                Aug 31 '15 at 13:21













                This was the right solution for me... but I had to specify the absolute path to .config file inside the rc.local (although it should work even with relative because it's the same user.. but it didn't). thank you and I hope my hint also helps someone

                – davidhq
                Nov 29 '18 at 9:45







                This was the right solution for me... but I had to specify the absolute path to .config file inside the rc.local (although it should work even with relative because it's the same user.. but it didn't). thank you and I hope my hint also helps someone

                – davidhq
                Nov 29 '18 at 9:45













                9














                Seppo Erviälä's answer is right but not complete. As dma_k already noted, man alsactl clearly states at the end that,




                /var/lib/alsa/asound.state (or whatever file you specify with the -f
                flag) is used to store current settings for
                your soundcards.




                palacsinit appropriately noted that you can store config into your file with



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


                and reload with



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


                This can be further improved with placing the second line, the restore command into a .desktop file.



                You will need to run nano ~/.config/autostart/alsarestore.desktop, which will open nano text editor and create ~/.config/autostart/alsarestore.desktop file. Entries in ~/.config/autostart/ directory are used to autostart programs and services for specific user on startup/graphical login.



                The contents of the .desktop file should be the following:



                [Desktop Entry]
                Type=Application
                Terminal=false
                Name=alsarestore
                Exec=alsactl --file ~/.config/asound.state restore


                Among other things, you could store your config in /etc/asound.state and symlink it to /var/lib/alsa/asound.state, but this one is more of a suggestion rather than tested solution






                share|improve this answer


























                • This was the only way I worked for me on Ubuntu Xenial 16.04

                  – Francisco Tomé Costa
                  Mar 18 '16 at 19:23








                • 1





                  The "store" and "restore" command work fine for manual control. However, when I set up the autostart file with the "restore" command, I see the mic setting in alsamixer is being rewritten to mute and the result is static. If i manually do the restore command, all is fine. Why is the mic setting changing and not being corrected by an appropriately stored configuration file by autostart???

                  – Brad Horn
                  Oct 8 '16 at 11:40













                • @BradHorn it's possible you have something else overwriting your command. It runs, but then something else undoes its changes

                  – Sergiy Kolodyazhnyy
                  Oct 8 '16 at 11:43











                • any ideas what that could be?

                  – Brad Horn
                  Oct 8 '16 at 11:44






                • 1





                  @BradHorn not of the top of my head, no. Try changing the Exec line in the .desktop file to be Exec=bash -c "sleep 5 && alsactl --file ~/.config/asound.state restore" . That will introduce a 5 second delay, so whatever is overwriting your settings will run first, and then your restore command will run after that. Try playing with the sleep values if that still overrides your settings.

                  – Sergiy Kolodyazhnyy
                  Oct 8 '16 at 11:49
















                9














                Seppo Erviälä's answer is right but not complete. As dma_k already noted, man alsactl clearly states at the end that,




                /var/lib/alsa/asound.state (or whatever file you specify with the -f
                flag) is used to store current settings for
                your soundcards.




                palacsinit appropriately noted that you can store config into your file with



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


                and reload with



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


                This can be further improved with placing the second line, the restore command into a .desktop file.



                You will need to run nano ~/.config/autostart/alsarestore.desktop, which will open nano text editor and create ~/.config/autostart/alsarestore.desktop file. Entries in ~/.config/autostart/ directory are used to autostart programs and services for specific user on startup/graphical login.



                The contents of the .desktop file should be the following:



                [Desktop Entry]
                Type=Application
                Terminal=false
                Name=alsarestore
                Exec=alsactl --file ~/.config/asound.state restore


                Among other things, you could store your config in /etc/asound.state and symlink it to /var/lib/alsa/asound.state, but this one is more of a suggestion rather than tested solution






                share|improve this answer


























                • This was the only way I worked for me on Ubuntu Xenial 16.04

                  – Francisco Tomé Costa
                  Mar 18 '16 at 19:23








                • 1





                  The "store" and "restore" command work fine for manual control. However, when I set up the autostart file with the "restore" command, I see the mic setting in alsamixer is being rewritten to mute and the result is static. If i manually do the restore command, all is fine. Why is the mic setting changing and not being corrected by an appropriately stored configuration file by autostart???

                  – Brad Horn
                  Oct 8 '16 at 11:40













                • @BradHorn it's possible you have something else overwriting your command. It runs, but then something else undoes its changes

                  – Sergiy Kolodyazhnyy
                  Oct 8 '16 at 11:43











                • any ideas what that could be?

                  – Brad Horn
                  Oct 8 '16 at 11:44






                • 1





                  @BradHorn not of the top of my head, no. Try changing the Exec line in the .desktop file to be Exec=bash -c "sleep 5 && alsactl --file ~/.config/asound.state restore" . That will introduce a 5 second delay, so whatever is overwriting your settings will run first, and then your restore command will run after that. Try playing with the sleep values if that still overrides your settings.

                  – Sergiy Kolodyazhnyy
                  Oct 8 '16 at 11:49














                9












                9








                9







                Seppo Erviälä's answer is right but not complete. As dma_k already noted, man alsactl clearly states at the end that,




                /var/lib/alsa/asound.state (or whatever file you specify with the -f
                flag) is used to store current settings for
                your soundcards.




                palacsinit appropriately noted that you can store config into your file with



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


                and reload with



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


                This can be further improved with placing the second line, the restore command into a .desktop file.



                You will need to run nano ~/.config/autostart/alsarestore.desktop, which will open nano text editor and create ~/.config/autostart/alsarestore.desktop file. Entries in ~/.config/autostart/ directory are used to autostart programs and services for specific user on startup/graphical login.



                The contents of the .desktop file should be the following:



                [Desktop Entry]
                Type=Application
                Terminal=false
                Name=alsarestore
                Exec=alsactl --file ~/.config/asound.state restore


                Among other things, you could store your config in /etc/asound.state and symlink it to /var/lib/alsa/asound.state, but this one is more of a suggestion rather than tested solution






                share|improve this answer















                Seppo Erviälä's answer is right but not complete. As dma_k already noted, man alsactl clearly states at the end that,




                /var/lib/alsa/asound.state (or whatever file you specify with the -f
                flag) is used to store current settings for
                your soundcards.




                palacsinit appropriately noted that you can store config into your file with



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


                and reload with



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


                This can be further improved with placing the second line, the restore command into a .desktop file.



                You will need to run nano ~/.config/autostart/alsarestore.desktop, which will open nano text editor and create ~/.config/autostart/alsarestore.desktop file. Entries in ~/.config/autostart/ directory are used to autostart programs and services for specific user on startup/graphical login.



                The contents of the .desktop file should be the following:



                [Desktop Entry]
                Type=Application
                Terminal=false
                Name=alsarestore
                Exec=alsactl --file ~/.config/asound.state restore


                Among other things, you could store your config in /etc/asound.state and symlink it to /var/lib/alsa/asound.state, but this one is more of a suggestion rather than tested solution







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 11 '16 at 12:08









                kleinfreund

                273316




                273316










                answered Apr 6 '15 at 21:34









                Sergiy KolodyazhnyySergiy Kolodyazhnyy

                70.7k9147310




                70.7k9147310













                • This was the only way I worked for me on Ubuntu Xenial 16.04

                  – Francisco Tomé Costa
                  Mar 18 '16 at 19:23








                • 1





                  The "store" and "restore" command work fine for manual control. However, when I set up the autostart file with the "restore" command, I see the mic setting in alsamixer is being rewritten to mute and the result is static. If i manually do the restore command, all is fine. Why is the mic setting changing and not being corrected by an appropriately stored configuration file by autostart???

                  – Brad Horn
                  Oct 8 '16 at 11:40













                • @BradHorn it's possible you have something else overwriting your command. It runs, but then something else undoes its changes

                  – Sergiy Kolodyazhnyy
                  Oct 8 '16 at 11:43











                • any ideas what that could be?

                  – Brad Horn
                  Oct 8 '16 at 11:44






                • 1





                  @BradHorn not of the top of my head, no. Try changing the Exec line in the .desktop file to be Exec=bash -c "sleep 5 && alsactl --file ~/.config/asound.state restore" . That will introduce a 5 second delay, so whatever is overwriting your settings will run first, and then your restore command will run after that. Try playing with the sleep values if that still overrides your settings.

                  – Sergiy Kolodyazhnyy
                  Oct 8 '16 at 11:49



















                • This was the only way I worked for me on Ubuntu Xenial 16.04

                  – Francisco Tomé Costa
                  Mar 18 '16 at 19:23








                • 1





                  The "store" and "restore" command work fine for manual control. However, when I set up the autostart file with the "restore" command, I see the mic setting in alsamixer is being rewritten to mute and the result is static. If i manually do the restore command, all is fine. Why is the mic setting changing and not being corrected by an appropriately stored configuration file by autostart???

                  – Brad Horn
                  Oct 8 '16 at 11:40













                • @BradHorn it's possible you have something else overwriting your command. It runs, but then something else undoes its changes

                  – Sergiy Kolodyazhnyy
                  Oct 8 '16 at 11:43











                • any ideas what that could be?

                  – Brad Horn
                  Oct 8 '16 at 11:44






                • 1





                  @BradHorn not of the top of my head, no. Try changing the Exec line in the .desktop file to be Exec=bash -c "sleep 5 && alsactl --file ~/.config/asound.state restore" . That will introduce a 5 second delay, so whatever is overwriting your settings will run first, and then your restore command will run after that. Try playing with the sleep values if that still overrides your settings.

                  – Sergiy Kolodyazhnyy
                  Oct 8 '16 at 11:49

















                This was the only way I worked for me on Ubuntu Xenial 16.04

                – Francisco Tomé Costa
                Mar 18 '16 at 19:23







                This was the only way I worked for me on Ubuntu Xenial 16.04

                – Francisco Tomé Costa
                Mar 18 '16 at 19:23






                1




                1





                The "store" and "restore" command work fine for manual control. However, when I set up the autostart file with the "restore" command, I see the mic setting in alsamixer is being rewritten to mute and the result is static. If i manually do the restore command, all is fine. Why is the mic setting changing and not being corrected by an appropriately stored configuration file by autostart???

                – Brad Horn
                Oct 8 '16 at 11:40







                The "store" and "restore" command work fine for manual control. However, when I set up the autostart file with the "restore" command, I see the mic setting in alsamixer is being rewritten to mute and the result is static. If i manually do the restore command, all is fine. Why is the mic setting changing and not being corrected by an appropriately stored configuration file by autostart???

                – Brad Horn
                Oct 8 '16 at 11:40















                @BradHorn it's possible you have something else overwriting your command. It runs, but then something else undoes its changes

                – Sergiy Kolodyazhnyy
                Oct 8 '16 at 11:43





                @BradHorn it's possible you have something else overwriting your command. It runs, but then something else undoes its changes

                – Sergiy Kolodyazhnyy
                Oct 8 '16 at 11:43













                any ideas what that could be?

                – Brad Horn
                Oct 8 '16 at 11:44





                any ideas what that could be?

                – Brad Horn
                Oct 8 '16 at 11:44




                1




                1





                @BradHorn not of the top of my head, no. Try changing the Exec line in the .desktop file to be Exec=bash -c "sleep 5 && alsactl --file ~/.config/asound.state restore" . That will introduce a 5 second delay, so whatever is overwriting your settings will run first, and then your restore command will run after that. Try playing with the sleep values if that still overrides your settings.

                – Sergiy Kolodyazhnyy
                Oct 8 '16 at 11:49





                @BradHorn not of the top of my head, no. Try changing the Exec line in the .desktop file to be Exec=bash -c "sleep 5 && alsactl --file ~/.config/asound.state restore" . That will introduce a 5 second delay, so whatever is overwriting your settings will run first, and then your restore command will run after that. Try playing with the sleep values if that still overrides your settings.

                – Sergiy Kolodyazhnyy
                Oct 8 '16 at 11:49











                1














                After 2 months of trying to make "sudo alsactl store" to work, I finally managed to do it.
                Firstly type in terminal "alsamixer" to enter the alsamixer UI. Then make the configurations you need(e.g increase speakers/headphones level or unmute something pressing "m" on keyboard).
                Now the most important part. Before you exit alsamixer, open a new terminal and do : "sudo su" to get high privileges (Be very careful with commands you use in "sudo su" mode because you may destroy your system) and then do "alsactl store" to save alsa settings. Then close both terminals and restart your computer. This will do the job.






                share|improve this answer
























                • This doesn’t work for me.

                  – kleinfreund
                  Aug 21 '18 at 7:28
















                1














                After 2 months of trying to make "sudo alsactl store" to work, I finally managed to do it.
                Firstly type in terminal "alsamixer" to enter the alsamixer UI. Then make the configurations you need(e.g increase speakers/headphones level or unmute something pressing "m" on keyboard).
                Now the most important part. Before you exit alsamixer, open a new terminal and do : "sudo su" to get high privileges (Be very careful with commands you use in "sudo su" mode because you may destroy your system) and then do "alsactl store" to save alsa settings. Then close both terminals and restart your computer. This will do the job.






                share|improve this answer
























                • This doesn’t work for me.

                  – kleinfreund
                  Aug 21 '18 at 7:28














                1












                1








                1







                After 2 months of trying to make "sudo alsactl store" to work, I finally managed to do it.
                Firstly type in terminal "alsamixer" to enter the alsamixer UI. Then make the configurations you need(e.g increase speakers/headphones level or unmute something pressing "m" on keyboard).
                Now the most important part. Before you exit alsamixer, open a new terminal and do : "sudo su" to get high privileges (Be very careful with commands you use in "sudo su" mode because you may destroy your system) and then do "alsactl store" to save alsa settings. Then close both terminals and restart your computer. This will do the job.






                share|improve this answer













                After 2 months of trying to make "sudo alsactl store" to work, I finally managed to do it.
                Firstly type in terminal "alsamixer" to enter the alsamixer UI. Then make the configurations you need(e.g increase speakers/headphones level or unmute something pressing "m" on keyboard).
                Now the most important part. Before you exit alsamixer, open a new terminal and do : "sudo su" to get high privileges (Be very careful with commands you use in "sudo su" mode because you may destroy your system) and then do "alsactl store" to save alsa settings. Then close both terminals and restart your computer. This will do the job.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 30 '15 at 1:19









                tisfotisfo

                10914




                10914













                • This doesn’t work for me.

                  – kleinfreund
                  Aug 21 '18 at 7:28



















                • This doesn’t work for me.

                  – kleinfreund
                  Aug 21 '18 at 7:28

















                This doesn’t work for me.

                – kleinfreund
                Aug 21 '18 at 7:28





                This doesn’t work for me.

                – kleinfreund
                Aug 21 '18 at 7:28











                0














                After running sudo alsamixer the mixer should should retain the changes you make.



                See Sound does not work once my profile loads on which answers you can find a clue also.



                Good luck!






                share|improve this answer






























                  0














                  After running sudo alsamixer the mixer should should retain the changes you make.



                  See Sound does not work once my profile loads on which answers you can find a clue also.



                  Good luck!






                  share|improve this answer




























                    0












                    0








                    0







                    After running sudo alsamixer the mixer should should retain the changes you make.



                    See Sound does not work once my profile loads on which answers you can find a clue also.



                    Good luck!






                    share|improve this answer















                    After running sudo alsamixer the mixer should should retain the changes you make.



                    See Sound does not work once my profile loads on which answers you can find a clue also.



                    Good luck!







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Apr 13 '17 at 12:25









                    Community

                    1




                    1










                    answered Jun 22 '11 at 18:51









                    Geppettvs D'ConstanzoGeppettvs D'Constanzo

                    16.2k43283




                    16.2k43283























                        0














                        Alsa-Json-Gateway https://github.com/fulup-bzh/AlsaJsonGateway supports store/restore of sound card sessions from JSON/REST API




                        • list sessions /jsonapi?request=session-list&cardid=hw:0

                        • store session /jsonapi?request=session-store&cardid=hw:0&args=MySoundConfig

                        • restore /jsonapi?request=session-load&cardid=hw:0&args=MySoundConfig






                        share|improve this answer




























                          0














                          Alsa-Json-Gateway https://github.com/fulup-bzh/AlsaJsonGateway supports store/restore of sound card sessions from JSON/REST API




                          • list sessions /jsonapi?request=session-list&cardid=hw:0

                          • store session /jsonapi?request=session-store&cardid=hw:0&args=MySoundConfig

                          • restore /jsonapi?request=session-load&cardid=hw:0&args=MySoundConfig






                          share|improve this answer


























                            0












                            0








                            0







                            Alsa-Json-Gateway https://github.com/fulup-bzh/AlsaJsonGateway supports store/restore of sound card sessions from JSON/REST API




                            • list sessions /jsonapi?request=session-list&cardid=hw:0

                            • store session /jsonapi?request=session-store&cardid=hw:0&args=MySoundConfig

                            • restore /jsonapi?request=session-load&cardid=hw:0&args=MySoundConfig






                            share|improve this answer













                            Alsa-Json-Gateway https://github.com/fulup-bzh/AlsaJsonGateway supports store/restore of sound card sessions from JSON/REST API




                            • list sessions /jsonapi?request=session-list&cardid=hw:0

                            • store session /jsonapi?request=session-store&cardid=hw:0&args=MySoundConfig

                            • restore /jsonapi?request=session-load&cardid=hw:0&args=MySoundConfig







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Apr 6 '15 at 20:47









                            fulupfulup

                            1




                            1























                                0














                                For those whom @Sergiy Kolodyazhnyy 's answer didn't work, try replacing alsactl by its complete path (whatever the which alsactl returned to you).






                                share|improve this answer




























                                  0














                                  For those whom @Sergiy Kolodyazhnyy 's answer didn't work, try replacing alsactl by its complete path (whatever the which alsactl returned to you).






                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    For those whom @Sergiy Kolodyazhnyy 's answer didn't work, try replacing alsactl by its complete path (whatever the which alsactl returned to you).






                                    share|improve this answer













                                    For those whom @Sergiy Kolodyazhnyy 's answer didn't work, try replacing alsactl by its complete path (whatever the which alsactl returned to you).







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Jan 4 at 16:21









                                    dev93dev93

                                    338




                                    338






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Ask Ubuntu!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f50067%2fhowto-save-alsamixer-settings%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Human spaceflight

                                        Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                                        File:DeusFollowingSea.jpg