How can I automatically select the correct Sound Blaster output at startup in Linux Mint Cinnamon?

0
0
Asked By MellowPine47 On

I'm using Linux Mint Cinnamon 22.3 64-bit with a Creative Sound Blaster AE-7. After booting, the card often selects the wrong output, so I currently have to open alsamixer and change it manually. My current sequence is to open a terminal, run alsamixer, press F6, select "default:0 HDA Creative," move across to "," switch it from Headphones to Speakers, press Escape, and close the terminal. What would be the proper way to automate this at login or startup? I'd prefer a reliable configuration or command-based solution rather than simulating key presses.

3 Answers

Answered By QuietOrbit8 On

You probably shouldn’t automate the interactive alsamixer keystrokes. Set the mixer to the desired state once, then try saving it with `sudo alsactl store`. The saved state is normally written to `/etc/asound.state` and restored when ALSA initializes. If that doesn’t happen automatically, a small user autostart entry or service can run the restore command after login.

MellowPine47 -

I tried saving the mixer state several times, but it still reverted after reboot. It seems another audio component may be applying its own defaults afterward.

Answered By ConfigCedar29 On

Another option is to configure the default PCM and control devices in an ALSA configuration file such as `/etc/asound.conf`. That can be more dependable than moving through alsamixer with simulated keyboard input. If the problem is actually caused by the desktop audio layer changing the device after login, you may need to configure the preferred output there as well.

MellowPine47 -

I may have tried a configuration file before, but the change seemed to toggle briefly and then switch back. I also ran into system stability problems and reinstalled, so I’m looking for a careful, reliable approach.

Answered By SilverMaple6 On

If you absolutely need a script, write a shell script that uses the non-interactive ALSA commands for the specific control rather than launching a terminal and sending key presses. First identify the exact control name with `amixer -c 0`, then use `amixer` or `alsactl` to set that control. Test the command manually before adding it to desktop autostart; system startup can run before the user audio session is ready.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.