Opened 18 years ago

Closed 17 years ago

#1822 closed defect (fixed)

XvMC: Initial DVD menu not shown

Reported by: skamithi Owned by: skamithi
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

initial still frame containing language menu may be not displayed using the standard decoder. works with libmpeg2. problem is that dvd sends the still frame, then issues a dvd_stop. in the case presented, the initial video width was 640, but wants to change it to 720. during this process, the dvd resolution detection code in AFD drops the frame.. NVP quits because it is still in the process of starting..when this problem occurred.

working with the user who encountered this problem. doesn't affect me i haven't found a ntsc dvd with a language menu yet.. i think its only done in certain regions.

libmpeg2 has built-in resolution detection so it just works.

Attachments (10)

lang_menu_v1.patch (981 bytes) - added by skamithi 18 years ago.
xvmc_dvd_menus_attempt1.diff (14.2 KB) - added by skamithi 18 years ago.
attempt to resolve internal dvd player issues with XVmc. use XV when in dvd menu..turn XVMC back on when watching the main title.
xvmc_dvd_menu_attempt2.diff (14.2 KB) - added by skamithi 18 years ago.
thx to robin for testing. another variable in mpeg12 needed to be reinitialized when switching back to XV from Via XVMC.
xvmc_dvd_menu_attempt3.diff (12.3 KB) - added by skamithi 18 years ago.
attempt 3. basically attempt 2 patch, cleaned up... with some changes to dvdringbufferpriv. added seekLock mutex so only on thread can access the seek function at any time. It actually fixed the problem I noted with mergedFB in #2215. It may actually fix the original problem reported in #2215..who knows :)
roman-holiday-main-feature.log.gz (26.9 KB) - added by gnassas@… 18 years ago.
roman-holiday-making-of.log.gz (29.6 KB) - added by gnassas@… 18 years ago.
roman-holiday-backtrace.txt.gz (1.3 KB) - added by gnassas@… 18 years ago.
release_avf_buffer_xvmc, hmmm.…
roman-holiday-unstripped-backtrace.txt.gz (1.2 KB) - added by gnassas@… 18 years ago.
fix_for_latest_problem.diff (3.4 KB) - added by skamithi 17 years ago.
robin reported that initcodec is called too many times on a certain dvd causing blue screen. attaching small rewrite to the patch to prevent this.
fix_for_latest_problem.2.diff (3.4 KB) - added by skamithi 17 years ago.
fix for latest problem doesn't work. made small correction. tested correction.. works for me.

Download all attachments as: .zip

Change History (32)

Changed 18 years ago by skamithi

Attachment: lang_menu_v1.patch added

comment:1 Changed 18 years ago by skamithi

patch works with Xv. Robin Gilks provided me with an iso of a dvd menu and it had a language menu. Patch doesn't completely resolve his issue. From the debugs he provided, looks like XvMC VideoOutputXv::UpdatePauseFrame? drops the frame. It reports the following, then discards the still frame.

VideoOutputXv: UpdatePauseFrame -- XvMC: Found a pause frame in display
2006-05-22 18:58:36.829 VideoOutputXv: Frame A is in use by avlib and so is being held for later discarding

i don't use XvMC so can't solve his problem.

comment:2 Changed 18 years ago by skamithi

Resolution: fixed
Status: newclosed

(In [9981]) Closes #1822. fix for language menu not displayed problem with ffmpeg decoder works with Xv.

comment:3 Changed 18 years ago by g8ecj@…

Component: mythtvmythdvd
Resolution: fixed
Status: closedreopened
Version: head

Still fails under XvMC - both nvidia and Via VLD. r10012

Logs (LARGE!) can be found at http://gilks.ath.cx/~g8ecj/Stanley/ as can an ISO image of a DVD that causes the problem. The logs are for Standard (ffmpeg), libmpeg2 and XvMC (nvidia). The extra debug lines in the trace are from the patch Stanley asked me to apply (also available for download).

In addition to the initial menu not displaying correctly, for ffmpeg and libmpeg2 the videos I've replaced with a still image cause the player to lock up completely.

Please only download the ISO image if you REALLY need it - I pay per gig here!!

comment:4 Changed 18 years ago by Isaac Richards

Component: mythdvdmythtv

comment:5 Changed 18 years ago by Isaac Richards

Owner: changed from skamithi to danielk
Status: reopenednew

Daniel, issue with XvMC remaining with DVD menus & still frames. Stanley's not that familiar with XvMC..

comment:6 Changed 18 years ago by danielk

Robin, is there any way you can create a smaller DVD iso for testing?

comment:7 Changed 18 years ago by danielk

Summary: initial dvd language menu may not be displayed using standard decoder . dvd playback just quits.XvMC: Initial DVD menu not shown

comment:8 Changed 18 years ago by danielk

(In [10105]) Refs #1822. Fixes some auxiliary problems around the still frame in XvMC problem.

The reorders the fallback decoders so that XVideo follows XvMC, instead of Xlib. This overrides the resolution for GetBestSupportedCodec?() so it is at least 16x16 pixels. This also adds some debugging for UpdatePauseFrame?().

comment:9 Changed 18 years ago by danielk

I'm punting this for now.

It appears the problem is that XvMC pause consumes frames, so we try to get the displayed frame rather than the used frame, so we end up with the still frame previous to the one we really want. If we try to get a used frame instead, then we consume it show it will just flash on screen and then go away.

If I'm right about the problem, there are four ways to go about fixing this:

  1. Change the avlib decoding so that it redecodes the still frame as if it were a video.
  2. Implement a pause frame implementation for XvMC which copies the frame. This might be doable by with BLEND_SUBPICTURE compositing, by compositing the frame with a blank OSD, with BACKEND_SUBPICURE I don't know how you would do it.
  3. Use another decoder to decode still frames, and use the XvImage? supported by all XvMC implementations I know of; or simply use X11 paint calls and block XvMC display. This will problably require some additional hacking to get OSD to work.
  4. Implement some special UpdatePauseFrame? for still frames which avoids consuming frames by some kind of VideoBuffers? frame accounting trickery.

None of these are very simple. If #2 is possible it is probably the best solution.

There is another possible hack, which is to just disable XvMC for DVDs. If no one else is interested in fixing this, I can apply that hack as the fix...

comment:10 Changed 18 years ago by g8ecj@…

I've not got enough mips in my frontend to play DVDs with anything other than XvMC (Via Epia). I think option 3 (if I understand what you're saying) so that you just turn off XvMC for the menus (a quick flicker as modes change when the main feature is selected works for me) - i.e. switch to Xv during (still) menus only.

comment:11 Changed 18 years ago by danielk

Milestone: 0.200.21

comment:12 Changed 18 years ago by skamithi

Owner: changed from danielk to skamithi

attaching patch which switches between Xv and XVMC depending on which whether you are in the dvd menu or not.

need testers, as my time on a XVMC capable PC is very limited. Patch is a debug patch with lots of debug messages. If it crashes, or has issues, pls send me the -v playback and backtrace.

Changed 18 years ago by skamithi

attempt to resolve internal dvd player issues with XVmc. use XV when in dvd menu..turn XVMC back on when watching the main title.

Changed 18 years ago by skamithi

Attachment: xvmc_dvd_menu_attempt2.diff added

thx to robin for testing. another variable in mpeg12 needed to be reinitialized when switching back to XV from Via XVMC.

comment:13 Changed 18 years ago by skamithi

Status: newassigned

patch will be cleaned up and committed once robin confirms it works for him.

Changed 18 years ago by skamithi

Attachment: xvmc_dvd_menu_attempt3.diff added

attempt 3. basically attempt 2 patch, cleaned up... with some changes to dvdringbufferpriv. added seekLock mutex so only on thread can access the seek function at any time. It actually fixed the problem I noted with mergedFB in #2215. It may actually fix the original problem reported in #2215..who knows :)

comment:14 Changed 18 years ago by skamithi

(In [11607]) Refs #1822. improves xvmc internal dvd player support. uses XV when in dvd menu and XVMC when in the main title. see ticket for more details.

comment:15 Changed 18 years ago by skamithi

robin confirms [11607] doesn't cause a problem and resolves his issue. leaving case open for a couple of weeks to fix any bugs I missed.

comment:16 Changed 18 years ago by gnassas@…

I tried the xvmc_dvd_menu_attempt2.diff patch against .20-fixes with Roman Holiday and the menus now render correctly. However, if I try to play anything I get an immediate crash. Logs attached for the main and making of titles.

Changed 18 years ago by gnassas@…

Changed 18 years ago by gnassas@…

comment:17 Changed 18 years ago by skamithi

final commit [11607] resolves your issue. robin had the same crash.

comment:18 Changed 18 years ago by skamithi

oh sorry.. made a mistake..pls attach the backtrace..

Changed 18 years ago by gnassas@…

release_avf_buffer_xvmc, hmmm....

comment:19 Changed 18 years ago by skamithi

invalid backtrace. recompile myth with the debug option. also suggest u upgrade to svn and test since the crash appears to be in ffmpeg. there have been ffmpeg updates and a couple of other changes since 0.20 came out.

Changed 18 years ago by gnassas@…

comment:20 Changed 17 years ago by skamithi

i don't run 0.20 fixes.. so i would suggest that you upgrade to svn to test. i will not port this change to 0.20 fixes because it doesn't work for you.

comment:21 Changed 17 years ago by skamithi

(In [11689]) internal dvd player. fix problem where audio stutters during chapter jumps. Refs #1822, add debug regarding dvd codec/stream change. disable frame-by-frame jump when watching a dvd (problem found by john poet).

Changed 17 years ago by skamithi

Attachment: fix_for_latest_problem.diff added

robin reported that initcodec is called too many times on a certain dvd causing blue screen. attaching small rewrite to the patch to prevent this.

Changed 17 years ago by skamithi

fix for latest problem doesn't work. made small correction. tested correction.. works for me.

comment:22 Changed 17 years ago by skamithi

Resolution: fixed
Status: assignedclosed

(In [11704]) Closes #1822. small correction to the patch. fixed problem where where afd::scanstream() is incorrectly executed causing stuttering or continuous blue screen.

Note: See TracTickets for help on using tickets.