Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Need help to send sound to TV through HDMI
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 601
Location: Almeria, Spain

PostPosted: Sun Mar 22, 2020 12:30 pm    Post subject: [SOLVED] Need help to send sound to TV through HDMI Reply with quote

Hi and thanks for reading this!

First of all, I hope you're all OK and safe from COVID-19.

I'd like to hear sound through the TV speakers whenever I plug my desktop box to the TV through HDMI to use the TV as a second monitor, but it doesn't work: I keep hearing everything from the cheap speakers attached to the computer with a regular jack cable.

From what I've read, I guess I need a ~/.asoundrc or a /etc/asound.conf file with the correct config but currently none of them exist on my system. However, what worries me the most is that, in alsamixer, I can't unmute the hdmi card channels. I just get six S/PDIF entries with a 00 value that I can't pop up.

Some outputs:
Code:
# lspci | grep -i audio
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]

# aplay --list-devices
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

# cat /sys/class/sound/card*/id
Generic
HDMI

# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Generic
    HD-Audio Generic, ALC892 Analog
    Default Audio Device
sysdefault:CARD=Generic
    HD-Audio Generic, ALC892 Analog
    Default Audio Device
front:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Analog
    Front speakers
surround21:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Digital
    IEC958 (S/PDIF) Digital Audio Output
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


What should I do/check? Please note I know next to nothing regarding multimedia sound so, please, don't take for granted I know the jargon :)

Thansk in advance.


Last edited by urcindalo on Wed Mar 25, 2020 11:09 am; edited 1 time in total
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1453

PostPosted: Sun Mar 22, 2020 2:04 pm    Post subject: Reply with quote

urcindalo,

first of all the most important: You absolutely need an hdmi2 to hdmi2 cable. (Ideally with the gold plugs). Not too long. 10m or 8m can cause problems.

"... but currently none of them exist on my system." That means you use pulseaudio? If so, have a look at this article.
https://itsfoss.com/how-to-fix-no-sound-through-hdmi-in-external-monitor-in-ubuntu/
The solution is similar for Gentoo.

Good Luck
Ma
_________________
Thank you for your attention, interest and support.
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7465
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 22, 2020 2:27 pm    Post subject: Reply with quote

Quote:
I just get six S/PDIF entries with a 00 value that I can't pop up.


00 means enabled, hit M to mute. These are digital passthru outputs, there is no processing of any kind. Means there is also no volume control, just on/off.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 601
Location: Almeria, Spain

PostPosted: Sun Mar 22, 2020 2:55 pm    Post subject: Reply with quote

Marlo wrote:
first of all the most important: You absolutely need an hdmi2 to hdmi2 cable. (Ideally with the gold plugs). Not too long. 10m or 8m can cause problems.

"... but currently none of them exist on my system." That means you use pulseaudio? If so, have a look at this article.
https://itsfoss.com/how-to-fix-no-sound-through-hdmi-in-external-monitor-in-ubuntu/
The solution is similar for Gentoo.

Good Luck
Ma


Thanks for your help.

No, no pulseaudio whatsoever. I use systemd instead of openrc, in that makes any difference regarding my lack of ~/.asoundrc or /etc/asound.conf

When I created a .asoundrc with the content indicated in https://wiki.gentoo.org/wiki/ALSA#S.2FPDIF_or_HDMI_.asoundrc, but changing "card 0" to "card 1" in my case, and then exiting/re-entering into my KDE user account, I also lost the ability to send sound to the regular jack output. So, I deduce the reading of this file works. I just need a proper config.

Also, when in KMix I try to select the mixer to "HDA ATI HDMI", I get no channel to choose from. Instead, under HDA-Audio Generic I can see a lot of options like Master, Headphone, PCM...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44896
Location: 56N 3W

PostPosted: Sun Mar 22, 2020 3:18 pm    Post subject: Reply with quote

urcindalo,

You have two sound cards, known to alsa as card0 and card1.
If you don't tell alsa which card to use, it will use card0

For you, card0 is your on board card.

There ale at least two ways to use the other sound card. By doing the swap at boot or with a ~/.asoundrc or a /etc/asound.conf file. They do the same thing. The former is per user, the latter is system wide.
Both methods make the change for all applications. That OK if that what you want.

