Unable to playback BBC recording from TVHeadend with DD 5.1 Audio

I’ve been meaning to post this for a while. I have some recordings made with TV Headend v4.2 that are from BBC1 HD in the UK with DD5.1 audio that are unable to play on the Vero 4k.

As soon as you click play the first frame of the programme appears and then pauses while the percentage indicator climbs round to 100 and then hangs there.

I’ve uploaded some debug logs and here is the mediainfo for the file:

Unique ID : 308972378677088067617099896594653491861 (0xE871EA654DCFBBFCF705A10F827BB295)
Complete name : \\Media\Videos\Howards End (2017)\Howards End.S01E01.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 1.45 GiB
Duration : 55 min 47 s
Overall bit rate : 3 715 kb/s
Movie name : Howards End
Encoded date : UTC 2017-12-31 15:14:47
Writing application : mkvmerge v19.0.0 (‘Brave Captain’) 64-bit
Writing library : libebml v1.3.5 + libmatroska v1.4.8
Original source form : TV
Comment : Auto recording
DATE_BROADCASTED : 2017-11-12 21:00:00
SUMMARY : 1/4. Four-part adaptation of EM Forster’s classic novel. The lives of the Schelgel and Wilcox families become entwined when Margaret Schelgel befriends the enigmatic Mrs Wilcox. [HD] [AD,S]

ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, RefFrames : 4 frames
Duration : 55 min 45 s
Bit rate : 3 545 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.068
Stream size : 1.38 GiB (95%)
Language : English
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

Audio #1
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC-2
Duration : 55 min 45 s
Bit rate : 124 kb/s
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 : -767 ms
Stream size : 49.4 MiB (3%)
Language : English
Default : Yes
Forced : No

Audio #2
ID : 3
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Format settings : Explicit
Codec ID : A_AAC-2
Duration : 52 min 51 s
Bit rate : 38.1 kb/s
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 : 6 s 578 ms
Stream size : 14.4 MiB (1%)
Language : English
Default : No
Forced : No

ID : 4
Format : DVB Subtitle
Muxing mode : zlib
Codec ID/Info : Picture based subtitle format used on DVBs
Duration : 55 min 43 s
Bit rate : 14.9 kb/s
Count of elements : 1327
Stream size : 5.93 MiB (0%)
Language : English
Default : Yes
Forced : No


Probably framerate related.

  1. Login via the command line
  2. Edit the file /etc/apt/sources.list
  3. Add the following line: deb http://apt.osmc.tv stretch-devel main
  4. Run the following commands to update: sudo apt-get update && sudo apt-get dist-upgrade && reboot
  5. Your system should have have received the update.

Please see if the issue is resolved.

I also recommend you edit /etc/apt/sources.list again and remove the line that you added after updating. This will return you to the normal update channel.

Thanks Sam, I’ve updated to the development branch, but it’s not made any difference.

I forgot to add that the issue is almost without doubt due to the audio track. The recording contains a dd5.1 track and a stereo audio track (audio described for hard of hearing). If I change audio track to the stereo track then the file proceeds to play immediately.

I’ve then jumped forward to halfway through the program and changed back to the dd5.1 audio and playback immediately freezes.

I’ve remuxed the file with just the dd5.1 and it won’t play and remuxed with just the stereo then it plays fine.

I’ve also muxed a short sample which I can upload? As I said before it plays fine using VLC on Windows.

Well, where are the logs? (How to submit a useful support request)

Some questions to understand the circumstances:

  • The episode is shown as mkv. Have you configured TVHeadend to use a profile with Matroska? Default would be pass which means .ts files.
  • Are you starting the playback as TV Show or as PVR recording?

I believe I followed the correct instructions regarding the debug logging. I enabled the logging, recreated the problem and uploaded the logs via My OSMC.

TVHeadend is configured to write directly to mkv using the Matroska profile rather than the pass profile that writes directly to TS. this hasn’t caused issues for any other recordings. I’ve also remuxed the file in mkvtoolnix which usually sorts any issues with the container, but no joy.

I’ve moved the file to my normal directory structure to play via smb as a tv show.

I can upload a small sample of the video if that helps?

Ok, but you got back a web URL you have had to publish, here.

A small sample could help to understand whether the problem is with the old recording or more with you environment.

Thanks. The logs are at https://paste.osmc.tv/likuzeyixa
Is there a preferred place to upload a clip to?

There’s a lot of log spam:

21:35:24.788 T:3684692736   ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - Command hello failed: No response received
21:35:24.788 T:3684692736   ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - failed to send hello

Can you resolve that and post fresh logs?


That BBC One HD recording doesn’t contain a DD/AC3 5.1 sound track. It contains an AAC 5.1 audio track (The Media Info report states as much under : Codec ID : A_AAC-2)

ID : 2

Format : AAC

Format/Info : Advanced Audio Codec

Format profile : LC

Codec ID : A_AAC-2

Duration : 55 min 45 s

Bit rate : 124 kb/s

Channel(s) : 6 channels

Channel positions : Front: L C R, Side: L R, LFE

Sampling rate : 48.0 kHz

The BBC use Dolby Digital for the main audio on BBC HD services on satellite, but on Freeview HD the BBC (and ITV, C4 and C5) use AAC for the main audio of their DVB-T2 services (both SD and HD on T2 muxes) whether these are 2.0 or 5.1 broadcasts. (ITV are 2.0 only, but BBC and C4 are 2.0/5.1 - not sure about C5)

This confuses people who assume that all 5.1 TV audio is Dolby Digital (it isn’t) - but it is a decision that the Freeview HD operators (effectively the BBC) had to take to ensure Audio Description worked the same way on Freeview HD as it does on Freeview SD (Dolby couldn’t offer a suitable receiver-mix solution at the time AIUI, and would have required a fixed-mix simulcast taking more bitrate and reducing viewer choice of relative levels)

To playback that file with 5.1 audio you have two choices :

  1. Enable transcode to Dolby Digital (you do this by selecting 2.0 speakers/channels counterintuitively - then when you look in the passthrough section you’ll see a transcode option appear)
  2. Decode to PCM 5.1. This didn’t work as standard on OSMC on the Vero but Sam has posted command line details to enable it.
1 Like

Am I missing something? Vero should just play AAC. No need to transcode and no need to decode if his receiver handles AAC with passthrough.

The audio in the file is just not being read:

11:22:29.108 T:3014632192   ERROR: ffmpeg[B3AFA300]: [aac] channel element 1.0 is not allocated
11:22:29.108 T:3014632192   ERROR: CVideoPlayerAudio::DecodeFrame - Decode Error. Skipping audio packet (-1094995529)

Not that I have any clue how to fix it.

I don’t think any receivers support AAC passthrough.

How odd.

[quote=“grahamh, post:10, topic:70231”]
Am I missing something? [/quote]

Yes - partially.

And - indeed - it does, just like most other Kodi platforms do. It will decode it to PCM or transcode it to Dolby Digital;

If you don’t transcode it or decode it to a format your AVR or TV supports it won’t work. AAC is not an audio format supported for bitstream passthrough over HDMI or Toslink/SPDIF. (For a while Kodi appeared to offer AAC passthrough - but this has never been supported by amps)

It’s like MP3, MP2, FLAC, OGG Vorbis etc. - a codec that isn’t part of an interconnect standard and needs to be decoded or transcoded.

The only audio formats that can be bitstreamed are : PCM, DD, DTS, DD+ (with and without Atmos), DTS-HD MA/HRA, DTS:x and Dolby True HD (with and without Atmos)

PCM 2.0, DD and DTS are also SPDIF bitstreamable (DD+ in some cases)
PCM multichannel, DTS-HD/DTS:x and Dolby True HD are HDMI only.
(WMA was bitstreamable at one point - but vanishingly rare…)
Anything else will need to be decoded or transcoded to a format that can be bitstreamed.

Hmm - I have no problems with TV Headend Freeview HD audio recordings on my Vero 4K.

