I have 2 playback device where one is HDMI and the other is HAT sound card. The requirement is to play audio from card 0 or 1 without rebooting the system.
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndrpistest [snd_rpi_s5_adcdac], device 0: Test HiFi tlv320aic31xx-hifi-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0
1) If I configure the following in ~./asoundrc
and reboot, the audio is playing from HDMI
pcm.!default {
type hw
card 0 ----> HDMI
}
ctl.!default {
type hw
card 0 ----> HDMI
}
If I configure the following in ~./asoundrc
and reboot, the audio is playing from HAT sound card
pcm.!default {
type hw
card 1 ----> HAT sound card
}
ctl.!default {
type hw
card 1 ----> HAT sound card
}
Is there is a way to configure the sound card from card 0 card 1 or vise versa without rebooting?