Opened 2 years ago

Closed 3 months ago

Last modified 3 months ago

#13158 closed Bug Report - General (Invalid)

Frontend abort when recording resolution changes with external themes

Reported by: Alex Halovanic <halovanic@…> Owned by: Peter Bennett
Priority: minor Milestone: unknown
Component: MythTV - Video Playback Version: v29-fixes
Severity: medium Keywords: theme resolution
Cc: Ticket locked: no

Description

After the upgrade to 29, I noticed that mythfrontend will abort in the middle of recording playback. It is reproducible under the following conditions:

  • Using a theme other than the ones shipped with MythTV (MythCenter?, MythCenter?-wide, Terra)
  • Reaching a point in the recording where the resolution changes, such as 1080i -> 720p or vice versa, commonly seen in commercial breaks or program changes, depending on channel.

I have reproduced this consistently with Steppes, Mythbuntu, Arclight and TintedGlass?. This also occurs under both VDPAU and OpenGL playback, The stock themes are consistently unaffected.

I have been unable to gather a stacktrace: I don't think it's actually crashing, just aborting playback and closing mythfrontend:

Cannot make QOpenGLContext current in a different thread
2017-10-25 20:07:58.729655 W  MythPainter: 3 images not yet de-allocated.
2017-10-25 20:07:58.729669 I  VDPAU Painter: Clearing VDPAU painter cache.
2017-10-25 20:07:58.797466 I  Clearing OpenGL painter cache.
Handling Aborted
Aborted

I'll also add that I am not configuring Mythfrontend to switch X resolutions or refresh rates automatically here: X remains unchanged. Furthermore, the OSD is not up when this occurs, nor does it try to display, so the theme isn't displaying anything.

I saw a few changes to add new screens to the shipped themes in 29 but didn't see anything that was marked as breaking that would require all other themes to be updated.

Attachments (1)

output-qt (8.4 KB) - added by Jarno Suni 3 months ago.
Using QT theme engine there are some errors, but it can play the sample anyway

Download all attachments as: .zip

Change History (17)

comment:1 Changed 23 months ago by Peter Bennett

Component: MythTV - GeneralMythTV - Video Playback
Owner: set to Peter Bennett
Status: newassigned

comment:2 Changed 23 months ago by Roger Siddons

Furthermore, the OSD is not up when this occurs, nor does it try to display, so the theme isn't displaying anything

Could you clarify ? Is com-skipping active ?

The OSD gets 'reset' on every resolution change. If it coincides with a com-skip notification (or subtitle) the OSD can be reset before it is seen. Just because you don't see anything it doesn't mean the OSD isn't active!

That doesn't explain why it only happens on certain themes. Just saying it could be OSD-related (player thread doing OpenGL whilst resetting OSD ?)

comment:3 Changed 23 months ago by Peter Bennett

There is a known issue with VAAPI. Changing resolutions in mid stream stops playback. Your message in the log is a symptom of this (Cannot make QOpenGLContext current in a different thread). However this should not affect VDPAU and should not be related to the theme.

You could try changing the theme painter to QT and see if this resolves the problem. Note that you cannot use QT theme painter together with OpenGL Rendering, but QT theme painter with VDPAU rendering should work.

comment:4 Changed 23 months ago by Alex Halovanic <halovanic@…>

This occurs with commercial skip totally disabled (no notify). It is also happening in the middle of commercial breaks. and there are no subtitles.

Changing the theme painter to QT does appear to cure this. The abort occurs under OpenGL 2 and 1 theme painters only.

comment:5 Changed 23 months ago by Peter Bennett

I retested this and the only time I see it happen is with VAAPI playback selected. Please check your playback profile (frontend->Setup->Video->Playback) Check the current video playback profile. Which playback profiles fail at the resolution change?

Never mind, I see in your description you mention OpenGL and VDPAU profiles. I am not sure where to go with this, as I can only see it with VAAPI.

Last edited 23 months ago by Peter Bennett (previous) (diff)

comment:6 Changed 23 months ago by Peter Bennett

Status: assignedinfoneeded

comment:7 Changed 17 months ago by Peter Bennett

