v17 Hadware acceleration is disabled with PVR stream
#1
Hi all,

I have a problem with Krypton beta 3 (but the problem was there with beta 1 and 2).
Hardware acceleration is disabled only when I use the PVR for watching live TV (stream), and of course in the settings, video hardware acceleration is set to on.

If I record the TV and then I play the recorded file, it is OK (even if the recording is not yet finished). So it is not something related to the codec or the hardware (there is no transcodification done by PVR backend, show is recorded as is).

I am on android (NVidia Shield TV) and tvheadend for the backend.

With Jarvis, it was working fine. Now without hardware acceleration enabled, there are terribles lags.

Is that someone else has the same problem ? is it a know issue ?
Reply
#2
Same problem on my iMac. So it is not related to android
Reply
#3
(2016-10-07, 21:15)ralphdov Wrote: Same problem on my iMac. So it is not related to android

hw acceleration on mac, vda or vtb now, has never been able to decode interlaced material.
Reply
#4
I am not talking about deinterlacing in particular but just about decoding.
I am not sure for the mac if before there was hardware acceleration but for the Nvidia shield, which is my real media center that I use everyday, I am sure that the Live TV was decoded by the Hardware with Jarvis (everything was fluide), and now with Krypton, hardware decoding is disabled (I checked by using the "O" key with skin mimic, it is clearly indicated and I can see that the it is very laggy).
Reply
#5
I just said that your issue IS related to Android. There is no issue on the other platforms. Decoding on Mac works as expected.
Reply
#6
Ok thanks, so is it an known issue for android or am I the only one using PVR on android ?
Do I have to open an issue on GitHub ?

I know that there are very few android developper and I really appreciate all efforts done by the kodi team so far but it is just to know if there is a chance to have this issue corrected before the final release.
Reply
#7
I'm experiencing this too. On my Fire TV I'm running Kodi 17.0-RC2 and hardware decoding is not being used for my PVR live streams. When I play one (mainly the HD streams) I see the individual CPUs pegged at almost 100% (with CPU-KODI at about 390%) with stuttering and dropped frames etc. If I watch a the same program recorded it plays back perfectly smoothly (with CPU-KODI at about 30%).

I have another Fire TV stick running Kodi 16 and playing the same stream appears to use the HW decoding correctly and is smooth.

Here is a debug log when experiencing the issue : http://paste.ubuntu.com/23738298/

(Starts at 10:18:46.738 when trying to watch an HD stream). If there's anyway I can help troubleshoot and resolve this I'd be happy to help

Cheers
Mark
Reply
#8
Here: http://mirrors.kodi.tv/test-builds/andro...bi-v7a.apk (wait until mirror is synced). That will fix it. It's a WIP (not meant for Krypton at all) by Fernetmenta and me ... the problem is the decoder which does not properly handle stream changed. This issue is pure android only.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#9
Hi fritich.

Many thanks for your very fast response.

I have tried this build (17.0-RC3 Git:20170104-5c13cbe) and it certainly improves things.

Here is a log when watching an HD channel which now plays (fairly) smoothly

http://paste.ubuntu.com/23738506/

Starts streaming at : 11:26:23.088 (CPU-KODI around 130% during play)


And here is a log when watching a different channel which still shows the problem

http://paste.ubuntu.com/23738512/

Starts streaming at : 11:28:52.048 (CPU-KODI around 300% during play)

I can't quite work out why they are different. Both are h264 streams with 2 channel AAC audio


Thanks again for your help
Cheers
Mark
Reply
#10
What this build not fixes is broken tvheadend - but yeah, this is broken on all platforms and has nothing to do with kodi. It's a long year standing issue with tvh sending shit when opening the hw decoder. You have two options:

a) Record what you want to watch with tvh and watch it 2 hours later
b) Throw tvh away and use another backend / frontend.

The reason you see this CPU load is, that the sw decoder jumps in, as the other stuff is far too broken to be played with the hwdecoder.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#11
Thanks fritsch,

I am really grateful for your replies.

I understand that the s/w decoder is kicking in, but that first stream was unplayable with RC2 but with that build you linked to, it's improved a lot to the point where it's almost perfect (still high CPU but not fully saturated)

What's interesting though is that I have another Fire TV in the house (a "stick" with 2 CPU rather than the 4k "box" with 4) running Jarvis (16.1 Git:2016-04-24-c327c53) and all of the channels from TVH stream perfectly.

http://paste.ubuntu.com/23738582/

Stream starts at 11:58:38 which appears to use h/w decoder as the cpu usage is low at around 40-50% and it is perfectly smooth on the screen.

This is from the same TVH backend server.

Any thoughts? Is this a consequence of the refactored Video Player in Krypton?

Cheers
Mark

Here are a couple of snippets of the 2 different versions attempting the same stream.

1. From Jarvis (working)

