HD Freeview audio problem in OSMC on ATV1

This thread on the kodi forums is the same issue on CB2 HD from DVB-T2 "surround sound"

Playing UK Freeview HD TV content from a mediaportal server, with audio set to “passthrough” and connected to amp via HDMI

OSMC shows 2 channel audio on screen,the amplifier plays the surround channels as the front left and right

As the original file is over 2GB I have split the file with tssplitter to get to a more manageable size and hopefully not have any copyright complaints

mediainfo shows

General
ID                                       : 4 (0x4)
Complete name                            : C:\temp\split-1\Marvel's Agents of S.H.I.E.L.D. - 2016-03-19.TSSplit.20-120.ts
Format                                   : MPEG-TS
File size                                : 20.0 MiB
Duration                                 : 47s 670ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 3 514 Kbps

Video
ID                                       : 48 (0x30)
Menu ID                                  : 137 (0x89)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : 27
Duration                                 : 46s 840ms
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Standard                                 : Component
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 64 (0x40)
Menu ID                                  : 137 (0x89)
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Muxing mode                              : LATM
Codec ID                                 : 17
Duration                                 : 47s 680ms
Bit rate mode                            : Variable
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Frame rate                               : 46.875 fps (1024 spf)
Compression mode                         : Lossy
Delay relative to video                  : -1s 85ms
Language                                 : English
descriptor_tag_extension                 : 6

Audio #2
ID                                       : 65 (0x41)
Menu ID                                  : 137 (0x89)
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Muxing mode                              : LATM
Codec ID                                 : 17
Duration                                 : 47s 573ms
Bit rate mode                            : Variable
Channel(s)                               : 1 channel
Channel positions                        : Front: C
Sampling rate                            : 48.0 KHz / 24.0 KHz
Frame rate                               : 23.438 fps (1024 spf)
Compression mode                         : Lossy
Delay relative to video                  : -1s 0ms
Language                                 : English
Language, more info                      : Visual impaired commentary
descriptor_tag_extension                 : 6

Text
ID                                       : 80 (0x50)
Menu ID                                  : 137 (0x89)
Format                                   : DVB Subtitle
Codec ID                                 : 6
Duration                                 : 45s 238ms
Delay relative to video                  : 2s 60ms

The same issue is not experienced on kodibuntu or kodi on Windows.

Hi

Can you explain the problem more clearly? Kodi does not support AAC passthough, so it’s being downmixed to 2.0 channels. It’s possible it can be downmixed to 5.1 and streamed as LPCM; or even transcoded to AC3 and bitstreamed.

Sam

I have kodibuntu on an i3 NUC and OSMC on the ATV1, both feed into an Onkyo receiver.

The kodi audio setting number of channels is set to 5.1 on both kodibuntu and OSMC

When I play the clip on either, it shows as a 5.1 audio track in kodi

Playing on kodibuntu, the amp sees 5.1 multi channel PCM audio
Playing on OSMC the amp sees 2.0 PCM audio which on listening is actually the rear left and right, not the front left and right.

Cheers

I would need to see logs to confirm this is an issue. I believe that even since HDMI 1.0 it is possible to get 8 LPCM channels.

I haven’t tested AAC audio on the Apple TV in several years. The thread you point to is a very old version of CB, and featured an old kernel and old ALSA libraries. The issue won’t necessarily be the same.

Sam

enabled debug logging and verbose logging for audio, rebooted

played file from local storage

disabled verbose and debug logging, rebooted

uploaded log

http://paste.osmc.io/oqacequbic

Just tested OSMC on a Pi2 and it also (like kodibuntu) does not have the issue.

18:45:11 T:2987391808    INFO: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=Intel,DEV=0"
18:45:11 T:2987391808    INFO: CAESinkALSA::Initialize - Opened device "hdmi:CARD=Intel,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x02"
18:45:11 T:2987391808    INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
18:45:11 T:2987391808    INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S32NE
18:45:11 T:2987391808   DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 1024, bufferSize 4096
18:45:11 T:2987391808   DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 1024, bufferSize 4096
18:45:11 T:2987391808   DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 86 ms
18:45:11 T:2987391808   DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 4 Output Channel Count: 4
18:45:11 T:2987391808   DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR,FC,LFE
18:45:11 T:2987391808   DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR,FC,LFE (ALSA: FL FR FC LFE)

That’s your issue. Your AVR may be giving the AppleTV an incorrect EDID (probably ARC related). Would be interesting to see the Kodibuntu log for CAESinkALSA connected to the same AVR and TV. When you say it works for Kodibuntu:

  • Was this on the same Kodi version?
  • Was this connected to the same AVR and TV?

kodibuntu is running Kodi 16 Git:a5f3a99 Feb 20 2016, and not had the issue since I got the i3 NUC in 2014

OSMC on the Pi is OSMC_TGT_rbp2_20160306.img.gz and does not display the issue

I have also not experienced the issue on kodi on Amazon fire TV (Kodi 15 & Kodi 16)

All tests have been connected to the same Onkyo amp and TV.

I can reliably reproduce the issue on the ATV with any FreeviewHD 5.1 live TV or recordings, but have not experienced the issue on any non Freeview HD multi channel media.

log from kodibuntu with verbose debug enabled for ffmpeg, audio and video http://paste.osmc.io/ujazizaxod.vhdl

If this the last log is a log where it works successfully, then I am not sure of the issue:

15:15:12 T:140206484420352   DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 2048, bufferSize 8192
15:15:12 T:140206484420352   DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 2048, bufferSize 8192
15:15:12 T:140206484420352   DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 186 ms
15:15:12 T:140206484420352   DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 2 Output Channel Count: 2
15:15:12 T:140206484420352   DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR
15:15:12 T:140206484420352   DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR (ALSA: FL FR)
15:15:12 T:140206484420352   DEBUG: CActiveAESink::OpenSink - ALSA Initialized:
15:15:12 T:140206484420352   DEBUG:   Output Device : HDA Intel PCH
15:15:12 T:140206484420352   DEBUG:   Sample Rate   : 44100
15:15:12 T:140206484420352   DEBUG:   Sample Format : AE_FMT_S32NE
15:15:12 T:140206484420352   DEBUG:   Channel Count : 2
15:15:12 T:140206484420352   DEBUG:   Channel Layout: FL,FR
15:15:12 T:140206484420352   DEBUG:   Frames        : 2048
15:15:12 T:140206484420352   DEBUG:   Frame Samples : 4096
15:15:12 T:140206484420352   DEBUG:   Frame Size    : 8

As this only shows two channels supported. On this NUC, are you downmixing it to LPCM 5.1 or are you transcoding it to AC3?

Make sure the correct Audio device is selected in Kodi. Sometimes if you select the default device, you only get 2 channels.

I’d check things with aplay -l first.

I will also see if Fritsch (AE guy) is about to look at this post and offer some suggestions.

Thanks

Sam

Please try: speaker-test -c 6 on your ATV.

Last I looked the ancient kernel only had 2 channel PCM support and the only method to get it to output 5.1 was using AC3 transcoding and passthrough as AC3 / DTS is transmitted via 2 PCM channels only.

Not sure what happened there.

new log from kodibuntu http://paste.osmc.io/epumanisif.vhdl

confirmed while playing that the amp was seeing 5.1 multi channel PCM audio

The NUC for sure works as it can open 8 pcm channels … but as said: I never saw an ATV with more than 2 channels PCM working … this is a kernel / driver limitation and has nothing to do with kodi.

if I run speaker-test -Dhdmi:Intel -c 6 -twav the amp shows 2.0 PCM and I hear front left and front right

it would appear that the 2 channel limitation is exactly the same issue that existed on CB2, as per my first post in this thread.

is there a way to force AC3 transcoding only for this type of media ?

Nope. Better fix the root cause.

1 Like

thanks for confirming :slight_smile:

is this solvable ?

It’s a hardware limitation.

Oh well, my ATV1 will go back in its box and the NUC will continue in its place, it’s a pity as the Apple remote is so much nicer than any MCE type remote

I have to laugh though, you suggested it wasn’t the same problem, then suggested it was incorrect EDID/ARC from my amp, before saying that it’s a hardware limitation.