When you have PA installed, it is normally configured so ALSA outputs to PA. This should already be configured in the file /etc/asound.conf and you should not edit this file. However, you can make a config file for your user that will override this behaviour. Personally, I suggest you stick to the default behaviour and only override it when needed.
To override this behaviour and enable the use of ALSA/dmix, create a file in your home folder with the name ".asoundrc"
Every file that start with a . (dot) is hidden, which means you normally don't see it in your file manager. To make hidden files visible, just press CTRL+h and all those files will become visible in your file manager. If you press CTRL+h again it will hide those files again. If there already is a file named .asoundrc in your home folder, please post the contents of that file. Normally there should not be any, but there is always the chance that some distros have things set up in an unusual manner.
When you have created the file .asoundrc, open it with a text editor and type in the following:
Code:
pcm.custom {
type plug
slave {
pcm "dmix:DEVICE_NAME"
}
}
pcm.!default pcm.custom
You are going to have to make one change to the config. Notice where I have written DEVICE_NAME, you need to change the to the device name that you want to use. To find the available names, just type the following command in your terminal:
You will see something like this:
Code:
wolf@fang ~ % aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC668 Analog [ALC668 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC668 Digital [ALC668 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
My laptop speakers is card 0, so if I wanted to use my laptop speakers, my device name is PCH, so in my config file I would type:
on the fourth line.
If I wanted to use the HDMI for sound, I would instead type:
As soon as this config file is in place, every new program or game you start is going to use ALSA, not PA. But PA should still be able to control the volume of your audio device. However, I would suggest that you only use this config when you need it, so you can rename it to .asoundrc.bak most of the time so it is not in use, and then only rename it back to .asoundrc when you do need it. If you install pavucontrol from the software center, this is a program that will let you change audio output device on the fly, but this only works when you are using PA. I consider this a very useful feature of PA.
You can try this out, and if you are interested, I could help you modify a specific game shortcut for PlayOnLinux that could toggle this config "on" when you start the game, and "off" once you close the game so you would not need to rename the config file manually each time you want to use it.