You are not logged in.
I primary use my headset connected to the front panel of my PC case, but sometimes I want to use speakers attached to my monitor connected to PC via DisplayPort.
[adam@adam ~]$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
hdmi:CARD=HDMI,DEV=0
HDA ATI HDMI, HDMI 0
HDMI Audio Output
hdmi:CARD=HDMI,DEV=1
HDA ATI HDMI, HDMI 1
HDMI Audio Output
hdmi:CARD=HDMI,DEV=2
HDA ATI HDMI, HDMI 2
HDMI Audio Output
hdmi:CARD=HDMI,DEV=3
HDA ATI HDMI, HDMI 3
HDMI Audio Output
hdmi:CARD=HDMI,DEV=4
HDA ATI HDMI, HDMI 4
HDMI Audio Output
hdmi:CARD=HDMI,DEV=5
HDA ATI HDMI, HDMI 5
HDMI Audio Output
sysdefault:CARD=Generic
HD-Audio Generic, ALC1220 Analog
Default Audio Device
front:CARD=Generic,DEV=0
HD-Audio Generic, ALC1220 Analog
Front speakers
surround21:CARD=Generic,DEV=0
HD-Audio Generic, ALC1220 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Generic,DEV=0
HD-Audio Generic, ALC1220 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Generic,DEV=0
HD-Audio Generic, ALC1220 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Generic,DEV=0
HD-Audio Generic, ALC1220 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Generic,DEV=0
HD-Audio Generic, ALC1220 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Generic,DEV=0
HD-Audio Generic, ALC1220 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Generic,DEV=0
HD-Audio Generic, ALC1220 Digital
IEC958 (S/PDIF) Digital Audio Output
and
[adam@adam ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 11: HDMI 5 [HDMI 5]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC1220 Analog [ALC1220 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALC1220 Digital [ALC1220 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
First of all, ALSA seems to treat DisplayPort as a HDMI - strange, but if works, I don't care.
I read a lot of Internet, but did not find solution to use more than one device, mute monitor speakers when headset is plugged in or at least control which one I want to be used atm. Here is my .asoundrc right now
pcm.!default {
type hw
card 0
device 10
}
pcm.!default {
type hw
card 1
device 0
}
card1/device0 is front panel of the case, while card0/device10 - I checked many combination to figure this out. With it, headset (1/0) is working (even microphone), but when unplugged, there is no sound from monitor speakers (0/10).
With this, I can't smoothly play sound on different apllications - I need to close for example YouTube to get sound from SMplayer. If I remove 1/0 block I get sound from speakers, but not from headset.
Before I started playing around I had just:
[adam@adam ~]$ cat asoundrc.copy
defaults.pcm.!card 1
defaults.pcm.!device 0
But as I said, monitor speakers did not worked at all.
Plz do not send me to wiki or ALSA documentaion, I already read all what I am able to understand and did not help - I am also not that smart user to learn advanced configuration file language - I just simply want my sound to play on device I plug in. Found no example showing that problem.
Is there any option to use all available cards/devices without worrying what is in .asoundrc? Like
allow_all_devices=True
or something.
I have removed pulseaudio, since I could not get sound in This Was of Mine (and it helped) but if there is no way to set up two/more devices with ALSA, I may consider installing it again.
Also, after I modify .asound I need to logout and login every time, since
alsactl nrestore
is not working, is there any way to actually reload ALSA?
Offline
If you don't want to bother with ALSA config and want automatic switching to happen, install pulseaudio. An issue with a single application is much easier to fix than trying to bolt (seamless, if you don't mind having to restart applications one can do it on ALSA too) support for the usecase you have onto ALSA.
If you decide for that. Make sure you remove your current .asoundrc and install pulseaudio-alsa and lib32-libpulse, lib32-alsa-plugins that should set up most of the compatibility layers that any application could want.
Online
I once used this to duplicate output to my soundcard and HDMI. But in the end i decided to switch to one dedicated device only though (simple .asoundrc config). I cannot tell much about it anymore though. Its been too long.
defaults.pcm.rate_converter "speexrate_medium"
# defaults.pcm.!card NVidia
# defaults.ctl.!card NVidia
# defaults.pcm.!device 7
# defaults.ctl.!device 7
# pcm.ploop {
# type plug
# slave.pcm "hw:Loopback,0,0"
# }
# pcm.cloop {
# type plug
# slave.pcm "hw:Loopback,1,0"
# }
pcm.!default {
type hw
card "Audigy2"
device 0
}
# pcm.!default {
# type hw
# card "NVidia"
# device 7
# }
ctl.!default {
type hw
card Audigy2
}
pcm.both {
type route;
slave.pcm {
type multi;
slaves.a.pcm "myaudigy2";
slaves.b.pcm "mynvidia";
slaves.a.channels 2;
slaves.b.channels 2;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
}
ttable.0.0 1;
ttable.1.1 1;
ttable.0.2 1;
ttable.1.3 1;
}
ctl.both {
type hw;
card Audigy2;
}
pcm.myaudigy2 {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 2048
buffer_size 65536
buffer_time 0
periods 128
#rate 48000
channels 2
}
bindings {
0 0
1 1
}
}
ctl.myaudigy2 {
type hw
card "Audigy2"
}
pcm.mynvidia {
type dmix
ipc_key 2048
slave {
pcm "hw:1,7"
period_time 0
period_size 2048
buffer_size 65536
buffer_time 0
periods 128
#rate 48000
channels 2
}
bindings {
0 0
1 1
}
}
ctl.mynvidia {
type hw
card "NVidia"
}
sys2064
Offline
Try running 2 different applications (in this example firefox and mpv) at the same time like this:
env ALSA_CARD=Generic firefox
env ALSA_CARD=HDMI mpv
Plz do not send me to wiki or ALSA documentaion
That's not a very good finishing note to a post on Arch forums
Offline