Code:
11:58:40 T:1105464144   DEBUG: CActiveAESink::OpenSink - AUDIOTRACK Initialized:
11:58:40 T:1105464144   DEBUG:   Output Device : android
11:58:40 T:1105464144   DEBUG:   Sample Rate   : 48000
11:58:41 T:1105464144   DEBUG:   Sample Format : AE_FMT_S16NE
11:58:41 T:1105464144   DEBUG:   Channel Count : 2
11:58:41 T:1105464144   DEBUG:   Channel Layout: FL,FR
11:58:41 T:1105464144   DEBUG:   Frames        : 1440
11:58:41 T:1105464144   DEBUG:   Frame Samples : 2880
11:58:41 T:1105464144   DEBUG:   Frame Size    : 4
11:58:41 T:1105065408   DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
11:58:41 T:1412587856   ERROR: CDVDVideoCodecAndroidMediaCodec::ExceptionCheck: configure
11:58:41 T:1412587856   DEBUG: FactoryCodec - Video: amc-h264(S) - Failed
11:58:41 T:1412587856    INFO: MediaCodec Video Decoder...
11:58:41 T:1412587856   DEBUG: FactoryCodec - Video: mediacodec - Opening
11:58:41 T:1412587856    INFO: CBitstreamConverter::Open Invalid avcC
11:58:41 T:1412587856   DEBUG: CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.brcm.video.hw.decoder), colorFormat(2135033992)
11:58:41 T:1412587856   DEBUG: CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.brcm.video.hw.decoder), colorFormat(19)
11:58:41 T:1412587856   DEBUG: CDVDVideoCodecAndroidMediaCodec:: width(1920), height(1080), stride(0), slice-height(0), color-format(0)
11:58:41 T:1412587856   DEBUG: CDVDVideoCodecAndroidMediaCodec:: crop-left(0), crop-top(0), crop-right(0), crop-bottom(0)
11:58:41 T:1412587856   DEBUG: CDVDVideoCodecAndroidMediaCodec:: Direct Surface Rendering
11:58:41 T:1412587856    INFO: CDVDVideoCodecAndroidMediaCodec:: Open Android MediaCodec OMX.brcm.video.hw.decoder
11:58:41 T:1412587856   DEBUG: FactoryCodec - Video: amc-h264 - Opened
11:58:41 T:1412587856   DEBUG: CDVDPlayer::HandleMessages - player started 1

2. From Krypton (not working)

Code:
11:28:54.926 T:18446744072289985536   DEBUG: CActiveAESink::OpenSink - AUDIOTRACK Initialized:
11:28:54.926 T:18446744072289985536   DEBUG:   Output Device : android
11:28:54.927 T:18446744072289985536   DEBUG:   Sample Rate   : 48000
11:28:54.927 T:18446744072289985536   DEBUG:   Sample Format : AE_FMT_FLOAT
11:28:54.927 T:18446744072289985536   DEBUG:   Channel Count : 2
11:28:54.927 T:18446744072289985536   DEBUG:   Channel Layout: FL,FR
11:28:54.927 T:18446744072289985536   DEBUG:   Frames        : 4096
11:28:54.927 T:18446744072289985536   DEBUG:   Frame Size    : 8
11:28:54.937 T:18446744072290024864   DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
11:28:54.943 T:18446744072302474592   DEBUG: Previous line repeats 1 times.
11:28:54.943 T:18446744072302474592  NOTICE: Creating video codec with codec id: 28
11:28:54.945 T:18446744072302474592   DEBUG: FactoryCodec - Video: mediacodec - Opening
11:28:54.945 T:18446744072302474592    INFO: CBitstreamConverter::Open Invalid avcC
11:28:54.953 T:18446744072328554800   DEBUG: CVideoPlayer::HandleMessages - player started 1
11:28:54.960 T:18446744072302474592   DEBUG: CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.MTK.VIDEO.DECODER.AVC), colorFormat(19)
11:28:54.961 T:18446744072302474592   DEBUG: CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.MTK.VIDEO.DECODER.AVC), colorFormat(2135033992)
11:28:54.961 T:18446744072302474592   DEBUG: CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.MTK.VIDEO.DECODER.AVC), colorFormat(2130706433)
11:28:54.975 T:18446744072302474592   ERROR: CDVDVideoCodecAndroidMediaCodec::ExceptionCheck: configure
11:28:54.975 T:18446744072302474592   DEBUG: FactoryCodec - Video: amc-h264 - Failed
11:28:54.975 T:18446744072302474592   DEBUG: FactoryCodec - Video:  - Opening
11:28:54.975 T:18446744072302474592  NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
11:28:54.976 T:18446744072302474592   DEBUG: CDVDVideoCodecFFmpeg - open frame threaded with 6 threads
11:28:54.978 T:18446744072302474592   DEBUG: CDVDVideoCodecFFmpeg - Updated codec: ff-h264
11:28:54.978 T:18446744072302474592   DEBUG: FactoryCodec - Video: ff-h264 - Opened

(I am a software developer by trade (Java) so I'd love to help resolve this.)
Reply
#12
Oki, a SW developer:

a) Live TV fails
b) Recording of the same channel works

Jobs to do:
i) Find out what the difference in the code path is (hint: tvh demuxer vs ffmpeg demuxer)
ii) Fix the broken demuxer in i) and make a) work.

Everything works, works by chance.

And something else: kodi does not have an android maintainer anymore. These issues (minus the tvh malady) are fundamentally showing the broken implementation / architecture on this platforms. Pointed out years ago, but since then not fixed. So prepare to dig deep :-)

Another hint: check tvh bugtracker.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#13
And if you have some time. Exchange the backend to VDR with vnsi and check the same channel with vdr's vnsi and the build I provided.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#14
Hi fritsch,

I've not had a huge amount of time to look at this (pesky day job getting in the way) but I've read all I can on the tvh bug tracker and I'm starting to understand some of the problems.

Anyway I just posted to say that the build you linked to on the "passthrough" thread (kodi-20170107-14e67df-probablyfinal-armeabi-v7a.apk) has enabled hardware decoding (for HD streams) for live TV from tvh. (SD streams are still done in SW but the Fire manages this without problem).

So I wanted to say thank you - I'm starting to understand the limitations of the android platform for Kodi (I'm new to it myself having run Kodi/XBMC on pretty much every other OS since the Xbox days) and I appreciate your efforts to make it "suck less"

All the best
Mark
Reply
#15
I will push sth for SD shortly. Remember: channel switching might not work. But stop and play.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
 
Thread Rating:
  • 1 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
Hadware acceleration is disabled with PVR stream51