Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuttering while audio track changes on the fly #149

Open
xi784 opened this issue Mar 10, 2017 · 28 comments
Open

Stuttering while audio track changes on the fly #149

xi784 opened this issue Mar 10, 2017 · 28 comments

Comments

@xi784
Copy link

xi784 commented Mar 10, 2017

Example:
Change from commercials to movie from stereo 2.0 to ac3 5.1, video begins to stuttering, channel change helps.

@kiall
Copy link
Owner

kiall commented Mar 10, 2017

Could you record a piece of video that does this?

I've not seen this happen on any of my channels, but a few folks have reported it.

Details on how to record @ https://github.com/kiall/android-tvheadend/wiki/Muxdump

Does it recover on its own, or just continue stuttering?

@xi784
Copy link
Author

xi784 commented Mar 10, 2017

Just continue stuttering or gets totally freezed.

Will take a muxdump on the next break.

@xi784
Copy link
Author

xi784 commented Mar 10, 2017

ok muxdump will be a problem because CA in use.

@kiall
Copy link
Owner

kiall commented Mar 10, 2017

Humm, my understanding is it'll be decrypted by the to e you record the muxdump? I think.

@xi784
Copy link
Author

xi784 commented Mar 10, 2017

If i try to record the mux directly, ca doesn´t get active. What makes sense, because TVHeadend doesn´t know the pid.

@xi784
Copy link
Author

xi784 commented Mar 10, 2017

Will take a dump via streamrecording, maybe that helps

@kiall
Copy link
Owner

kiall commented Mar 10, 2017

Yea, try using the "pass" profile for DVR? It might work, I've not tried! Anything is better than nothing I'm sure though :)

Failing that, access to your TVHeadend server for a few hours if remote access can work? (With some pointers to content that does this. .)

@xi784
Copy link
Author

xi784 commented Mar 10, 2017

got it:
https://drive.google.com/drive/folders/0BxP1VJf8kaXoNU1SQkFDbHFiZlE?usp=sharing
On 1:00 +/- it changes from stereo to 5.1

@xi784
Copy link
Author

xi784 commented Mar 10, 2017

That would be not a problem, would have only to persuade my special "Telekom Hybrid Router" :)
Tomorrow i will set this up, for future problems.

@kiall
Copy link
Owner

kiall commented Mar 11, 2017

Okay, so I can see this sample definatly contains a layout switch:

# ffprobe -select_streams a -show_frames sample.ts 2>&1 | grep channel_layout | sort | uniq -c
   1126 channel_layout=5.1(side)
   1997 channel_layout=stereo

Both sides of the switch appear to play OK individually (convincing TVHeadend to pass through the right parts of this stream without editing the file was... challenging), however when played continuously across the boundary, it's clearly stuttering.

The app log little more than this:

03-11 17:56:00.143 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 83488000, got 83232011]
03-11 17:56:00.529 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 83616011, got 83360011]
03-11 17:56:00.911 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 83744011, got 83488011]
03-11 17:56:01.297 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 83872011, got 83616011]
03-11 17:56:01.674 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 84000011, got 83744011]
03-11 17:56:02.059 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 84128011, got 83872011]
03-11 17:56:02.446 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 84256011, got 84000011]
03-11 17:56:02.828 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 84384011, got 84128011]
03-11 17:56:03.214 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 84512011, got 84256011]
03-11 17:56:03.597 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 84640011, got 84384011]
03-11 17:56:03.982 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 84768011, got 84512011]
03-11 17:56:04.366 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 84896011, got 84640011]
03-11 17:56:04.752 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 85024011, got 84768011]
03-11 17:56:05.140 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 85152011, got 84896011]
03-11 17:56:05.517 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 85280011, got 85024011]
03-11 17:56:05.902 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 85408011, got 85152011]
03-11 17:56:06.287 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 85536011, got 85280011]
03-11 17:56:06.671 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 85664011, got 85408011]
03-11 17:56:07.057 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 85792011, got 85536011]
03-11 17:56:07.440 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 85920011, got 85664011]
03-11 17:56:07.818 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 86048011, got 85792011]
03-11 17:56:08.205 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 86176011, got 85920011]
03-11 17:56:08.589 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 86304011, got 86048011]
03-11 17:56:08.973 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 86432011, got 86176011]
03-11 17:56:09.362 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 86560011, got 86304011]
03-11 17:56:09.739 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 86688011, got 86432011]
03-11 17:56:10.125 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 86816011, got 86560011]
03-11 17:56:10.513 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 86944011, got 86688011]
03-11 17:56:10.900 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 87072011, got 86816011]
03-11 17:56:11.275 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 87200011, got 86944011]
03-11 17:56:11.658 3466-14014/ie.macinnes.tvheadend E/AudioTrack: Discontinuity detected [expected 87328011, got 87072011]

@xi784
Copy link
Author

xi784 commented Mar 11, 2017

No one said it would be easy, but it had to be done.. :)

@Vispen74
Copy link

Vispen74 commented Mar 11, 2017

I have this problem as well, using TVheadend Live Channels on a Sony Bravia XD8505 with Android-TV 6.01 as frontend. I´m loosing the HW acceleration every time commercial breaks movies. Channel change will bring it back.
Using a Ubuntu server with Tvheadend 4.1-2405 as backend.

@kiall
Copy link
Owner

kiall commented Mar 11, 2017

So, what devices are you two on? Shield? Nexus Player? etc

@kiall
Copy link
Owner

kiall commented Mar 11, 2017

Also - Can you give this build a go? Once installed, re-run setup to get to the preferences, then disable the FFMpeg Audio Renderer, and see if that helps? It seems to have helped for me:

https://dl.dropboxusercontent.com/u/1400487/VID_20170311_183826.mp4

http://jenkins.macinnes.ie/job/android-tvheadend/job/master/52/ - download the "-release.apk", not the "-debug.apk"

Assuming it works for you too, and not just on the recorded sample I have, I can start digging into the issue...

@Vispen74
Copy link

The TV is occupied by family this evening, will give the build ago tomorrow and report back.

@xi784
Copy link
Author

xi784 commented Mar 11, 2017

Have checked this, Nexus Player and shild as well..
ok Kiall, i will test it

@xi784
Copy link
Author

xi784 commented Mar 11, 2017

if you need access to my tvheadend, we need to pm .. e.g. skype, hangouts or something else.

Channel RTL2 is perfect for testing now.

@kiall
Copy link
Owner

kiall commented Mar 11, 2017

I think I'm OK without access, the muxdump you provided reproduces the issue, just want to get a sanity check before spending more time chasing a possible red herring ;)

@xi784
Copy link
Author

xi784 commented Mar 11, 2017

hehe .. ok :)

@kiall
Copy link
Owner

kiall commented Mar 11, 2017

Possibly related to #117

@xi784
Copy link
Author

xi784 commented Mar 11, 2017

Ok.. when disable the FFMpeg Audio Renderer:
On Nexus Player only get Streaming by channels with stereo but without audio
Channels with 5.1 dont start.

On Shield the same but streaming starts with "unsupported audio track" on 5.1 content.

@kiall
Copy link
Owner

kiall commented Mar 11, 2017

Humm. Could you grab some logcat's from the devices as you change onto these channels? (annotated with what device and what the issue was!)

@kiall
Copy link
Owner

kiall commented Mar 11, 2017

Or - If you know how IRC works, join #android-tvheadend on FreeNode and can PM me server details there to have a check myself - that said, I likely won't get to login + test today...

@xi784
Copy link
Author

xi784 commented Mar 12, 2017

ac3_new.zip
Shield log - mediacodecinfo unsupported while ffmpeg disabled

Did some channel changes for more details

@kiall
Copy link
Owner

kiall commented Mar 12, 2017

So, this appears to be an ExoPlayer (or FFMpeg?) bug, I've filed a bug with ExoPlayer google/ExoPlayer#2552.

For now, as a workaround, if your Android Box, TV itself, or audio receiver (if you have one) supports native AC3 decoding, then running through the app setup, disabling the FFMpeg extension in the settings, and rebooting for the changed setting to take effect should workaround the issue.

@xi784
Copy link
Author

xi784 commented Mar 13, 2017

and reproduces too on:

  • Nexus Player 7.1.1 (NMF26X)
  • Sony Bravia XD8505 (AndroidTV 6.01)

@kiall
Copy link
Owner

kiall commented Mar 14, 2017

5e9e468 re-orders things a little, if you're on a device with a native AC3 decoder, that will now be used instead of FFmpeg, and this issue should disappear.

However, very few devices actually ship an AC-3 decoder (even the more $$ ones, like the Shield)

kiall added a commit that referenced this issue Apr 29, 2017
kiall added a commit that referenced this issue Apr 29, 2017
kiall added a commit that referenced this issue Apr 29, 2017
@xi784
Copy link
Author

xi784 commented Jul 24, 2017

Think we have to reopen it, same issue on layout switch 2ch to 5.1 and back again.
Picture gets stuttering and freeze.

Channel change helps and passthrough audio.

sample.ts approx sec 40~
https://drive.google.com/file/d/0BxP1VJf8kaXoSkpidGFpMURkMzg/view?usp=sharing

using develop build #.23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants