Opened 5 years ago

Closed 2 years ago

Last modified 2 years ago

#12318 closed Bug Report - General (fixed)

Live-TV stuttering before pausing for a few seconds

Reported by: Jan Vogelsang <j.d.vogelsang@…> Owned by: Peter Bennett
Priority: minor Milestone: 30.0
Component: MythTV - General Version: 0.27-fixes
Severity: medium Keywords:
Cc: david.birch@…, veehexx@… Ticket locked: no

Description

Similar problem to #10428. After switching to Live-TV the playback stutters. In the logfile I get

2014-11-10 21:23:08.586263 N Player(5): Waited 102ms for video buffers AAAAAAAAAAAAAAAAAAAAAAAAAUUUuuLP 2014-11-10 21:23:08.703112 N Player(5): Waited 219ms for video buffers AAAAAAAAAAAAAAAAAAAAAAAAAUUUuuLP 2014-11-10 21:23:08.820002 N Player(5): Waited 335ms for video buffers UuUULAAAAAAAAAAAAAAAAAAAAUUUUUUP 2014-11-10 21:23:09.036950 N Player(5): Waited 103ms for video buffers UUUUuUULUuAAAAAAAAAAAAAAAAAAAUUP 2014-11-10 21:23:09.137124 N Player(5): Waited 204ms for video buffers UUUUuUULUuAAAAAAAAAAAAAAAAAAAUUP 2014-11-10 21:23:09.270662 N Player(5): Waited 102ms for video buffers AUAUUUUUUUuUULAAAAAAAAAAAAAAAAAP 2014-11-10 21:23:09.571171 N Player(5): Waited 105ms for video buffers AAAAAAAUUUUUUuUULUuAAAAAAAAAAAAP 2014-11-10 21:23:10.155404 N Player(5): Waited 105ms for video buffers UAUuAAAAAAAAAAAAAAAAAAUUUUUUuULP 2014-11-10 21:23:11.490864 N Player(5): Waited 105ms for video buffers UAUUAUuAAAAAAAAAAAAAAAUAAUUUuULP 2014-11-10 21:23:13.794540 N Player(5): Waited 105ms for video buffers UAUUAAAAAAAAAUAAUAAUAAuAULUUAUAP 2014-11-10 21:23:16.081592 N Player(5): Waited 105ms for video buffers UAAAUAAUAAUAAuAALAAAAUAUUAUUAUAP 2014-11-10 21:23:16.465456 N Player(5): Waited 105ms for video buffers AAUUAUUAUUAULUAAUAAUAAuAALAAAAAP

After pausing the playback for a second it works fine.

Maybe "float secs_min = 0.35;"

https://github.com/MythTV/mythtv/commit/483e06f6b8a9066f66cef3fcf0a5f844519f51f9

should be increased even more?

Best regards Jan

MythTV Version : e4f65c8 MythTV Branch : fixes/0.27 Network Protocol : 77 Library API : 0.27.20140719-1 QT Version : 4.8.6 Options compiled in:

linux profile use_hidesyms using_alsa using_jack using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_crystalhd using_dvb using_firewire using_frontend using_hdhomerun using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xrandr using_xv using_profiletype using_mythlogserver using_bindings_perl using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2

Attachments (2)

20171108_#12318_stutter.patch (2.5 KB) - added by Peter Bennett 2 years ago.
Proposed fix
mythfrontend-stutter.log.tar.bz2 (30.6 KB) - added by mike.bibbings@… 2 years ago.
frontend log with stutter patch applied

Download all attachments as: .zip

Change History (22)

comment:1 Changed 5 years ago by mkgraham@…

I came to report that I experience the same issue. I'm running Arch Linux package version 0.27.4-2 as my backend, and I've experienced the issue while using the most recent 0.27 frontend for Windows, the 0.27 frontend in the most recent version of Mythbuntu, the 0.27 frontend from the same Archlinux package on the backend machine, and in the Windows version of XBMC. Live TV stutters when I start playback and to work around the issue I have to either pause live playback for a few seconds or I have to let it play a few seconds then rewind. Definitely has the appearance of playback following the recording too closely and trying to read data that hasn't been fully written yet.

comment:2 Changed 2 years ago by Peter Bennett

Owner: set to Peter Bennett
Status: newassigned

See thread here - some people are having this problem currently

http://lists.mythtv.org/pipermail/mythtv-users/2017-October/393467.html

comment:3 Changed 2 years ago by Peter Bennett

Cc: David Birch <david.birch@…> Tim Draper <veehexx@…> added

comment:4 Changed 2 years ago by Peter Bennett

Please can somebody who has this problem, run with

mythfrontend -v playback

let Live TV stutter for about 1 minute, save the log, put in a paste bin and let me know where it is.

comment:5 Changed 2 years ago by david.birch@…

hi Peter, sorry for delay, this is the diff - i had more issues with lower times. this was my quick hack that seems to give just enough change to not stutter

mythtv/mythtv/libs/libmythtv/ringbuffer.cpp

441,442c441 < float secs_min = 1.5; < ---

float secs_min = 0.3;

i'll add a paste shortly with log

comment:6 Changed 2 years ago by david.birch@…

comment:7 Changed 2 years ago by Peter Bennett

I see in your log that there are many ongoing messages that say "Player(0): Waiting for video buffers...", and these never stop. I assume these are related to the problem. I ran a test where I set that secs_min value to 0.01 and to 1.5. When I set it to 0.01 and played a HD live tv broadcast, the picture and sound are perfect, but I see the regular "Player(0): Waiting for video buffers..." messages that do not stop coming. When I set the higher value of 1.5 it still plays perfectly but I do not see those messages in the log.

If I pause for a second and then resume, there are a bunch of messages saying video is ahead of audio, dropping video frames, and then playback continues without any further "Waiting for video buffers" messages.

Please explain exactly what you mean by "stuttering". Is there interruption of the audio? Or is it some sort of video effect?

comment:8 Changed 2 years ago by Peter Bennett

Status: assignedinfoneeded

comment:9 Changed 2 years ago by Peter Bennett

Please perform this test (watch live tv with stuttering) for 30 seconds with the following options

mythfrontend -v audio,playback

I need to see the log output from that. Also please confirm if "stuttering" means audio interruptions.

comment:10 Changed 2 years ago by Peter Bennett

Changing float secs_min to 1.5 is not acceptable. It uses a default bitrate of 8000 to calculate the amount of buffering to do. It calculates a reasonable approximation to 1.5 seconds on high bitrate HD, but on low bitrate channels such as audio only, it results in buffering and waiting for 15 - 30 seconds, and the frontend times out before it get started.

My proposed patch forces a brief pause when the stutter condition is detected. There will be one or two brief pauses during the first 30 seconds of Live TV, which I hope is better than continuous stuttering. See attached patch. Please try this out and give feedback on whether it is acceptable and whether it fixes the problem.

Changed 2 years ago by Peter Bennett

Proposed fix

comment:11 Changed 2 years ago by Peter Bennett

Status: infoneededassigned

comment:12 Changed 2 years ago by Peter Bennett

Milestone: unknown30.0

comment:13 Changed 2 years ago by Peter Bennett

Status: assignedinfoneeded

Please can somebody test the attached patch and let me know whether it addresses this problem. I cannot verify it because I never see the stuttering with Live TV.

comment:14 Changed 2 years ago by Peter Bennett

Cc: david.birch@… veehexx@… added; David Birch <david.birch@…> Tim Draper <veehexx@…> removed

comment:15 Changed 2 years ago by Peter Bennett

I think the cc email addresses were in the wrong format, I have updated them.

comment:16 Changed 2 years ago by Peter Bennett

Comment from Tim Draper (veehexx)

bad news... since i reinstalled my FE on a new distro, it's no longer doing it, so cant really test it. I keep trying to get it to fail on the FE i was having issues with. could of also been related to upgrading all mythtv components to fixes/29 from fixes/28. fwiw, the FE i was having issues with was on mythbuntu 12.04 LTS & distro-sync upgrade to 16.04 LTS which both experienced the issue. i moved over to centos7 using the wiki info and no problems. (https://www.mythtv.org/wiki/Installing_MythTV_on_RHEL/CentOS#RHEL_7.x) i wonder if it's a distro issue rather than anything else. too much has changed for me to be sure.

i've not tried/recall having issues with HD livetv on my rpi3 (should be able to confirm that over the next few days) but I'd expect you, Peter, to have see issues in your extensive rpi work.

comment:17 Changed 2 years ago by mike.bibbings@…

Peter, I have applied the stutter patch to a recent master, a mythfrontend log (-v playback) is attached. As you will see the patch is being triggered, mainly on News channels with rolling straplines across the bottom of the screen and scrolling across the screen is now smooth, without the patch the picture stutters every so often, audio is not affected.

The patch has not broken anything as far as I can see.

Mike

Changed 2 years ago by mike.bibbings@…

frontend log with stutter patch applied

comment:18 Changed 2 years ago by Peter Bennett

Status: infoneededassigned

comment:19 Changed 2 years ago by Peter Bennett <pbennett@…>

Resolution: fixed
Status: assignedclosed

In dc66d7939b4b67c6a9b8127b47790f00c40d563c/mythtv:

Live TV: Fix stuttering when starting Live TV

Insert a brief pause in playback if Live TV playback is within
1.5 seconds of catching up to real time.

Fixes #12318

comment:20 Changed 2 years ago by Peter Bennett

Owner: changed from Peter Bennett to Peter Bennett
Note: See TracTickets for help on using tickets.