Digital Audio Capabilities in mythfrontend Grayed out

For discussion of topics specific to MythTV on linux
Post Reply
User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Wed Jul 27, 2022 9:24 pm

I have a MythTV v32 FE/BE combo working on EndeavourOS (archlinux) on a Intel NUC connected to an A/V receiver via HDMI. It works the same on Linux Mint 21(Ubuntu 22.04) My sound works in 5.1 mode using the Plasma KDE audio setting test and it works using the console command

Code: Select all

speaker-test -twav -c6
However, when I get to Mythfrontend setup -> audio and select the connected port (ALSA:hdmi:CARD=PCH,DEV=0), it will not let me select Digital Audio Capabilities. Stereo is the only choice for Speaker Configuration.

Any idea on what I missed in the setup??
Last edited by jfabernathy on Thu Jul 28, 2022 3:40 pm, edited 1 time in total.

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Thu Jul 28, 2022 3:39 pm

This is what the console looks like related to my HDMI connection when mythfrontend -v audio is run.

Code: Select all

2022-07-28 09:08:20.087530 I  ALSA: OpenDevice hdmi:CARD=PCH,DEV=0
2022-07-28 09:08:20.088230 I  AOS: Sample rate 32000 is supported
2022-07-28 09:08:20.088235 I  AOS: Sample rate 44100 is supported
2022-07-28 09:08:20.088238 I  AOS: Sample rate 48000 is supported
2022-07-28 09:08:20.088240 I  AOS: Sample rate 88200 is supported
2022-07-28 09:08:20.088243 I  AOS: Sample rate 96000 is supported
2022-07-28 09:08:20.088245 I  AOS: Sample rate 176400 is supported
2022-07-28 09:08:20.088248 I  AOS: Sample rate 192000 is supported
2022-07-28 09:08:20.088250 I  AOS: Format signed 16 bit is supported
2022-07-28 09:08:20.088251 I  AOS: Format signed 32 bit is supported
2022-07-28 09:08:20.088257 I  AOS: 2 channel(s) are supported
2022-07-28 09:08:20.088262 I  AOS: 4 channel(s) are supported
2022-07-28 09:08:20.088266 I  AOS: 6 channel(s) are supported
2022-07-28 09:08:20.088270 I  AOS: 8 channel(s) are supported
2022-07-28 09:08:20.088375 I  ALSA: Successfully retrieved ELD data
2022-07-28 09:08:20.088382 I  ELDUTILS: Detected monitor DENON-AVRHD at connection type HDMI
2022-07-28 09:08:20.088387 I  ELDUTILS: available speakers: FL/FR LFE FC RL/RR RC RLC/RRC
2022-07-28 09:08:20.088388 I  ELDUTILS: max LPCM channels = 8
2022-07-28 09:08:20.088390 I  ELDUTILS: max channels = 8
2022-07-28 09:08:20.088392 I  ELDUTILS: supported codecs = LPCM, AC3, DTS, DSD (One Bit Audio), E-AC3, DTS-HD, TrueHD
2022-07-28 09:08:20.088399 I  ELDUTILS: supports coding type LPCM: channels = 8, rates = 32000 44100 48000 96000 176400 192000, bits = 16 20 24
2022-07-28 09:08:20.088403 I  ELDUTILS: supports coding type DTS: channels = 6, rates = 44100 48000 96000 176400, max bitrate = 1536000
2022-07-28 09:08:20.088405 I  ELDUTILS: supports coding type AC3: channels = 6, rates = 32000 44100 48000, max bitrate = 640000
2022-07-28 09:08:20.088408 I  ELDUTILS: supports coding type DTS-HD: channels = 8, rates = 44100 48000 96000 176400 192000
2022-07-28 09:08:20.088410 I  ELDUTILS: supports coding type E-AC3: channels = 8, rates = 44100 48000
2022-07-28 09:08:20.088413 I  ELDUTILS: supports coding type TrueHD: channels = 8, rates = 44100 48000 96000 176400 192000
2022-07-28 09:08:20.088414 I  ELDUTILS: supports coding type DSD (One Bit Audio): channels = 6, rates = 44100
2022-07-28 09:08:20.106297 I  AOBase: Killing AudioOutputDSP
2022-07-28 09:08:20.106299 I  AOBase: m_outputSettings != m_outputSettingsDigital : 0
2022-07-28 09:08:20.106300 I  AOBase: m_outputSettingsRaw != m_outputSettings 0
2022-07-28 09:08:20.106314 I  Found ALSA:hdmi:CARD=PCH,DEV=0 (HDA Intel PCH, HDMI 0
HDMI Audio Output (DENON-AVRHD Connected to HDMI)
Device Supports Up to 2.0 (LPCM, AC3, DTS, DSD (One Bit Audio), E-AC3, DTS-HD, TrueHD))