Owner: changed from Peter Bennett to Peter Bennett

comment:8 Changed 7 months ago by Peter Bennett

Resolution: Works for me
Status: infoneededclosed

comment:9 Changed 3 months ago by Jarno Suni

I have something similar with mythtv-frontend version 2:29.1+fixes.201906130900.c3f7e46~ubuntu18.04.1

I am using VDPAU. And the following happens in the middle of playing a HD recording from a non-commercial channel. Changing theme to one shipped with MythTV or changing theme engine to Qt works around this.

2019-06-26 15:14:08.420840 I  TV::TV(): Creating TV object
2019-06-26 15:14:08.468333 N  Suspending idle timer
2019-06-26 15:14:08.493018 I  TV::Init(): Created TvPlayWindow.
2019-06-26 15:14:08.545806 I  TV::HandleStateChange(): Attempting to change from None to WatchingPreRecorded
2019-06-26 15:14:08.659797 E  ALSA: snd_pcm_info_get_card: Operation not permitted
2019-06-26 15:14:08.683942 N  AudioPlayer: Enabling Audio
2019-06-26 15:14:09.629335 I  AFD: codec AC3 has 2 channels
2019-06-26 15:14:09.629775 I  AFD: Opened codec 0x5596967fd820, id(AC3) type(Audio)
2019-06-26 15:14:09.629830 I  AFD: codec AC3 has 2 channels
2019-06-26 15:14:09.630231 I  AFD: Opened codec 0x559690d03640, id(AC3) type(Audio)
2019-06-26 15:14:09.669847 I  AFD: Opened codec 0x559690e30180, id(H264) type(Video)
2019-06-26 15:14:09.682576 I  AOBase: Opening audio device 'pulse' ch 2(2) sr 48000 sf 32 bit floating point reenc 0
2019-06-26 15:14:10.608485 I  Clearing OpenGL painter cache.
2019-06-26 15:14:10.856882 I  VDPAU: Created 2 output surfaces.
2019-06-26 15:14:10.856909 I  VDPAU: Created VDPAU render device 1920x1080
2019-06-26 15:14:11.013966 N  Player(9): Forcing decode extra audio option on (Video method requires it).
2019-06-26 15:14:11.165048 I  VidOutVDPAU: Added 2 new buffers. New buffer size 16 (4 decode and 12 process)
2019-06-26 15:14:11.740874 I  Player(9): Video timing method: USleep with busy wait
2019-06-26 15:14:11.741178 I  TV::StartPlayer(): Created player.
2019-06-26 15:14:11.741254 I  TV::HandleStateChange(): Changing from None to WatchingPreRecorded
2019-06-26 15:14:11.867692 I  TV::HandleStateChange(): Main UI disabled.
2019-06-26 15:14:11.867752 I  TV::StartTV(): Entering main playback loop.
2019-06-26 15:14:11.868232 I  ScreenSaverX11Private: DPMS Deactivated 1
2019-06-26 15:14:11.871977 I  VDPAU: Added 2 output surfaces (total 4, max 4)
2019-06-26 15:14:18.392123 I  AFD: codec AC3 has 0 channels
2019-06-26 15:14:18.392574 I  AFD: Opened codec 0x7f0430008a20, id(AC3) type(Audio)
2019-06-26 15:14:18.392629 I  AFD: codec AC3 has 0 channels
2019-06-26 15:14:18.392995 I  AFD: Opened codec 0x7f0430036ea0, id(AC3) type(Audio)
2019-06-26 15:14:18.393037 I  AFD: codec AC3 has 0 channels
2019-06-26 15:14:18.393402 I  AFD: Opened codec 0x7f04300377c0, id(AC3) type(Audio)
2019-06-26 15:14:18.464713 I  VDPAU Painter: Clearing VDPAU painter cache.
2019-06-26 15:14:18.493986 N  Player(9): Waited 102ms for video buffers                 
Cannot make QOpenGLContext current in a different thread
2019-06-26 15:14:18.555419 I  Clearing OpenGL painter cache.
2019-06-26 15:14:18.566234 C  Received Aborted: Code -6, PID 4555, UID 1000, Value 0x00000000
2019-06-26 15:14:18.666397 I  TV::StartTV(): Exiting main playback loop.
2019-06-26 15:14:18.778156 W  Player(9): Waited 100ms for decoder to pause
2019-06-26 15:14:18.878320 W  Player(9): Waited 100ms for decoder to pause
2019-06-26 15:14:18.978477 W  Player(9): Waited 100ms for decoder to pause
2019-06-26 15:14:19.078644 W  Player(9): Waited 100ms for decoder to pause
2019-06-26 15:14:19.178816 W  Player(9): Waited 100ms for decoder to pause
2019-06-26 15:14:19.278956 W  Player(9): Waited 100ms for decoder to pause
2019-06-26 15:14:19.379133 W  Player(9): Waited 100ms for decoder to pause
2019-06-26 15:14:19.479305 W  Player(9): Waited 100ms for decoder to pause
Aborted (core dumped)
2019-06-26 15:21:15.630306 I  TV::TV(): Creating TV object
2019-06-26 15:21:15.695359 N  Suspending idle timer
2019-06-26 15:21:15.734206 I  TV::Init(): Created TvPlayWindow.
2019-06-26 15:21:15.801168 I  TV::HandleStateChange(): Attempting to change from None to WatchingPreRecorded
2019-06-26 15:21:16.157318 E  ALSA: snd_pcm_info_get_card: Operation not permitted
2019-06-26 15:21:16.197583 N  AudioPlayer: Enabling Audio
2019-06-26 15:21:17.328317 I  AFD: codec AC3 has 2 channels
2019-06-26 15:21:17.328795 I  AFD: Opened codec 0x558da4437c40, id(AC3) type(Audio)
2019-06-26 15:21:17.328912 I  AFD: codec AC3 has 2 channels
2019-06-26 15:21:17.329279 I  AFD: Opened codec 0x558da43b7000, id(AC3) type(Audio)
2019-06-26 15:21:17.423915 I  VDPAU: Version 1
2019-06-26 15:21:17.423940 I  VDPAU: Information NVIDIA VDPAU Driver Shared Library  340.107  Thu May 24 21:44:57 PDT 2018
2019-06-26 15:21:17.457344 I  AFD: Opened codec 0x558da4439600, id(H264) type(Video)
2019-06-26 15:21:17.519642 I  AOBase: Opening audio device 'pulse' ch 2(2) sr 48000 sf 32 bit floating point reenc 0
2019-06-26 15:21:19.457304 I  Clearing OpenGL painter cache.
2019-06-26 15:21:19.719961 I  VDPAU: Created 2 output surfaces.
2019-06-26 15:21:19.719990 I  VDPAU: Created VDPAU render device 1920x1080
2019-06-26 15:21:19.976046 N  Player(0): Forcing decode extra audio option on (Video method requires it).
2019-06-26 15:21:20.120744 I  Player(0): Video timing method: USleep with busy wait
2019-06-26 15:21:20.121726 I  TV::StartPlayer(): Created player.
2019-06-26 15:21:20.121814 I  TV::HandleStateChange(): Changing from None to WatchingPreRecorded
2019-06-26 15:21:20.143702 I  TV::HandleStateChange(): Main UI disabled.
2019-06-26 15:21:20.144219 I  TV::StartTV(): Entering main playback loop.
2019-06-26 15:21:20.167838 I  VidOutVDPAU: Added 2 new buffers. New buffer size 16 (4 decode and 12 process)
2019-06-26 15:21:20.253123 N  Player(0): Waited 101ms for video buffers AAAAAAAAAAALLLLL
2019-06-26 15:21:20.356657 I  VDPAU: Added 2 output surfaces (total 4, max 4)
2019-06-26 15:21:31.693677 I  AFD: codec AC3 has 0 channels
2019-06-26 15:21:31.694181 I  AFD: Opened codec 0x7f03ac13ece0, id(AC3) type(Audio)
2019-06-26 15:21:31.694240 I  AFD: codec AC3 has 0 channels
2019-06-26 15:21:31.694613 I  AFD: Opened codec 0x7f03ac130a80, id(AC3) type(Audio)
2019-06-26 15:21:31.694658 I  AFD: codec AC3 has 0 channels
2019-06-26 15:21:31.695031 I  AFD: Opened codec 0x7f03ac144dc0, id(AC3) type(Audio)
2019-06-26 15:21:31.767479 W  MythPainter: 25 images not yet de-allocated.
2019-06-26 15:21:31.767514 I  VDPAU Painter: Clearing VDPAU painter cache.
Cannot make QOpenGLContext current in a different thread
2019-06-26 15:21:31.907763 I  Clearing OpenGL painter cache.
Handling Aborted
Aborted (core dumped)

