[LAU] Setting HDMI as default in asoundrc and getting Firefox to use this default

Joel Roth joelz at pobox.com
Sun Apr 17 23:37:20 CEST 2022


Hi Wise Ones,

I'm trying to set HDMI as the default output in asoundrc.

I have quite a few possibilities, listed here by aplay -L

     hw:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         Direct hardware device without any conversions
     hw:CARD=PCH,DEV=3
         HDA Intel PCH, HDMI 0
         Direct hardware device without any conversions
     hw:CARD=PCH,DEV=7
         HDA Intel PCH, HDMI 1
         Direct hardware device without any conversions
     hw:CARD=PCH,DEV=8
         HDA Intel PCH, HDMI 2
         Direct hardware device without any conversions
     hw:CARD=PCH,DEV=9
         HDA Intel PCH, HDMI 3
         Direct hardware device without any conversions
     hw:CARD=PCH,DEV=10
         HDA Intel PCH, HDMI 4
         Direct hardware device without any conversions
     plughw:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         Hardware device with all software conversions
     plughw:CARD=PCH,DEV=3
         HDA Intel PCH, HDMI 0
         Hardware device with all software conversions
     plughw:CARD=PCH,DEV=7
         HDA Intel PCH, HDMI 1
         Hardware device with all software conversions
     plughw:CARD=PCH,DEV=8
         HDA Intel PCH, HDMI 2
         Hardware device with all software conversions
     plughw:CARD=PCH,DEV=9
         HDA Intel PCH, HDMI 3
         Hardware device with all software conversions
     plughw:CARD=PCH,DEV=10
         HDA Intel PCH, HDMI 4
         Hardware device with all software conversions
     default:CARD=PCH
         HDA Intel PCH, ALC662 rev3 Analog
         Default Audio Device
     sysdefault:CARD=PCH
         HDA Intel PCH, ALC662 rev3 Analog
         Default Audio Device
     front:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         Front output / input
     surround21:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         2.1 Surround output to Front and Subwoofer speakers
     surround40:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         4.0 Surround output to Front and Rear speakers
     surround41:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         4.1 Surround output to Front, Rear and Subwoofer speakers
     surround50:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         5.0 Surround output to Front, Center and Rear speakers
     surround51:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         5.1 Surround output to Front, Center, Rear and Subwoofer speakers
     surround71:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
     hdmi:CARD=PCH,DEV=0
         HDA Intel PCH, HDMI 0
         HDMI Audio Output
     hdmi:CARD=PCH,DEV=1
         HDA Intel PCH, HDMI 1
         HDMI Audio Output
     hdmi:CARD=PCH,DEV=2
         HDA Intel PCH, HDMI 2
         HDMI Audio Output
     hdmi:CARD=PCH,DEV=3
         HDA Intel PCH, HDMI 3
         HDMI Audio Output
     hdmi:CARD=PCH,DEV=4
         HDA Intel PCH, HDMI 4
         HDMI Audio Output
     dmix:CARD=PCH,DEV=0
         HDA Intel PCH, ALC662 rev3 Analog
         Direct sample mixing device
     dmix:CARD=PCH,DEV=3
         HDA Intel PCH, HDMI 0
         Direct sample mixing device
     dmix:CARD=PCH,DEV=7
         HDA Intel PCH, HDMI 1
         Direct sample mixing device
     dmix:CARD=PCH,DEV=8
         HDA Intel PCH, HDMI 2
         Direct sample mixing device
     dmix:CARD=PCH,DEV=9
         HDA Intel PCH, HDMI 3
         Direct sample mixing device
     dmix:CARD=PCH,DEV=10
         HDA Intel PCH, HDMI 4
         Direct sample mixing device

By trial-and-error (how else to do it?) I find the following
commands generate audio output to a TV connected via HDMI. 

aplay -D plughw:CARD=PCH,DEV=7 ~/music/tmh.wav
aplay -D hw:CARD=PCH,DEV=7 ~/music/tmh.wav

I would prefer a setting with dmix, but the following fails:

aplay -D dmix:CARD=PCH,DEV=7

Playing WAVE '/home/jroth/music/tmh.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1343: Sample format non available
Available formats:
- S32_LE


Attempting to translate a working example to asoundrc, I find aplay (without -D option) produces
sound output at the TV with the following:

pcm.!default {
    type hw 
	card 0
	device 7
}

However even after restarting firefox, it doesn't play to this
output. 

I tried adding a ctl stanza:

ctl.!default {
    type hw 
	card 0
	device 7
}

This doesn't affect aplay, but firefox doesn't output to
headphones or HDMI with this setting in asoundrc.

I welcome any suggestions to get firefox to default to
the asoundrc setting. 

TIA,

Joel

-- 
Joel Roth


More information about the Linux-audio-user mailing list