User avatar
pgbennett
Developer
Posts: 459
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by pgbennett » Thu Jul 28, 2022 5:09 pm

ALSA:hdmi:CARD=PCH,DEV=0
You will find a bunch of other entries with different values for DEV and different values for CARD, etc. Try them all until you find one that works. Many of them will not work at all, others will only support stereo, but you should find one that is correct.

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Thu Jul 28, 2022 6:01 pm

Thanks, I found one is each category hdmi, hw, dmix, plughw which correspond to hdmi 0/1 They all work but stereo only. All list the Device Supports up to 2.0 even though it show DD and DTS capable. I have done more testing with things like Kodi with the mythtv pvr addon and also Linux players. All can play 5.1 content correctly thru the speakers. The Mythfrontend setup knows when it's got a connection to my Denon-AVRHD but on all the choices where it had that Denon AVRHD connection, it only shows the 2.0 capability and the choices were grayed out.

I also hooked my RPI 4 up to the same cable going to the Denon and it has the same issue.

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Thu Jul 28, 2022 6:17 pm

Another odd thing is I put a 5.1 test file in my Video Storage Group directory and can play that with mythfrontend as a Video instead of a Recording and that seems to play 5.1 the same a the Linux players outside of mythfrontend. So I don't know what is going on.

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Thu Jul 28, 2022 10:18 pm

More data and more confusion. First, I wanted to see if anything could work 5.1 with my Denon AVRHD. So I have a FireTV 4k stick connected to an input on my TV and the TV feeds Dolby digital back to the Denon via Optical. In that setup Leanfront and mythfrontend on the FireTV can play my recordings in 5.1.

I opened up the cabinet containing the AVR and now I can see the display all the time and I've noticed that no matter which HDMI or Optical input is selected when there is no audio output, the AVR is in Dolby Pro Logic mode. In the case of the FireTV stick It switches to Dolby Digital as the sound starts.

On the NUC PC, it also stays on Pro Logic mode until digital content starts. VLC switches to Dolby Digital when playing a HDHR stream, or a 5.1 test file and plays 5.1 correctly. At that time my AVR shows Dolby Digital.The AVR goes back to Pro Logic when the sound stops.

On the NUC PC, when trying to use mythfrontend setup, the AVR shows Pro Logic and that must be why I can't set Digital Capabilities and that's why the scan thinks it's only 2.0 capable. When I play a live or recorded TV program, it stays in Pro Logic.

The same thing sort of happens on my Mythtv backend which normally does not have a monitor connected. I connected it up via HDMI to another AVR input of the same receiver. When I look at audio setup the AVR stays in Pro Logic, but Digital Capabilities is not grayed out. It lets me select Dolby and DTS, but on Speaker config, I can only see Stereo. However, when I start playing a HD video or TV channel, the receiver switches to Dolby Digital.

IMHO, Whatever Kodi is doing to keep the AVR in Dolby Digital when it's running is what mythfrontend should do so audio setup can select digital capabilities.

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Fri Jul 29, 2022 11:14 am

This just occurred to me. The production mythtv backend I have has a database that has be brought forward for years so it's configuration data is from previous versions of mythtv. Maybe that is why it has items checked in Digital Capabilities and a fresh install can't set it up that way. Maybe I need a way to set the Audio for the way it will be when audio is playing and not when it's sitting idle?

Can we use mysql commands to set this up?

blm-ubunet
Senior
Posts: 199
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by blm-ubunet » Sat Jul 30, 2022 4:47 am

One of the most important facts is the one you failed to mention.. you are looping the audio out of the TV back to the AVR over optical TOSLink.

speaker-test can only test discrete multi-channel audio output.
AFAIK it does not support any bitstream encoded audio (DD/DTS etc).

HDMI & DP supports discrete multi-channel PCM, 2 ch PCM stereo & matrix encoded DTS/DD (using S/PDIF?).

You AVR seems to support (best audio to worst): (& missing out some of them)..
- 8 ch discrete PCM
- DTS (encoded multi-ch)
- DD AC3 (encoded multi-channel)
- stereo 2ch PCM

S/PDIF TOSlink only supports stereo PCM & encoded multi-channel DTD & DD (AC3).
TOSLink is just optical (higher jitter) version of S/PDIF.
DTS potentially has a higher maximum bitrate than DD.

I do not think any TV will encode to DD/AC3 but they will pass-thru'.
So if you send 8 ch or 6 ch 5.1 PCM discrete audio to the AVR or TV you will NOT get encoded AC3 out.. only stereo or nothing.

If you trust the audio codec decoding software in the PC then the best quality audio is 8ch discrete PCM.. but I'm not sure that is true.

