kriznik
Posts: 6
Joined: Tue Jun 11, 2019 10:59 am

PiTV + Tvheadend = some streams sound only

Tue Jun 11, 2019 1:13 pm

Hello folks,
I've been searching quite a lot, but still can't figure out how to solve my issue, so please be nice and if that was already somewhere solved, throw me there :)

I have PiTV hat on RPI3 running latest raspbian stretch and latest tvheadend, providing tv server for my whole home.
I'm using this server to watch tv on other rigs which works flawlessly. However on this very RPI3 running Kodi some streams are without picture, only sound. (very same streams works on libreelec and kodi for ubuntu etc. ==== so this is not issue with tvheadend).

I do have MPEG2 and VC licences but still this thing can't play some streams, unfortunately those streams are on same mux as the ones which works. And again, all streams works just fine on libreelec running on odroid for example or kodi on ubuntu on intel nuc

here is part of the kodi log, you can see at the beginning there is stream which works, and then there are two attemps to watch different channels which failed with "video codec unknown: ad"

Code: Select all

2019-06-11 14:56:43.220 T:1452212960  NOTICE: Creating InputStream
2019-06-11 14:56:43.413 T:1452212960  NOTICE: Creating Demuxer
2019-06-11 14:56:45.364 T:1452212960  NOTICE: Opening stream: 1001 source: 256
2019-06-11 14:56:45.383 T:1452212960  NOTICE: Creating video thread
2019-06-11 14:56:45.383 T:1452212960  NOTICE: Opening stream: 1002 source: 256
2019-06-11 14:56:45.384 T:1452212960  NOTICE: Creating audio thread
2019-06-11 14:56:45.384 T:1452212960  NOTICE: Opening stream: 1004 source: 256
2019-06-11 14:56:45.384 T:1452212960  NOTICE: waiting for teletext data thread to exit
2019-06-11 14:56:45.386 T:1452212960  NOTICE: Creating teletext data thread
2019-06-11 14:56:45.387 T:1394586336  NOTICE: running thread: CDVDTeletextData
2019-06-11 14:56:45.388 T:1452212960  NOTICE: Opening stream: 1001 source: 256
2019-06-11 14:56:45.414 T:1452212960  NOTICE: Opening stream: 1002 source: 256
2019-06-11 14:56:45.414 T:1452212960  NOTICE: Opening stream: 1004 source: 256
2019-06-11 14:56:45.417 T:1452212960  NOTICE: Opening stream: 1001 source: 256
2019-06-11 14:56:45.417 T:1452212960  NOTICE: Opening stream: 1002 source: 256
2019-06-11 14:56:45.417 T:1452212960  NOTICE: Opening stream: 1004 source: 256
2019-06-11 14:56:45.865 T:1402979040 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
2019-06-11 14:56:54.033 T:1901605728 WARNING: Previous line repeats 54 times.
2019-06-11 14:56:54.033 T:1901605728  NOTICE: VideoPlayer::OpenFile: pvr://channels/tv/All channels/pvr.hts_738723452.pvr
2019-06-11 14:56:54.033 T:1901605728  NOTICE: CVideoPlayer::CloseFile()
2019-06-11 14:56:54.033 T:1901605728  NOTICE: VideoPlayer: waiting for threads to exit
2019-06-11 14:56:54.074 T:1452212960  NOTICE: CVideoPlayer::OnExit()
2019-06-11 14:56:54.074 T:1452212960  NOTICE: Closing stream player 1
2019-06-11 14:56:54.080 T:1460605664  NOTICE: thread end: OMXPlayerAudio::OnExit()
2019-06-11 14:56:54.155 T:1452212960  NOTICE: Closing stream player 2
2019-06-11 14:56:54.155 T:1402979040   ERROR: OMXPlayerVideo: Got MSGQ_IS_ERROR(-1) Aborting
2019-06-11 14:56:54.155 T:1402979040  NOTICE: thread end: video_thread
2019-06-11 14:56:54.245 T:1452212960  NOTICE: Closing stream player 4
2019-06-11 14:56:54.245 T:1452212960  NOTICE: waiting for teletext data thread to exit
2019-06-11 14:56:54.245 T:1394586336   ERROR: Got MSGQ_ABORT or MSGO_IS_ERROR return true (-1)
2019-06-11 14:56:54.245 T:1394586336  NOTICE: thread end: data_thread
2019-06-11 14:56:54.255 T:1901605728  NOTICE: VideoPlayer: finished waiting
2019-06-11 14:56:54.256 T:1394586336  NOTICE: Creating InputStream
2019-06-11 14:56:54.589 T:1394586336  NOTICE: Creating Demuxer
2019-06-11 14:56:57.076 T:1394586336  NOTICE: Opening stream: 1001 source: 256
2019-06-11 14:56:57.077 T:1394586336   ERROR: COMXVideo::Open : Video codec unknown: ad
2019-06-11 14:56:57.077 T:1394586336   ERROR: OMXPlayerVideo : Error open video output
2019-06-11 14:56:57.077 T:1394586336 WARNING: OpenStream - Unsupported stream 1001. Stream disabled.
2019-06-11 14:56:57.077 T:1394586336  NOTICE: Opening stream: 1002 source: 256
2019-06-11 14:56:57.079 T:1394586336  NOTICE: Creating audio thread
2019-06-11 14:56:57.079 T:1394586336  NOTICE: Opening stream: 1003 source: 256
2019-06-11 14:56:57.086 T:1394586336  NOTICE: Opening stream: 1001 source: 256
2019-06-11 14:56:57.086 T:1394586336   ERROR: COMXVideo::Open : Video codec unknown: ad
2019-06-11 14:56:57.086 T:1394586336   ERROR: OMXPlayerVideo : Error open video output
2019-06-11 14:56:57.087 T:1394586336 WARNING: OpenStream - Unsupported stream 1001. Stream disabled.
2019-06-11 14:56:57.087 T:1394586336  NOTICE: Opening stream: 1002 source: 256
2019-06-11 14:56:57.087 T:1394586336  NOTICE: Closing stream player 3
2019-06-11 14:56:57.087 T:1394586336  NOTICE: Opening stream: 1003 source: 256
2019-06-11 14:56:57.341 T:1394586336 WARNING: CDVDMessageQueue(video)::Put MSGQ_NOT_INITIALIZED
2019-06-11 14:57:00.139 T:1680945888  NOTICE: service.libraryautoupdate-1.0.2 : Player is running, wait until finished
2019-06-11 14:57:05.450 T:1901605728  NOTICE: Previous line repeats 1 times.
2019-06-11 14:57:05.450 T:1901605728   ERROR: CBinaryAddonManager::GetInstalledAddonInfo: Requested addon '' unknown as binary
2019-06-11 14:57:05.482 T:1901605728  NOTICE: VideoPlayer::OpenFile: pvr://channels/tv/All channels/pvr.hts_84796741.pvr2019-06-11 14:57:05.482 T:1901605728  NOTICE: CVideoPlayer::CloseFile()
2019-06-11 14:57:05.482 T:1901605728  NOTICE: VideoPlayer: waiting for threads to exit
2019-06-11 14:57:05.505 T:1394586336  NOTICE: CVideoPlayer::OnExit()
2019-06-11 14:57:05.505 T:1394586336  NOTICE: Closing stream player 1
2019-06-11 14:57:05.509 T:1402979040  NOTICE: thread end: OMXPlayerAudio::OnExit()

