[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Setting default sound device (was Re: New Dell Inspiron 15 3000 Series 3511 sound problem on Debian 11 Stable)



This is going a bit off topic, but since there are probably
a number of sound gurus following the original thread, I
thought I'd throw out another sound question.

I have a desktop machine running Debian 11.  It contains an
nVidia card which I've hooked to my TV via HDMI.  Currently
sound is coming out the analog jacks on the computer; I'd like
to put the sound on the HDMI output so when switching the TV
from my cable box to the computer, I don't have to also switch
my sound system's input.

I know my hardware is capable of doing this; if I type

mpv --audio-device=alsa/hdmi:CARD=NVidia,DEV=0 foo.mp3

foo.mp3 will play through the HDMI audio output rather than
the default analog jacks.  What I want to do is make the HDMI
audio output the default.

When I bring up alsamixer and hit F6, I get the following choices:
  0  HDA Intel
  1  HDA NVidia
  2  IVTV-0
  3  IVTV-1
There's no mention of which is the default or how to set a default.

Here's the output of the aplay -l command:

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC9271D Analog [STAC9271D Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: STAC9271D Digital [STAC9271D 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

I've tried cobbling together bits and pieces I've found in
various places to create the following /etc/aplay.conf:

defaults.pcm.card 1
defaults.pcm.device 0
defaults.ctl.card 1
defaults.ctl.device 0

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

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

I've tried substituting both 3 and 7 on the "device" lines,
but nothing seems to have any effect.

I'm not sure what it takes to get ALSA to recognize a change in
its configuration, so I rebooted after each change just in case.

Although I've found many references to this topic on the web,
the answers are confusing, conflicting, or oriented toward
PulseAudio rather than ALSA.  Can someone help clear the air?

--
/~\  Charlie Gibbs                  |  Life is perverse.
\ /  <cgibbs@kltpzyxm.invalid>      |  It can be beautiful -
 X   I'm really at ac.dekanfrus     |  but it won't.
/ \  if you read it the right way.  |    -- Lily Tomlin


Reply to: