How to get digital audio through HDMI?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
sydbat
Level 3
Level 3
Posts: 130
Joined: Fri Mar 05, 2021 12:28 pm
Location: Calgary, AB

How to get digital audio through HDMI?

Post by sydbat »

As the title asks, how does one get digital audio through HDMI?

I got a new 4K TV and hooked the HTPC into it with an HDMI cable, expecting that I would be able to get the 5.1 audio out when connected back to the receiver with the TOSLink. Unfortunately, I only get stereo sound out from the TV because the HDMI is only sending a PCM signal to the TV. Everything else I hook into the TV with HDMI comes out 5.1 into my receiver via the TOSLink. Also, with my old TV I had to go through the receiver then to the TV, so this problem did not present itself. With that setup, I got beautiful 5.1 sound through the HDMI cable. But my receiver is older and only provides 1080p 60hz signal allowance, and does not have any type of ARC capability.

My temporary solution is an HDMI splitter, with one HDMI cable going to the TV and the other going to the receiver. However, that only provides 4K 60hz and the TV is capable of 4K 120hz. As I am getting a new graphics card with HDMI 2.1 (as the TV has 2.1 inputs), I would really like to run one HDMI into the TV, send the audio in a fully digital state through that HDMI connection, and be able to hear 5.1 digital surround sound through my receiver via the TOSLink.

My new graphics card will be an RTX 3080. My current card is a GTX 1050 Ti.

My System:

Code: Select all

System:    Kernel: 5.14.0-1034-oem x86_64 bits: 64 compiler: N/A Desktop: MATE 1.26.0 wm: marco 
           dm: LightDM Distro: Linux Mint 20.3 Una base: Ubuntu 20.04 focal 
Machine:   Type: Desktop Mobo: ASUSTeK model: PRIME B450M-A v: Rev X.0x serial: <filter> 
           UEFI: American Megatrends v: 3604 date: 02/25/2022 
Battery:   Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard serial: <filter> 
           charge: 55% (should be ignored) status: Discharging 
CPU:       Topology: 6-Core model: AMD Ryzen 5 3600X bits: 64 type: MT MCP arch: Zen 
           L2 cache: 3072 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 91205 
           Speed: 2805 MHz min/max: 2200/3800 MHz Core speeds (MHz): 1: 2168 2: 1952 3: 2333 
           4: 4091 5: 2138 6: 2217 7: 2630 8: 4186 9: 2800 10: 2105 11: 1916 12: 2177 
Graphics:  Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] vendor: eVga.com. driver: nvidia 
           v: 510.60.02 bus ID: 09:00.0 chip ID: 10de:1c82 
           Display: x11 server: X.Org 1.20.13 driver: nvidia compositor: compton 
           resolution: 3840x2160~60Hz 
           OpenGL: renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 510.60.02 
           direct render: Yes 
Audio:     Device-1: NVIDIA GP107GL High Definition Audio vendor: eVga.com. driver: snd_hda_intel 
           v: kernel bus ID: 09:00.1 chip ID: 10de:0fb9 
           Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel 
           bus ID: 0b:00.4 chip ID: 1022:1487 
           Sound Server: ALSA v: k5.14.0-1034-oem 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK 
           driver: r8169 v: kernel port: f000 bus ID: 08:00.0 chip ID: 10ec:8168 
           IF: enp8s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 3.64 TiB used: 1.93 TiB (53.2%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO Plus 1TB size: 931.51 GiB 
           speed: 31.6 Gb/s lanes: 4 serial: <filter> 
           ID-2: /dev/sda vendor: Western Digital model: WD10EFRX-68PJCN0 size: 931.51 GiB 
           speed: 6.0 Gb/s serial: <filter> 
           ID-3: /dev/sdb vendor: Seagate model: ST2000DM001-9YN164 size: 1.82 TiB speed: 6.0 Gb/s 
           serial: <filter> 
Partition: ID-1: / size: 45.58 GiB used: 28.13 GiB (61.7%) fs: ext4 dev: /dev/nvme0n1p2 
           ID-2: /home size: 869.60 GiB used: 499.83 GiB (57.5%) fs: ext4 dev: /dev/nvme0n1p3 
USB:       Hub: 1-0:1 info: Full speed (or root) Hub ports: 10 rev: 2.0 chip ID: 1d6b:0002 
           Hub: 1-8:2 info: Genesys Logic Hub ports: 4 rev: 2.0 chip ID: 05e3:0608 
           Hub: 1-8.4:3 info: Terminus Hub ports: 4 rev: 2.0 chip ID: 1a40:0101 
           Device-1: 1-8.4.2:4 info: Logitech Unifying Receiver type: Keyboard,Mouse 
           driver: logitech-djreceiver,usbhid rev: 2.0 chip ID: 046d:c534 
           Device-2: 1-8.4.3:5 info: Broadcom BCM20702A0 Bluetooth 4.0 type: <vendor specific> 
           driver: btusb rev: 2.0 chip ID: 0a5c:21e8 
           Hub: 2-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 chip ID: 1d6b:0003 
           Hub: 3-0:1 info: Full speed (or root) Hub ports: 4 rev: 2.0 chip ID: 1d6b:0002 
           Hub: 4-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 chip ID: 1d6b:0003 
Sensors:   System Temperatures: cpu: 44.4 C mobo: N/A gpu: nvidia temp: 37 C 
           Fan Speeds (RPM): N/A gpu: nvidia fan: 30% 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/caddy-stable.list 
           1: deb https: //dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
           2: deb-src https: //dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
           Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
           1: deb [arch=amd64] http: //dl.google.com/linux/chrome/deb/ stable main
           Active apt repos in: /etc/apt/sources.list.d/google-earth-pro.list 
           1: deb [arch=amd64] http: //dl.google.com/linux/earth/deb/ stable main
           Active apt repos in: /etc/apt/sources.list.d/graphics-drivers-ppa-focal.list 
           1: deb http: //ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/jellyfin.list 
           1: deb [arch=amd64] https: //repo.jellyfin.org/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/kdenlive-kdenlive-stable-focal.list 
           1: deb http: //ppa.launchpad.net/kdenlive/kdenlive-stable/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/m-grant-prg-utils-focal.list 
           1: deb http: //ppa.launchpad.net/m-grant-prg/utils/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/mc3man-mpv-tests-focal.list 
           1: deb http: //ppa.launchpad.net/mc3man/mpv-tests/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/mixxx-mixxx-focal.list 
           1: deb http: //ppa.launchpad.net/mixxx/mixxx/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http: //packages.linuxmint.com una main upstream import backport #id:linuxmint_main
           2: deb http: //archive.ubuntu.com/ubuntu focal main restricted universe multiverse
           3: deb http: //archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
           4: deb http: //archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
           5: deb http: //security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
           6: deb http: //archive.canonical.com/ubuntu/ focal partner
           Active apt repos in: /etc/apt/sources.list.d/papirus-papirus-focal.list 
           1: deb http: //ppa.launchpad.net/papirus/papirus/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/teamviewer.list 
           1: deb https: //linux.teamviewer.com/deb stable main
Info:      Processes: 318 Uptime: 1h 10m Memory: 62.72 GiB used: 2.35 GiB (3.7%) Init: systemd 
           v: 245 runlevel: 5 Compilers: gcc: 9.4.0 alt: 9 Client: Unknown python3.8 client 
           inxi: 3.0.38 
Any ideas? Is it even possible?

Thanks in advance.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
This is a signature. It is original.
User avatar
rossdv8
Level 7
Level 7
Posts: 1736
Joined: Wed Apr 23, 2014 4:48 am
Location: Within 2,000 kilometres of Alice Springs, Australia
Contact:

Re: How to get digital audio through HDMI?

Post by rossdv8 »

I suspect it 'should' be possible, although I am using xfce, and some things are different. For example, Mint Xfce uses PulseAudio (and ALSA) for audio output.

In my case, I have the PulseAudio Volume Control (pavucontrol) installed and that makes setting sound up a bit easier (for me at least).

If I open PulseAudio Volume Control, and look at the Configuration Tab, I can choose some options, including:
My DAC Profile that sends sound to a cheap DAC that probably doesn;t do much - I just use it to make a surround system.

and:
My Built-in Audio Profile.

Getting rid of the x in the [ ] box next to the DACdevice profile then
Clicking to put a select mark [x] in the box next to the Built-in-Audio dropdown menu I can choose (among others):
Digital Stereo (HDMI) Output

I would expect that would output a Digital signal 'out' of my computer and into the TV, via HDMI.

I do know that it shuts off the sound form my Surround setup connected to the DAC, and sends the audio through my 4K TV.

Bow, I also know that if I want surround audio out of the TV I have to use a fibre connection, or one particular HDMI port that sends a signal that can provide surrouund (the other HDMI ports do not do this.

Sorry for the rambling answer, but I know your system is NOT the same as mine.
The simple answer is:
Select Digital HDMI 'Out' in your computer . . :-)
I've simply drivelled on about how it works on 'my' system . .
Current main OS: MInt 21.3 with KDE Plasma 5.27 (using Compiz as WM) - Kernel: 6.5.0-15 on Lenovo m900 Tiny, i5-6400T (intel HD 530 graphics) 16GB RAM.
Sharks usually only attack you if you are wet
User avatar
sydbat
Level 3
Level 3
Posts: 130
Joined: Fri Mar 05, 2021 12:28 pm
Location: Calgary, AB

Re: How to get digital audio through HDMI?

Post by sydbat »

@rossdv8 - thanks for the suggestions.

I have also been looking through a LOT of other forums and have found that they all give the same advice, but with no success. One post on the AskUbuntu forum made mention that optical audio just cannot handle more than 2 channels of uncompressed audio, even when the audio is supposed to be digital (as stated in pav control). All changing to digital stereo, and enabling all the pass through stuff does, is give me left/right/centre to my receiver. This post also mentioned that unless the audio is processed either with DTS or Dolby, there is no way to get 5.1 sound via an optical cable. Which explains why I get 5.1 through the TV apps.

I guess I will be looking to upgrade the home theatre receiver to one that has ARC or eARC so it is HDMI all the way. In the meantime I will continue to use the HDMI splitter to fake it.

Thanks for the help.
This is a signature. It is original.
User avatar
rossdv8
Level 7
Level 7
Posts: 1736
Joined: Wed Apr 23, 2014 4:48 am
Location: Within 2,000 kilometres of Alice Springs, Australia
Contact:

Re: How to get digital audio through HDMI?

Post by rossdv8 »

Have you tried installing libasound-extras ?
sudo apt install libasound2-plugins-extra

Try that. Not sure if it needs a reboot to take effect, and see if your surround shows up properly.
If it is already installed termina will tell you it's already the latest, otherwise it will ask you to confirm Y/n

Might not help, but unlikely to do any harm.

E D I T
This might be worth reading. Obviously it refers to Windows, but most of the things it refers to should likely show up in the settings in pavucontrol etch if you have both the appropriate hardware and Linuxy bits installed.

https://www.maketecheasier.com/use-the- ... windows10/

Obviously Windows but worth reading anyway..

And this:
https://www.cnet.com/tech/home-entertai ... on-to-use/
Current main OS: MInt 21.3 with KDE Plasma 5.27 (using Compiz as WM) - Kernel: 6.5.0-15 on Lenovo m900 Tiny, i5-6400T (intel HD 530 graphics) 16GB RAM.
Sharks usually only attack you if you are wet
User avatar
sydbat
Level 3
Level 3
Posts: 130
Joined: Fri Mar 05, 2021 12:28 pm
Location: Calgary, AB

Re: How to get digital audio through HDMI?

Post by sydbat »

Thanks for the suggestions. Turns out I do have the libasound-extras package installed. It is the most current.

As for the articles, unfortunately they were not helpful. If I had and optical out on my motherboard, I would be using that for sound output. On previous builds, the motherboards had optical or coax outputs as well, but his board only has basic analog outs. Hence the reason for the HDMI. Also, if it were not for the new TV being 4k 120hz, I wouldn't be concerned. The old TV was 1080 60hz, which my receiver is limited to (because it is old). Eventually I will upgrade to a 4k 120hz receiver and just use the eArc connection. In the meantime, I will use the splitter, unless I can find a 4k 120hz splitter, but I don't think they exist yet.

Again, thank you for all your help @rossdv8!

Finally, I did get my (expensive) 3080 card. HOLY FPS BATMAN! However, still only outputs stereo via HDMI to the TV then the receiver through optical. Sigh. HDMI splitter to receiver gives fantastic 5.1 sound.
This is a signature. It is original.
User avatar
rossdv8
Level 7
Level 7
Posts: 1736
Joined: Wed Apr 23, 2014 4:48 am
Location: Within 2,000 kilometres of Alice Springs, Australia
Contact:

Re: How to get digital audio through HDMI?

Post by rossdv8 »

E D I T - I wrote a long winded (like everything I do) reply earlier, then edited it to the one below because I was not certain that what I am doing is in fact correct. I've since found the sources I originally used when deciding what to use for Audio Out, but they involve wading through a lot of technical carp and this article more or less sums it up.
So I went to the setup I wrote about earlier below the *** here.
But here's a summary and a link that more or less explains why I went USB rather than HDMI or Optical for surround sound:
Summary

USB Audio Class 2.0 takes advantage of High Speed USB 2.0, enabling low latency transfer of audio between PC and a connected audio device. The high throughput of High Speed USB 2.0 can be utilised to deliver many audio channels, and with high audio quality. The USB Audio Class standard caters for a wide range of devices, from complex mixing desks with many channels, multiple clock sources and complex controls, to surround sound systems, PC speakers and microphones.
https://www.edn.com/fundamentals-of-usb-audio/

*** and here's my earlier edited (for brevity) reply, that included most of the information in the link above...

My system is using the IEC958 Digital Audio output over USB from my computer into a cheap Digital Audio Converter, thence to a 5.1 configuration Surround via 'wires' to the various speakers including sub.
While I haven't found any real information saying the USB can carry surround audio - the system sounds excellent. Better than my stand alone HiFi systems used to, although that probably says more about the budget I used to have and the lower quality of my gear then compared to cheap stuff I have plugged into the computer.

Anyway, while I was researching your problem I came across a lot of articles. One of which was this, and while it is written for Windows, it is 'interesting'.
https://www.techradar.com/au/news/audio ... nd-1052230

So basically, it 'might' be worth seeing if there's a way to
input audio to your surround system though USB.
It makes no difference whether it is USB 2 or 3, they can both handle 6 channel audio.

And pavucontrol in PulseAudio can handle that as long as you find the bit in the Configuration Tab that says something like:
Analog Surround 5.1 Output + Digital Stereo (IEC598) Input
or whatever matches your hardware :)
Current main OS: MInt 21.3 with KDE Plasma 5.27 (using Compiz as WM) - Kernel: 6.5.0-15 on Lenovo m900 Tiny, i5-6400T (intel HD 530 graphics) 16GB RAM.
Sharks usually only attack you if you are wet
User avatar
sydbat
Level 3
Level 3
Posts: 130
Joined: Fri Mar 05, 2021 12:28 pm
Location: Calgary, AB

Re: How to get digital audio through HDMI?

Post by sydbat »

Thank you for the extra info rossdv8! I had not known about usb audio. I will look into it as a possible cost saver.

I have done some more research as well, and found that TV audio out via optical is just garbage. On every TV. Because of the massive limitations with optical. HDMI through ARC/eARC, on the other hand, does handle 5.1/7.1 audio properly, at least according to the majority of articles. So, if I want to drop another grand for a new receiver that has eARC, my problems are solved. Since I had saved the money over a period of time for my new graphics card, I don't think this option is currently viable, but I will likely start setting aside the funds for a new receiver in the future.

All that said, I also stumbled upon another possibility in my search - an HDMI audio extractor. With this, it is possible to hook things into the TV, then use the eARC port to send the signal to the extractor, which then connects to a regular HDMI in on old receivers. While less expensive than buying a whole new receiver, these things are still a couple/few hundred bucks.

I'll look into the USB thing though. Thanks for that tip!
This is a signature. It is original.
User avatar
rossdv8
Level 7
Level 7
Posts: 1736
Joined: Wed Apr 23, 2014 4:48 am
Location: Within 2,000 kilometres of Alice Springs, Australia
Contact:

Re: How to get digital audio through HDMI?

Post by rossdv8 »

I'm in AUS, so our offerings are a little different, however if you search Amazon in your country for eARC HDMI converter (from your Avatar pic, I'm sure you can work out which country :lol: ) - and then do some reading to find out if it will actually achieve anything, some of the offerings might be useful.

Here's the USA site result:
https://www.amazon.com/s?k=eARC+HDMI+co ... _sb_noss_1

I haven't looked into the pros and cons, or even if these converters work (nor in which directiton), but I'm sure since you know the specs of your gear you can do some giggling or DuckDuckGoing . .

E D I T
I did some Ducking and eventually found some advice on using ARC HDMI for high quality audio in PC gaming, as well as a few general Links about it.
The most relevant is probably:
https://yourgamestips.com/faq/how-do-i- ... arc-on-pc/

These are just a few for general info that aren't PC specific, although one thing to try that sounds interesting, and might even solve your problem is to use a TV that has an ARC HDMI socket as your Computer Monitor.
If my guess is accurate, you would send your HDMI signal from the Computer to the TV, just as you would to any normal HDMI Monitor.
Then plug a cable from the ARC HDMI socket on the TV, to your HDMI input on your audio receiver.
Then Output from that to your Surround System as normal.

A TV 'should' receive the signal from the HDMI cable out of the Computer, extract the 5.1 or whatever Audio signal from the Video of the HDMI signal, then Send that High Def signal out through the ARC HDMI socket.

Sounds easy, 'logical' even - but I might be missing something.
If it was me, I would trundle on down to a decent 'knowledgeable' HiFi shop and ask them, or even a respected TV specialist, and run the idea past them.
eARC is ust a later specification of ARC apparently.

For now, here are a couple of general articles. .

https://hdguru.com/hd-fury-unveils-worl ... c-adapter/
https://www.cnet.com/tech/home-entertai ... beginners/

I'll be interested to see whether any of this works. Thanks for keeping me updated. .
Current main OS: MInt 21.3 with KDE Plasma 5.27 (using Compiz as WM) - Kernel: 6.5.0-15 on Lenovo m900 Tiny, i5-6400T (intel HD 530 graphics) 16GB RAM.
Sharks usually only attack you if you are wet
Locked

Return to “Sound”