So to be able to get the digital options you need to select an output codec that supports S/PDIF or HDMI with any attached device (ELD).
S/PDIF is output only so there is no ELD just assumed capability.
When trying higher data-rates over S/PDIF (for DTS or stereo 24bit PCM 96 or 192KHz) it is just try it & see if AVR lights up..

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Sat Jul 30, 2022 10:15 am

I probably was not completely clear on my AVR setup. The Samsung UHD 4K TV has 2 HDMI inputs.
1. TV HDMI-1 connected to AVR Monitor Out
2. TV HDMI-2 connected to Amazon FireTV 4k stick.

The AVR has the NUC PC HDMI connected to its DVD HDMI input.

The AVR had the Optical output of the TV connected to the Optical input #1 and the AVR is configured to have OPT#1 as names input TV Audio.

So the Optical only comes into play when the TV is playing the FireTV 4K on HDMI-2. In this case the TV shows on its audio setup that it is using bit-stream Dolby Digital and the AVR shows Dolby Digital output when playing content, but Dolby Pro Logic which not playing anything.

When the PC is playing anything including MythTV, the path is PC HDMI -> AVR DVD input and then AVR Monitor Out to TV HDMI-1. In this case, the AVR shows Dolby Pro Logic until some audio output occurs. then it switches to Dolby Digital if anything but MythTV is playing, VLC, Kodi, speaker-test, etc. all play in DD, but MythTV on my NUC PC shows Dolby Pro Logic, i.e. 2.0 stereo.

If I switch the HDMI cable from my NUC PC to my MythTV Backend PC, then the AVR switches to Dolby Digital when audio starts playing and back to Dolby Pro Logic when nothing is playing.

I think the differences are related to the fact that my Backend database is old and a carryover from older versions of MythTV and different hardware.

I think that is it were possible to manually update the MariaDB SQL database, mythconverg, I could change some setting that made the NUC PC behave like my older backend.

blm-ubunet
Senior
Posts: 199
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by blm-ubunet » Sun Jul 31, 2022 1:56 am

That explains why your ELD looks like complete audio feature set of the AVR..

But the FE audio setup rescans the audio devices each time it is run..
The new setup GUI is truly horrible compared to the original.
Maybe the audio setup screen needs to be saved & exited (back out of screen) & then reopened before seeing any digital capability change?

To be able to output DD, DTS E-AC-3 TreuHD (bit-streamed encoded audio) you have to select the audio codec (silly naming convention) that can support iec958.
On my desktop PC have to use "ALSA:iec958:CARD=MID,DEV=0" to get Digital Audio Capabilities to be enabled.

But note that MythTV tries to use the highest quality output which is NOT DD AC3 but discrete 8ch or 6ch PCM over HDMI.
Discrete 8 or 6ch PCM is the highest possible quality except for the fact the audio decoding software is not proven to match or exceed the AVR firmware. But MythTV has to decode the audio codec (software) to do this & for some audio codecs this is not possible.

The only MythTV audio config difficulty I've had was getting MythMusic to use a stereo 96KHz 24bit alsa sampler device.

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Sun Jul 31, 2022 8:59 am

I'm wondering if I could start an audio app playing some digital music file, while I run mythfrontend setup??
I'll have to try that.

blm-ubunet
Senior
Posts: 199
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by blm-ubunet » Sun Jul 31, 2022 10:34 am

MythTV opens the audio device for exclusive access & I believe it stops the pulse server if you're not using it.

You can use a custom alsa device that allows for shared dmix but this does not (simply) allow for digital pass-thru/bitstreaming.

The only way shared (dmix) system wide digital passthru' bitstreamed DD-AC3 etc can be done is if you build the alsa AC3 encoder plugin. This was possible 5 years ago, now do not know.
I believe pulse audio might also have support for an AC3 encoder plugin.
I think there was an experimental DTS encoder.
Neither of these is state of the art.

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Fri Aug 12, 2022 5:27 pm

I think I know when this grayed out problem started. I've been using the Android mythfrontend that was version 32.0-6, which was doing around March 2022. I just built the mythfrontend v32.0-59 and now I've lost the ability to have 5.1 Audio on my FireTV for mythfrontend.

So something affecting this happened between March and August, 12.

blm-ubunet
Senior
Posts: 199
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by blm-ubunet » Fri Aug 12, 2022 10:35 pm

Good find..

As workaround:
https://www.mythtv.org/wiki/Configuring_Digital_Sound

This explains using iecset & some of those obscure AES cmds (which I also used many years ago).
The alsa website likely explains them.
Sadly, the Arch wiki link (on another digital audio page) is broken.

User avatar
jfabernathy
Senior
Posts: 475
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Digital Audio Capabilities in mythfrontend Grayed out

Post by jfabernathy » Fri Aug 12, 2022 10:50 pm

I'm going back in time and finding the commit where this got broken. When we find it, maybe a smart person can fix it.

Post Reply