Several multimedia apps let you configure the sound output at run time, e.g. Kodi, vlc and mplager that I know of.

You don't need HDMI-2 cables. They are for 4k at 60Hz over HDMI. HDMI was never designed for that but HDMI-2 is an attempt to provide more bandwidth over the same transmission channel.
HDMI being digital, either works or it doesn't. Gold connectors are vastly overrated. What's important is that you avoid mixing metals on the connector pins.
Tin (silver) on silver, or gold on gold works reliably for many year. A mix of tin and gold works for about 18 months.
The connector pins matter a great deal and they are hard to see. Gold shells are just bling.

Digital sound is normally 8 channels multiplexed together. Doing volume control in the digital domain is hard, so nobody does.
Hence, no sliders. The [OO] means Open, as opposed to [MM] for muted.

Try VLC. It will use card0 until you fiddle with the audio settings menu.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 601
Location: Almeria, Spain

PostPosted: Sun Mar 22, 2020 3:51 pm    Post subject: Reply with quote

NeddySeagoon wrote:
There ale at least two ways to use the other sound card. By doing the swap at boot or with a ~/.asoundrc or a /etc/asound.conf file. They do the same thing. The former is per user, the latter is system wide.
Both methods make the change for all applications. That OK if that what you want.


Thanks for your help, NeddySeagoon.
My aim is to be able to watch Amazon Prime Video on my TV when reproduced through a Firefox or Chrome window on my box.
So, what is my best bet? I don't mind activating/deactivating config files when needed, so maybe the ~/.asoundrc route is more convenient? Since I really don't know, I will do as you tell me :)
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7465
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 22, 2020 4:24 pm    Post subject: Reply with quote

Chrome/Chromium has '--alsa-output-device=<yourdevice>' option. You do not need to change your system default for this. Write a wrapper to start your Chrome with desired option(s).
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44896
Location: 56N 3W

PostPosted: Sun Mar 22, 2020 5:36 pm    Post subject: Reply with quote

urcindalo,

What Jaglover said.

The wrapper will apply to a singe app. You can play Chrome audio through your TV and use your speakers for another audio stream at the same time.

If you start Chrome with the wrapper, it will use your TV. If you start it without, it will use the speakers.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
APolozov
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2006
Posts: 146
Location: Voronezh, Russia

PostPosted: Sun Mar 22, 2020 5:44 pm    Post subject: Reply with quote

I use for duplicate sound (all chanels to stereo) to HDMI and onboard HDA this config:
pan@pan-homlin / $ cat /etc/asound.conf
Code:

