ALSA: Setting the default sound device

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Post Reply
Message
Author
User avatar
handy
Posts: 611
Joined: Mon Apr 23, 2018 2:00 pm

ALSA: Setting the default sound device

#1 Post by handy »

For those of us that don't use Pulseaudio for whatever reason, we may on occasion find that we don't get sound. Digging into why we don't get sound, we often find that the reason is that the wrong sound card is being chosen. Following is a simple & permanent fix to this problem:


If your system keeps on using the wrong device (HDMI instead of PCH or vica versa, or some other problem), then use one of the following two methods to identify the device's number & then instruct your system to use that number/device:

Run alsamixer - if you have it installed, just enter:

Code: Select all

alsamixer
at the terminal prompt.

In alsamixer hit the F6 function key, then you'll see the devices listed in a little box, with their numbers in front of them.

OR

Enter the following into a terminal:

Code: Select all

cat /proc/asound/cards

Choose the number of the sound device that you want to use.
Then using your text editor of choice, put the following into /etc/asound.conf (You will most likely have to create /etc/asound.conf ).

Code: Select all

defaults.pcm.card 1
defaults.ctl.card 1
Change the number from 1 to 0 , 2 or whatever?

Save the file & play a movie or listen to a tune.

I can imagine that if you had need to change between two sound devices from time to time, you could write a simple script that quickly swapped from one /etc/asound.conf file to another. All it would have to do is change/swap the file extensions from asound.conf.bak to asound.conf & visa versa when desired. ;)


The core information in this page came from the ALSA Project:

https://www.alsa-project.org/main/index.php/Main_Page

For those that need a fix for the same problem & they are running Pulseaudio, this page has a solution:

https://forum.manjaro.org/t/pulseaudio- ... vice/36562
1_MSI: MAG B560 TORP', i5, RAM 16GB, GTX 1070 Ti 12GB, M2 238GB + USB, MX-23 Fb to Openbox
2_Lenovo: Ideapad 520S, i5, RAM 8GB, GPU i620, HDD 1TB, MX-21 - Openbox
3_Clevo: P150SM-A, i7, RAM 16GB, nVidia 8600, 2x 1TB HDD & M.2 256 GB, MX-21 - Openbox

User avatar
Jerry3904
Administrator
Posts: 21881
Joined: Wed Jul 19, 2006 6:13 am

Re: ALSA: Setting the default sound device

#2 Post by Jerry3904 »

Have you looked at MX Select Sound, which puts this in GUI form?
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 1:21 am

Re: ALSA: Setting the default sound device

#3 Post by KoO »

@handy
Good information for those of us who don,t use pulseaudio...
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

User avatar
handy
Posts: 611
Joined: Mon Apr 23, 2018 2:00 pm

Re: ALSA: Setting the default sound device

#4 Post by handy »

Jerry3904 wrote: Fri Oct 19, 2018 9:30 pm Have you looked at MX Select Sound, which puts this in GUI form?
Jerry I don't use the standard MX setup. So all of those GUI tools don't exist in the system that I use.

I know that there are a LOT of really cool & popular tools that both antiX & MX bring to the table for their respective communities. I'm just bit more CLI & config file oriented (though I'm not a terminal freek). ;)
1_MSI: MAG B560 TORP', i5, RAM 16GB, GTX 1070 Ti 12GB, M2 238GB + USB, MX-23 Fb to Openbox
2_Lenovo: Ideapad 520S, i5, RAM 8GB, GPU i620, HDD 1TB, MX-21 - Openbox
3_Clevo: P150SM-A, i7, RAM 16GB, nVidia 8600, 2x 1TB HDD & M.2 256 GB, MX-21 - Openbox

User avatar
handy
Posts: 611
Joined: Mon Apr 23, 2018 2:00 pm

Re: ALSA: Setting the default sound device

#5 Post by handy »

KoO wrote: Fri Oct 19, 2018 11:30 pm @handy
Good information for those of us who don,t use pulseaudio...
Thanks KoO. :)

Though, as jerry says, there looks to be a GUI way of doing this built into MX/(maybe antiX too?).
1_MSI: MAG B560 TORP', i5, RAM 16GB, GTX 1070 Ti 12GB, M2 238GB + USB, MX-23 Fb to Openbox
2_Lenovo: Ideapad 520S, i5, RAM 8GB, GPU i620, HDD 1TB, MX-21 - Openbox
3_Clevo: P150SM-A, i7, RAM 16GB, nVidia 8600, 2x 1TB HDD & M.2 256 GB, MX-21 - Openbox

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 1:21 am

Re: ALSA: Setting the default sound device

#6 Post by KoO »

------------------Set Default Sound Card AntiX--------------------

Terminal = antiX-cli-cc press enter > Audio/Visual menu > alsa-set-default-card > enter number (Use your arrow keys to move around)

antix Control Centre > Set Default Sound Card > pick your card > click ok

AlsaMixer > F6 or s > pick your card > exit (just to make sure the settings are saved after you pick your card run this command) = sudo alsactl store

Some sound card commands
aplay -l
aplay -L

For sound modules
cat /proc/asound/modules
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

Post Reply

Return to “Tips & Tricks by users”