comment:10 Changed 3 months ago by Jarno Suni

An extraction of the video the problem occurs with is uploaded here: https://www.dropbox.com/s/7ndvkgp470wdo7x/jukola_fail.ts?dl=0

I used this to extract the video:

$ ffmpeg -i 1022_20190615104500.ts -ss 00:00:00 -to 00:00:20 -c copy ../videos/jukola_fail.ts
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/i386-linux-gnu --incdir=/usr/include/i386-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --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-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[mpegts @ 0x1a96f00] PES packet size mismatch
    Last message repeated 2 times
[mpegts @ 0x1a96f00] Could not find codec parameters for stream 4 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from '1022_20190615104500.ts':
  Duration: 26:27:11.80, start: 211.922522, bitrate: 785 kb/s
  Program 1 
    Stream #0:0[0x32](fin): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
    Stream #0:1[0x138]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x35c](fin): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 448 kb/s
    Stream #0:3[0x361](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:4[0x1902]: Unknown: none ([5][0][0][0] / 0x0005)
Output #0, mpegts, to '../videos/jukola_fail.ts':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Stream #0:1(fin): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 448 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x1a96f00] New audio stream 0:5 at pos:13086680 and DTS:229.277s
frame=  481 fps=0.0 q=-1.0 Lsize=   13647kB time=00:00:19.98 bitrate=5594.0kbits/s speed=62.6x    
video:11482kB audio:1094kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.517421%

