Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #243807 > unrolled thread

Defaulting sound output to HDMI port

Started byCharlie Gibbs <cgibbs@surfnaked.ca>
First post2022-01-07 21:10 +0100
Last post2022-01-15 19:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  Defaulting sound output to HDMI port Charlie Gibbs <cgibbs@surfnaked.ca> - 2022-01-07 21:10 +0100
    Re: Defaulting sound output to HDMI port David <bouncingcats@gmail.com> - 2022-01-07 21:40 +0100
    Re: Defaulting sound output to HDMI port Andrei POPESCU <andreimpopescu@gmail.com> - 2022-01-15 19:40 +0100

#243807 — Defaulting sound output to HDMI port

FromCharlie Gibbs <cgibbs@surfnaked.ca>
Date2022-01-07 21:10 +0100
SubjectDefaulting sound output to HDMI port
Message-ID<DD3IK-1Ck-5@gated-at.bofh.it>
I have a computer in the living room which is hooked up to our TV
via an HDMI cable.  I use it to play MP3s, videos, and games.
Our TV is hooked to our stereo system to get good-quality sound.
However, audio isn't passing through the HDMI connection from the
computer; to get sound I've run a separate cable from the computer's
headphone jack to an auxiliary input on the stereo system, and I have
to switch the stereo to this input to get sound.  It's not the end of
the world, but it would be nice to send the audio via HDMI so I can
just switch the TV's input and leave the stereo set to the TV.

I'm running Buster with xfce.  Here's some system information:

cjg@dragon:~$ uname -a
Linux dragon 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) 
x86_64 GNU/Linux
cjg@dragon:~$ cat /proc/asound/cards
  0 [Intel          ]: HDA-Intel - HDA Intel
                       HDA Intel at 0xe5320000 irq 27
  1 [NVidia         ]: HDA-Intel - HDA NVidia
                       HDA NVidia at 0xe5000000 irq 17
  2 [IVTV1          ]: CX2341[56] - IVTV-1
                       CX2341[56] #1 WinTV PVR 500 (unit #2) TV/FM 
Radio/Line-In Capture
  3 [IVTV0          ]: CX2341[56] - IVTV-0
                       CX2341[56] #0 WinTV PVR 500 (unit #1) TV/FM 
Radio/Line-In Capture
cjg@dragon:~$ aplay -l
**** 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

After searching the web and mpv's man page, I found that the following
command would play sound through the computer's HDMI port:

cjg@dragon:~$ mpv --audio-device=alsa/hdmi:CARD=NVidia,DEV=0 foo.mp3

Obviously there's nothing wrong with my hardware.  Is there any
setting that will make audio output default to the HDMI port?

I've tried searching the web, and found lots of stuff that makes
my eyes glaze over.  One site suggested creating /etc/asound.conf
and putting in the following lines:

defaults.pcm.card 1
defaults.ctl.card 1

This had no effect, even after a re-boot.

I tried creating ~/.asoundrc containing the following,
also with no effect:

pcm.!default {
     type hw
     card "NVidia"
}

ctl.!default {
     type hw
     card "NVidia"
}

I've tried using aplay, but I can't make the -D parameter work.
I get either "Channels count non available" or "No such file or
directory".

I'm using ALSA, not PulseAudio.  If I bring up alsamixer and
press F6, I get the following selections:

     .  (default)
     0  HDA Intel
     1  HDA NVidia
     2  IVTV-1
     3  IVTV-0
        enter device name...

If I select 1 (HDA NVidia), all I get are a couple of mute switches
labeled "S/PDIF" and "S/PDIF 1".  I've turned them both on.

Any suggestions as to where to go from here?
-- 
/~\  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

[toc] | [next] | [standalone]


#243810

FromDavid <bouncingcats@gmail.com>
Date2022-01-07 21:40 +0100
Message-ID<DD4bL-1LL-3@gated-at.bofh.it>
In reply to#243807
On Sat, 8 Jan 2022 at 07:06, Charlie Gibbs <cgibbs@surfnaked.ca> wrote:

> I have a computer in the living room which is hooked up to our TV
> via an HDMI cable.  I use it to play MP3s, videos, and games.
> Our TV is hooked to our stereo system to get good-quality sound.
> However, audio isn't passing through the HDMI connection from the
> computer; to get sound I've run a separate cable from the computer's
> headphone jack to an auxiliary input on the stereo system, and I have
> to switch the stereo to this input to get sound.  It's not the end of
> the world, but it would be nice to send the audio via HDMI so I can
> just switch the TV's input and leave the stereo set to the TV.

[snip details]

> Any suggestions as to where to go from here?

linux-audio-user@lists.linuxaudio.org

[toc] | [prev] | [next] | [standalone]


#244024

FromAndrei POPESCU <andreimpopescu@gmail.com>
Date2022-01-15 19:40 +0100
Message-ID<DFW82-8oR-5@gated-at.bofh.it>
In reply to#243807

[Multipart message — attachments visible in raw view] — view raw

On Vi, 07 ian 22, 11:43:34, Charlie Gibbs wrote:
> I have a computer in the living room which is hooked up to our TV
> via an HDMI cable.  I use it to play MP3s, videos, and games.
> Our TV is hooked to our stereo system to get good-quality sound.
> However, audio isn't passing through the HDMI connection from the
> computer; to get sound I've run a separate cable from the computer's
> headphone jack to an auxiliary input on the stereo system, and I have
> to switch the stereo to this input to get sound.  It's not the end of
> the world, but it would be nice to send the audio via HDMI so I can
> just switch the TV's input and leave the stereo set to the TV.
> 
> I'm running Buster with xfce.  Here's some system information:
> 
> cjg@dragon:~$ uname -a
> Linux dragon 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
> x86_64 GNU/Linux
> cjg@dragon:~$ cat /proc/asound/cards
>  0 [Intel          ]: HDA-Intel - HDA Intel
>                       HDA Intel at 0xe5320000 irq 27
>  1 [NVidia         ]: HDA-Intel - HDA NVidia
>                       HDA NVidia at 0xe5000000 irq 17
>  2 [IVTV1          ]: CX2341[56] - IVTV-1
>                       CX2341[56] #1 WinTV PVR 500 (unit #2) TV/FM
> Radio/Line-In Capture
>  3 [IVTV0          ]: CX2341[56] - IVTV-0
>                       CX2341[56] #0 WinTV PVR 500 (unit #1) TV/FM
> Radio/Line-In Capture
> cjg@dragon:~$ aplay -l
> **** 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
> 
> After searching the web and mpv's man page, I found that the following
> command would play sound through the computer's HDMI port:
> 
> cjg@dragon:~$ mpv --audio-device=alsa/hdmi:CARD=NVidia,DEV=0 foo.mp3
> 
> Obviously there's nothing wrong with my hardware.  Is there any
> setting that will make audio output default to the HDMI port?

From memory, there are actually several ways to do this.

My preferred method is via kernel module options. E.g. for a system 
where I had the opposite problem (sound would default to HDMI instead of 
the on-board sound, both handled by the snd-hda-intel module) I have 
this:

$ cat /etc/modprobe.d/snd-hda-intel-index.conf 
# change order of devices
options snd-hda-intel index=1,0

(a rebuild of the initramfs and a reboot is required as far as I recall)

There are various other values possible, including negative (e.g. if a 
specific device should always have lower priority).


The same should be possible by (re-)defining the 'default' output in 
ALSA, usually with some /etc/asound.conf or ~/.asoundrc magic (a quick 
search points to the same entries you already tried), though I'm not 
sure how that will interact with PulseAudio and/or various applications 
using ALSA directly.


Hope this helps,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web