pcm.!default {
    type plug
    slave {
        pcm {
            type route
            slave {
                pcm {
                    type multi;
                    slaves.a.pcm {
                        type dmix
                        ipc_key 4855689
                        ipc_perm 0666
                        slave {
                            channels 2
                            pcm {
                                #Nvidia HDMI
                                format s32_le
                                rate 48000
                                type hw
                                card 1
                                device 7
                            }
                            period_time 0
                            period_size 1024
                            buffer_size 8192
                        }
                     }
                     slaves.b.pcm{
                        type dmix
                        ipc_key 2589455
                        ipc_perm 0666
                        slave {
                            channels 2
                            pcm {
                                #Intel HDA
                                format s32_le
                                rate 48000
                                type hw
                                card 0
                                device 0
                           }
                        period_time 0
                        period_size 1024
                        buffer_size 8192
                        }
                     }
                     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;
        }
    }
}

_________________
Excuse my bad English, I only study it.

I also connected to: velo36.ru openstreetmap.org
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6332

PostPosted: Sun Mar 22, 2020 6:02 pm    Post subject: Reply with quote

Your HDMI output has six subdevices. Only one of those is your TV.

It can autodetect which one's plugged in, but that requires software you refuse to run, so you'll have to use trial and error to figure out the correct values for asoundrc. It's assumed you can figure it out from here.
Back to top
View user's profile Send private message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 601
Location: Almeria, Spain

PostPosted: Sun Mar 22, 2020 6:14 pm    Post subject: Reply with quote

Jaglover wrote:
Chrome/Chromium has '--alsa-output-device=<yourdevice>' option. You do not need to change your system default for this. Write a wrapper to start your Chrome with desired option(s).


Thanks. I tried to adapt several <yourdevice> syntaxes I googled, to no avail.
Any suggestion in my case?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7465
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 22, 2020 7:08 pm    Post subject: Reply with quote

Don't know. I have a TV hooked up as third screen for using with Kodi only. However, now I tried
Code:
chromium --alsa-output-device=hdmi:CARD=PCH,DEV=1

and it definitely worked. But you have to figure out which is correct output for you.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 601
Location: Almeria, Spain

PostPosted: Mon Mar 23, 2020 12:36 pm    Post subject: Reply with quote

Thank you all for your suggestions. I must say I tried *all* of them.

I finally solved it by activating the pulseadio USE flag for Plasma. It isn't that I refused to have pulseaudio installed, as I think Ant P. thought, but that I never activated the flag because my sound needs were pretty basic and my pair of cheap speakers have been working flawlessly without further help.

Now, after re-emerging Plasma, I got a new "Audio" panel in Settings and a new volume control icon in the system tray. I also closed the old KMix icon in it.
In the Audio panel I can select which channel I want to output sound to, even on a per-application basis. Very nice.

Again, thank you very much to you all. You were all very kind, I learnt a lot in the process and the problem was solved.

Please, take good care of you and your families in these difficult times.
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1388

PostPosted: Wed Mar 25, 2020 3:47 am    Post subject: Reply with quote

This is what I have found also, I have noticed pulseaudio does really well with firefox and surround sound.
Gentoo probably needs to make a sticky about pulseaudio.
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1453

PostPosted: Wed Mar 25, 2020 7:35 am    Post subject: Reply with quote

turtles wrote:

Gentoo probably needs to make a sticky about pulseaudio.


Ohhhh no
Pulseaudio comes from Mr. Lennart and he is like MAH

Sorry, this is just my social distance frustration.
_________________
Thank you for your attention, interest and support.
------------------------------------------------------------------
http://radio.garden/


Last edited by Marlo on Wed Mar 25, 2020 5:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
bandreabis
Advocate
Advocate


Joined: 18 Feb 2005
Posts: 2428
Location: イタリアのロディで

PostPosted: Wed Mar 25, 2020 2:44 pm    Post subject: Re: [SOLVED] Need help to send sound to TV through HDMI Reply with quote

urcindalo wrote:
Hi and thanks for reading this!

First of all, I hope you're all OK and safe from COVID-19.


<3
_________________
Il numero di post non fa di me un esperto! Anzi!
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7465
Location: Saint Amant, Acadiana

PostPosted: Wed Mar 25, 2020 5:37 pm    Post subject: Reply with quote

Marlo wrote:
turtles wrote:

Gentoo probably needs to make a sticky about pulseaudio.


Ohhhh no
Pulseaudio comes from Mr. Lennart and he is like MHA

Sorry, this is just my social distance frustration.


If PulseAudio was merely ALSA configuration helper which does its job and then terminates then it would be great. I remember when CPU's were weaker then PA put noticeable stress on CPU. In any case, I do not want resident programs which do nothing useful.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1388

PostPosted: Thu Mar 26, 2020 2:49 am    Post subject: Reply with quote

Marlo wrote:
turtles wrote:

Gentoo probably needs to make a sticky about pulseaudio.


Ohhhh no
Pulseaudio comes from Mr. Lennart and he is like MAH

Sorry, this is just my social distance frustration.


Marlo thats all good and actually preferred for me, I am a big fan of an ALSA only system.
I'll enlist you in the crusade to fix this bug with me:
https://bugzilla.mozilla.org/show_bug.cgi?id=1345661

urcindalo did you try running
Code:
alsamixer
and looking that the output levels?
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 601
Location: Almeria, Spain

PostPosted: Thu Mar 26, 2020 10:39 am    Post subject: Reply with quote

turtles wrote:
urcindalo did you try running
Code:
alsamixer
and looking that the output levels?


Yes, that was the first check I did. Take a look at my first entries in this thread :)
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1388

PostPosted: Sat Mar 28, 2020 5:06 am    Post subject: Reply with quote

Oh yeah, sorry
also check out
Code:
media-sound/pulsemixer

That helped me allot with my transition to using pulseaudio.
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum