Opened 5 years ago

Closed 5 years ago

#12193 closed Bug Report - General (Fixed)

OSD & Audio Channels do not change when audio switches from 2.0 to 5.1

Reported by: JohnLBergqvist@… Owned by: JYA
Priority: major Milestone: unknown
Component: MythTV - Audio Output Version: 0.27-fixes
Severity: medium Keywords: osd, audio, freesat, surround, 5.1, 2.0, stereo
Cc: Ticket locked: yes

Description

Whenever (as is frequently the case in UK systems such as Freesat (DVB-S) and Freeview (DVB-T)) the audio stream of a program changes from stereo to 5.1 surround sound, the OSD and the actual audio itself does not change to accomodate this, which can mean that if a recording begins shortly before the 5.1 program airs (when the audio is still in stereo), the audio change never occurs and the sound for the whole of the recording is in stereo.

This is also the case during Live TV as well, whereby if one watches the start of a 5.1 program, the audio does not change from stereo, yet if one immediately exits live tv then enters again on the same channel, the program is instantly in 5.1 surround sound. When a program changes from 5.1 to stereo (in live tv) the surround channels go silent as expected, yet the OSD still shows 5.1.

XBMC (when showing Live TV from the myth backend) is able to successfully transition between stereo and 5.1 and back again without issue (both it's OSD and the actual audio updating), yet this is not the case when watching recordings.

Change History (14)

comment:1 Changed 5 years ago by JYA

Status: newinfoneeded_new

Please provide a short sample where this change doesn't occur and specify what your audio settings are: audio device, if bit steaming is enabled, up mixer etc.

Changing channel detection is part of my regression tests and I have several samples testing all AC3 channel change type. And they all work just fine.

If bit streaming, and up mixer disabled there's nothing to change audio wise. As far as myth is concerned it's all stereo (AC3 is carried over a stereo PCM regardless of the number of channels) and it would be up to your amplifier to detect the change. Nothing we can do there.

comment:2 in reply to:  1 ; Changed 5 years ago by JohnLBergqvist@…

I'll try and upload a sample tomorrow. My audio device is an HDMI port (ALSA) on my graphics card going to stereo speakers on a TV, without any upmixing. Unsure whether bit-streaming is enabled, how would I check that? Also if it's my amplifier that detects the change, why does it detect it every time on the XBMC frontend (which is playing the same LiveTV file through the mythbackend), but not in MythFrontend? Unless it's simply a flag in the audio which MythTV isn't looking for? (or doesn't look again after playback has started)

Replying to jyavenard:

Please provide a short sample where this change doesn't occur and specify what your audio settings are: audio device, if bit steaming is enabled, up mixer etc.

Changing channel detection is part of my regression tests and I have several samples testing all AC3 channel change type. And they all work just fine.

If bit streaming, and up mixer disabled there's nothing to change audio wise. As far as myth is concerned it's all stereo (AC3 is carried over a stereo PCM regardless of the number of channels) and it would be up to your amplifier to detect the change. Nothing we can do there.

comment:3 Changed 5 years ago by JohnLBergqvist@…

Here's a link to a sample: http://mikahaksb02.srv.sn/Test.mpg The 5.1 should kick in (In terms of what the receiver is being told to transmit in) at the start of the program (Tennis from Wimbledon, although the 5.1 channels itself may not be used until it switches to shots from the tennis court.

comment:4 in reply to:  2 ; Changed 5 years ago by JYA

Resolution: Works for me
Status: infoneeded_newclosed

Replying to JohnLBergqvist@…:

I'll try and upload a sample tomorrow. My audio device is an HDMI port (ALSA) on my graphics card going to stereo speakers on a TV, without any upmixing. Unsure whether bit-streaming is enabled, how would I check that? Also if it's my amplifier that detects the change, why does it detect it every time on the XBMC frontend (which is playing the same LiveTV file through the mythbackend), but not in MythFrontend? Unless it's simply a flag in the audio which MythTV isn't looking for? (or doesn't look again after playback has started)

Because we aren't XBMC? Believe it or not, our Audio Framework is far more advanced in what it can handle and how it detects the device connected. And the behaviour is set to ensure you get the highest audio quality whatever the circumstances.

If you are connected via HDMI to your TV and your TV is stereo only (usually, most are); all you can output is stereo. You do not want to output 5.1. Most TV do not downmix the audio from 5.1 down to stereo, they only play left and right. This is not what you want.

At best your TV can handle stereo, and if you check the log you would see that myth retrieved that information over ELD on the hdmi connection that Stereo PCM is the best available. You can see those changes starting mythfrontend with:

mythfrontend -v audio --loglevel=debug

So myth configure itself as stereo and output stereo. When the stream change from stereo to 5.1, the 5.1 signal is downmixed to stereo and is output that way.

This is what the OSD report. If you want to see the original audio signal settings, go into Menu -> Playback -> Playback Data. Top right corner would show the codec used and the number of channels.

If you want myth to output 5.1, simply connect a device that can handle 5.1. Note that you can override this behaviour in the audio settings. Manually enter the audio device to use, if it's a custom device you can override the maximum amount of channels you can use

That sample is way too big, I only need a few second worth, when the change actually occurs.

If you do think that is wrong, read the ticket how to on how to submit a ticket and what to provide include the output of mythfrontend --version

and the unedited log of mythfrontend started with -v audio,playback --loglevel=debug

comment:5 in reply to:  4 Changed 5 years ago by JohnLBergqvist@…

Replying to jyavenard:

Replying to JohnLBergqvist@…:

I'll try and upload a sample tomorrow. My audio device is an HDMI port (ALSA) on my graphics card going to stereo speakers on a TV, without any upmixing. Unsure whether bit-streaming is enabled, how would I check that? Also if it's my amplifier that detects the change, why does it detect it every time on the XBMC frontend (which is playing the same LiveTV file through the mythbackend), but not in MythFrontend? Unless it's simply a flag in the audio which MythTV isn't looking for? (or doesn't look again after playback has started)

Because we aren't XBMC? Believe it or not, our Audio Framework is far more advanced in what it can handle and how it detects the device connected. And the behaviour is set to ensure you get the highest audio quality whatever the circumstances.

If you are connected via HDMI to your TV and your TV is stereo only (usually, most are); all you can output is stereo. You do not want to output 5.1. Most TV do not downmix the audio from 5.1 down to stereo, they only play left and right. This is not what you want.

At best your TV can handle stereo, and if you check the log you would see that myth retrieved that information over ELD on the hdmi connection that Stereo PCM is the best available. You can see those changes starting mythfrontend with:

mythfrontend -v audio --loglevel=debug

So myth configure itself as stereo and output stereo. When the stream change from stereo to 5.1, the 5.1 signal is downmixed to stereo and is output that way.

This is what the OSD report. If you want to see the original audio signal settings, go into Menu -> Playback -> Playback Data. Top right corner would show the codec used and the number of channels.

If you want myth to output 5.1, simply connect a device that can handle 5.1. Note that you can override this behaviour in the audio settings. Manually enter the audio device to use, if it's a custom device you can override the maximum amount of channels you can use

That sample is way too big, I only need a few second worth, when the change actually occurs.

If you do think that is wrong, read the ticket how to on how to submit a ticket and what to provide include the output of mythfrontend --version

and the unedited log of mythfrontend started with -v audio,playback --loglevel=debug

But if this is the case, how come when I start watching (via the HDMI port) a program that's already in 5.1, the OSD and the channels stay as 5.1...?

Also although I usually watch a program via Stereo, I have connected a 5.1 system up to it and the effect is still the same...

Mythfrontend Version:

Please attach all output as a file in bug reports.
MythTV Version : v0.27.1-16-gaa822f5-dirty
MythTV Branch : fixes/0.27
Network Protocol : 77
Library API : 0.27.20140520-1
QT Version : 4.8.6
Options compiled in:
 linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_firewire using_frontend using_hdhomerun using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcrypto using_libdns_sd using_libxml2 using_libudf using_lirc using_mheg using_opengl using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xrandr using_xv using_profiletype using_bindings_perl using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2 using_libudf

comment:6 Changed 5 years ago by JYA

then I need the logs.

the information you provided isn't enough to make anything of it.

and playing your file works exactly as expected here.

What the OSD states is a different story to what audio comes out. the information contained in Menu -> Playback -> Playback Data is what matters

otherwise it's up to the theme you are using.

comment:7 Changed 5 years ago by JohnLBergqvist@…

When I'm watching live TV and it transitions from stereo to 5.1, the number of channels shown in "Playback Data" is still shown as 2, even when I know that the audio has switched to 5.1. If I then immediatly exit live tv and restart it, the channels (both coming out of the speakers, shown on the OSD and shown in playback data) are now 6. So unless it happened to change from 2 to 6 in the exact time I exited live tv and then re-entered it again. I'll try and take some samples, first i'll take one of a program that the OSD has detected in 5.1. Then i'll try and take one when the stream should switch to 5.1 part way through...

comment:8 Changed 5 years ago by JYA

You still aren't providing the information I've requested.

We're going around in circle.

There's no need to detect audio changes halfway through as the output doesn't change.

What the OSD may show has no bearing on how it's played.

What would be a bug, would be if you had a 5.1 system connected, and audio didn't change from stereo to 5.1 or vice-versa.

If your connected to a stereo system, all you can get is stereo.

I don't see the point of saying you have 5.1 audio, when all you are actually getting is stereo other than the wank factor.

I understand some people like to see the lights turning on and off on their amplifier. I don't share the excitement

comment:9 in reply to:  8 ; Changed 5 years ago by JohnLBergqvist@…

Replying to jyavenard:

There's no need to detect audio changes halfway through as the output doesn't change.

It does change... (Ignore what my speakers can recieve, focus on the data being transmitted), When a program is broadcast in 5.1, the audio will change from 2.0 to 5.1... MythTV isn't detecting that change...

comment:10 Changed 5 years ago by JohnLBergqvist@…

Sample: http://mikahaksb02.srv.sn/surround.mpg

Here is a log captured just now: http://pastebin.com/raw.php?i=uYkjPc7w showing LiveTV & Playback Data correctly determining that the main audio track was in 5.1 surround sound - Listening through a stereo connection.

This was because I started LiveTV when the program was already transmitting in 5.1 *If* i'd started playback before the transmission had changed to 5.1, the OSD & playback data would still say 2 channels throughout.

comment:11 Changed 5 years ago by JohnLBergqvist@…

I will have to wait until I get a portion that transitions between stereo and surround...

comment:12 in reply to:  9 Changed 5 years ago by JYA

Ticket locked: set

Replying to JohnLBergqvist@…:

Replying to jyavenard:

There's no need to detect audio changes halfway through as the output doesn't change.

It does change... (Ignore what my speakers can recieve, focus on the data being transmitted), When a program is broadcast in 5.1, the audio will change from 2.0 to 5.1... MythTV isn't detecting that change...

Sigh...

You can only output stereo. Stereo you get. Of course what you can play matters. It's all that matters and the only thing that matters in this case.

You need to understand how audio decoding works and how AC3 is designed

Your system can only handle stereo. So audio is directly decoded as stereo

Focus on what you listen, and not the bling of what the OSD will show

If you have a sample or example of where the change from stereo to 5.1 and vice versa isn't detected when your audio system can handle 5.1 and not just stereo.

You can the. Reopen another bug, because that one will be. This one isn't. It's working as designed

comment:13 Changed 5 years ago by JYA

Resolution: Works for me
Status: closednew

comment:14 Changed 5 years ago by JYA

Resolution: Fixed
Status: newclosed
Note: See TracTickets for help on using tickets.