I do have enabled hw decoding in kodi, since i do have licences and i do have start_x=1 in boot sequence already (which helped to see at least some streams as before that all of them was only with sound) and i do have licencing keys in my boot config as well.

Is there anything else which needs to be configured in order to use properly licencing keys? or it does not look like HW acceleration issue?

thanks for any hint/help
appreciated

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7146
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PiTV + Tvheadend = some streams sound only

Tue Jun 11, 2019 2:01 pm

Where are you in the world, and what is the exact channel that you are trying to tune to?
Some places are now using H265 encoding, which can not be decoded via OMXplayer.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

kriznik
Posts: 6
Joined: Tue Jun 11, 2019 10:59 am

Re: PiTV + Tvheadend = some streams sound only

Tue Jun 11, 2019 3:01 pm

funnily enough h265 streams works just fine, but others won't

am in czech rep, so czech tv channels which are encoded in h265 works, but rest of the channels don't
(and if i turn off hw decoding, rpi3 just freeze)

isnt hw decoding meant to failback to sw if there is an issue? does it make sense to manually turn that on/off when there can be plenty of content decoded by hw?
how we are supposed to know which will or which wont be working?

I mean "uknown: ad" is not much to work with

edit: -> and libreelec is not using hw decoding at all? how so it's not freezing at all but rpi with normal kodi just freezes all the time? :puzzled:

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7146
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PiTV + Tvheadend = some streams sound only

Tue Jun 11, 2019 4:31 pm

There is no dedicated hardware decoding for H265 as there is for H264, MPEG4, H263, MPEG2, and VC1. The H265 spec wasn't finalised at the point the silicon was made. There is a a hardware assisted H265 decode path using an extended FFMPEG that is available via Kodi (possibly only within the LibreElec builds).