The frontend crashes when the scene changes in the video.

comment:11 Changed 3 months ago by Peter Bennett

Resolution: Works for me
Status: closednew

Please let me know which theme you are using when it fails. Also does the failure occur with your extracted sample file?

comment:12 Changed 3 months ago by Jarno Suni

I was using Mythbuntu 28.21 theme.

I am sorry, but I could not test the extracted file by mythfrontend, because the file does not show up in watch videos list even though another video that is also located in /var/lib/mythtv/videos is shown in the list.

comment:13 Changed 3 months ago by Jarno Suni

Oh, after I ran

mythutil --scanvideos

in the client, I could play the extracted video by mythfrontend. So I think the ffmpeg command did not extract identical video about the beginning of the program.

comment:14 Changed 3 months ago by Jarno Suni

Extracted part of the stream by dd. I can reproduce the bug by playing this in mythfrontend. https://www.dropbox.com/s/pdlp5mdogdw5j6k/jukola2.ts?dl=0

Changed 3 months ago by Jarno Suni

Attachment: output-qt added

Using QT theme engine there are some errors, but it can play the sample anyway

comment:15 Changed 3 months ago by Peter Bennett

Resolution: Invalid
Status: newclosed

I played your sample using mythbuntu theme and vdpau playback profile.

With MythTV 0.29 it crashes with an abort called from QOpenGLContext::makeCurrent , likely a result of the error message "Cannot make QOpenGLContext current in a different thread".

With MythTV 30 and master (pre-V31) also using mythbuntu and vdpau, I see first a silent movie of a kid climbing a tree, which abruptly changes to a sportscast with audio. There is no crash.

Since this is fixed in V30, I will not be looking into it further. My recommendation is to upgrade to V30. Alternatively stick with QT painter until you get V30.

comment:16 Changed 3 months ago by Jarno Suni

Ok, just that it is version 29, and there is also some audio in the first scene, but not speech. The recording was about Venlojen viesti 2019. (https://fi.wikipedia.org/wiki/Venlojen_viesti)

Note: See TracTickets for help on using tickets.