Which of the two Freeview HD audio tracks are you playing? If you try and play the Mono 1.0 Audio Description feed (which “[aac] channel element 1.0 is not allocated”) may indicate you may have issues and only get silence. You should ensure you have selected the Stereo (or 5.1 if a 5.1 show) audio track.

In my TV Headend install the main programme audio is Track 1/2, the audio description mono narration only Track is 2/2.

Have you checked you are playing the right audio track?

1 Like

I stand corrected and humbled :pensive:

Do you need to use anything other than the default profile (*.ts) to capture 5.1?
And do you know if there is any way to know in advance what programmes might be broadcast with surround sound? Last Night of the Proms 2016 is the only BBC surround sound in my collection.

Thanks for all the help guys. It makes more sense now we understand it’s an AAC 5.1 audio track.

However, playback just hangs on the first frame.
In my experience if the issue is due to an audio codec that the receiver can’t handle then audio will be silent, but the video will play.

If I switch to the mono audio track then the file plays both the video and audio fine.

Also, I don’t have pass through enabled so I believed that OSMC simply would decode the AAC 5.1 and pass LPCM 5.1 to the HDMI port?

I’ll upload a clip when I get home.

Correct. Passthrough even if enabled is not used unless you set channels to 2.0 and enable AC3 transcoding.

.ts is fine to record 5.1 audio. The old TV Headend default of .mkv caused problems with 5.1 as if the recording started when the channel was 2.0, the audio in the recording was flagged as 2.0 for the whole recording (and wouldn’t flip to 5.1 when the 5.1 show started) - at least that was the case with DD on DSat (can’t remember about AAC on DTT)

The BBC used to do Strictly on Saturdays in 5.1 (the recorded Sunday show was 2.0 as it was edited and 5.1 post production is trickier). However the last series of Strictly was entirely 2.0 for both live and recorded shows.

I think Hard Sun is 5.1 at the moment I think - it’s on BBC One HD at the weekend.

Most US movies and many US TV series will be 5.1, some high-end drama that is co-produced with a major streaming or cable channel in the US can be too.

Almost all Nordic drama (as shown on BBC Four HD) is produced in 5.1 - but it’s a bit hit or miss if the BBC broadcasts are 5.1 or 2.0.

The BBC broadcast most Proms in 5.1 - and big state occasions in St Paul’s or Westminter Abbey sometimes are. (I wouldn’t be surprised if the Royal Wedding in Windsor is too)

The Eurovision Song Contest has been 5.1 since BBC HD launched (it famously went wrong in 2008…)

A lot of live sport is 5.1 - as it Match of the Day (though I don’t know how ‘real’ the 5.1 on this is…). The Olympics historically has been - don’t know about the forthcoming Winter Olympics.

5.1 in production does add an extra layer of complexity, and there is more that can go wrong. There doesn’t seem to be a huge commitment to it in the UK - probably because home cinema amps are still niche, and most people are happy with their TV or sound bar sound…

Hmm - what version of TV Headend server are you running? Are you running both on the Vero 4K?

For info here’s Hard Sun recorded from BBC One HD on Freeview HD in TV Headend :

ID                                       : 6602 (0x19CA)
Menu ID                                  : 1 (0x1)
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Muxing mode                              : LATM
Codec ID                                 : 17-2
Duration                                 : 59mn 57s
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                  : -416ms
Language                                 : English

Here’s Dancing on Ice from ITV HD on Freeview HD

ID                                       : 202 (0xCA)
Menu ID                                  : 1 (0x1)
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Muxing mode                              : LATM
Codec ID                                 : 17-2
Duration                                 : 1h 32mn
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Frame rate                               : 46.875 fps (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -784ms
Language                                 : English

Brilliant, thanks! Of that list the only thing I watch religiously is Nordic Noire but I can’t get the HD mux here :frowning_face:

Should add the above advice about US TV Shows and Movies is only for the BBC and C4. ITV apparently haven’t upgraded their current Playout areas to handle 5.1 so are 2.0 only. Not sure about C5. (Oddly I think DSat and DTT may be different for them - though I can’t remember when I last tried to check)