I can't find any information quickly as to which codecs are being used in the Czech Republic. The simplest thing would be to tell tvheadend to record a program on one of these channels (having disabled transcoding and just saving to matroska), and then use "ffprobe filename.mkv" to analyse the file.
I assume you haven't mapped encrypted channels, as there is no CAM for decoding those on the Pi.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

kriznik
Posts: 6
Joined: Tue Jun 11, 2019 10:59 am

Re: PiTV + Tvheadend = some streams sound only

Tue Jun 11, 2019 6:46 pm

thanks for your time and hits, so here is a sample of non working stream:

Code: Select all

ffprobe test.mkv
ffprobe version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
[aac @ 0x1b5e020] element type mismatch 1 != 0
Input #0, matroska,webm, from 'test.mkv':
  Metadata:
    title           : Zákon a pořádek: Útvar pro zvláštní oběti XVIII (2)
    encoder         : Tvheadend Matroska muxer
    DATE_BROADCASTED: 2019-06-11 20:20:00
    ORIGINAL_MEDIA_TYPE: TV
    TVCHANNEL       : Nova Action
    SUMMARY         : Sean Roberts byl před šestnácti lety obviněn ze znásilnění Melanie Harperové. Pozdější testy DNA prokázaly, že zločin nespáchal, a skutečný pachatel byl odhalen. Měsíc po propuštění se Sean setkává s vyšetřovateli, také s Melán
    SUMMARY-cze     : Sean Roberts byl před šestnácti lety obviněn ze znásilnění Melanie Harperové. Pozdější testy DNA prokázaly, že zločin nespáchal, a skutečný pachatel byl odhalen. Měsíc po propuštění se Sean setkává s vyšetřovateli, také s Melán
  Duration: 00:00:34.50, start: 0.007000, bitrate: 3032 kb/s
    Chapter #0:0: start 0.000000, end 34.507000
    Stream #0:0(eng): Video: hevc (Main), yuv420p(tv, bt709), 960x540 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
    Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default)
    Stream #0:2(cze): Subtitle: dvb_subtitle (default)

and here is one which works:

Code: Select all

ffprobe Valecne\ lode\:\ Ponorky\,\ valka\ pod\ hladinou-CT\ 2.mkv
ffprobe version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
[mpeg2video @ 0x100e590] warning: first frame is no keyframe
Input #0, matroska,webm, from 'Valecne lode: Ponorky, valka pod hladinou-CT 2.mkv':
  Metadata:
    title           : Válečné lodě: Ponorky, válka pod hladinou
    encoder         : Tvheadend Matroska muxer
    DATE_BROADCASTED: 2019-06-11 20:00:18
    ORIGINAL_MEDIA_TYPE: TV
    CONTENT_TYPE    : Social / Political issues / Economics
    TVCHANNEL       : CT 2
    SUMMARY         : HDTV
                    : 2 jazykové verze
                    : Skryté titulky
                    : Válečné lodě se postupně zvětšovaly a rostla i jejich ničivá síla. Přesto však zůstávaly zranitelné. Nepříteli k jejich potopení stačila plavidla, která dokázala udeřit z úkrytu pod mořskou hladinou. Nejúžasnější vlastností p
    SUMMARY-cze     : HDTV
                    : 2 jazykové verze
                    : Skryté titulky
                    : Válečné lodě se postupně zvětšovaly a rostla i jejich ničivá síla. Přesto však zůstávaly zranitelné. Nepříteli k jejich potopení stačila plavidla, která dokázala udeřit z úkrytu pod mořskou hladinou. Nejúžasnější vlastností p
  Duration: 00:00:47.52, start: 0.000000, bitrate: 2706 kb/s
    Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
    Stream #0:1(cze): Audio: mp2, 48000 Hz, stereo, s16p, 160 kb/s (default)
    Stream #0:2(cze): Audio: mp2, 48000 Hz, mono, s16p, 64 kb/s (default)

so i guess issue is HEVC?
howso that rpi3 with libreelec works? ....

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7146
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PiTV + Tvheadend = some streams sound only

Wed Jun 12, 2019 1:05 pm

As I'd posted earlier, there is a hardware assisted HEVC decoder built as an extension to FFmpeg. It requires a specific way of driving it for buffer allocation and similar, therefore I don't believe it is in the default Raspbian build, but it is in LibreElec.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

kriznik
Posts: 6
Joined: Tue Jun 11, 2019 10:59 am

Re: PiTV + Tvheadend = some streams sound only

Wed Jun 12, 2019 2:11 pm

ah I see.
I wish there were some documentation how libreelec kodi is compiled ;( It would be so damn good to have full linux behind such a nicely optimized kodi build

Return to “HATs and other add-ons”