|
|
#1201 | ||||
|
Moderator
Join Date: Aug 2005
Posts: 1,327
|
If an application doesn't want a frame displayed, it should not be placed into the presentation queue. The presentation queue's job is to display what the application tells it to, not to perform frame-rate conversion.
Quote:
You don't. Frames that are displayed remain displayed until replaced. Quote:
Quote:
Quote:
Arguments re: the frame rate changing apply equally to querying the frame rate through VDPAU or any other mechanism; even if VDPAU was extended with an API to query frame rate, VDPAU would not sent an event/callback/... to the application if the frame rate changed. Also note that NVIDIA's VDPAU implementation does not survive mode-switches anyway. |
||||
|
|
|
|
|
#1202 | ||||||
|
Registered User
Join Date: Sep 2009
Posts: 45
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
||||||
|
|
|
|
|
#1203 | |
|
Registered User
Join Date: Jul 2009
Posts: 11
|
Quote:
My patches get the time between vsyncs by queuing surfaces to the presentation queue and read when they are displayed. Timing over 3 vsyncs I can get micro second precision when overlay is used, and millisecond precision when blitting is used. It would be much easier to have just an api to fetch the time between two vsyncs. With my method there is a delay before vsync timing can be calculated delaying showing of movie. My patches also uses the time of last vsync (gotten from query time last surface was displayed by the presentation queue) to adjust speed of movie to match speed of display. Here it also be simpler if a direct call to get time of last vsync existed. My next planned step is to use my knowledge of when last vsync occurred and time between vsyncs to make better decisions when to queue a frame for display and when to drop a frame. Like uau talked about. To decode more then one frame in advance should also be possible, without changing that much in mplayer. I planned to look at that next. |
|
|
|
|
|
|
#1204 | ||
|
Moderator
Join Date: Aug 2005
Posts: 1,327
|
Quote:
Quote:
I don't see why not. Obviously the application needs to be aware which display device is being used so as to operate correctly - i.e. use timing information from the correct display. |
||
|
|
|
|
|
#1205 | |
|
Moderator
Join Date: Aug 2005
Posts: 1,327
|
Quote:
I hope our driver fully implements that API now that I've mentioned it:-) |
|
|
|
|
|
|
#1206 | |
|
Registered User
Join Date: Jul 2009
Posts: 11
|
Quote:
Sorry. By sync display to source you mean that if I have a 24.123hz movie the display should be changed to 24.123hz? As most display only allow a few refresh rate settings, this will not work for most displays. The only thing you can do is to adjust movie frame rate to match display refresh rate. That is what my patch tries to do. |
|
|
|
|
|
|
#1207 | |||
|
Registered User
Join Date: Sep 2009
Posts: 45
|
Quote:
Quote:
Quote:
|
|||
|
|
|
|
|
#1208 | ||
|
Registered User
Join Date: May 2007
Posts: 72
|
[quote=danoscar;2094755]As I do not have SPDIF I cannot debug what goes wrong for you.
Sorry.[/QUOTE I really appreciate Your w willingness to help ! Quote:
-perfect A/V sync (constant sync over hours of playback) -no judder This is only IMHO proper solution. Fortunately most of content has fps from limited pool of possible values: 23.967, 23.98, 24, 25, 30. 50 & 60 are integer multiplies of 25 & 30 so no problem with judder. Quote:
In PC enviroment it is indeed difficult, so workarround might be based i.e. on free runing of decode and displaying and making sure about speed accuracy. I.e. 0.1% inaccuracy in speeds causes judder for every 1.76sec. Assuming that judder with period of tenths of sec is quite unnoticeable - we have to have 0.01% absolute accuracy for player AND display clocks. So now questions about PLL absolute accuracy arises... Unfortunately any -even small error - in speed is additive, so it is possible that after hours of playback A/V desync will be noticeable. Solutions i.e. with frame dropping for keeping A/V sync by monitoring buffer occupancy are IMHO good compromise: acceptable to implement and maybe acceptable judder. Look: my 23.976 fps move displayed on 24Hz TV has easy noticeable judder for every 1.76 sec. It is visible so easy, that many watches asked me: what is wrong ? Also Your solution with playback speed adjustments is really nice. It's pity that for SPDIF it has issues. BTW: I'm surprised by that - taking into account that for analog it works -> mans that D/A converters are able to be clocked faster by few percents. Maybe SPDIF issue is in fact pointing to ALSA spdif non-optimal implementation... |
||
|
|
|
|
|
#1209 | |||
|
Moderator
Join Date: Aug 2005
Posts: 1,327
|
Quote:
And again I re-iterate: The application should be aware of what it's doing and what the presentation queue's capabilities are. The application is the only software in possession of complete knowledge required to choose the correct frames to skip. Quote:
Quote:
|
|||
|
|
|
|
|
#1210 | ||||
|
Registered User
Join Date: Sep 2009
Posts: 45
|
Quote:
Quote:
Quote:
Quote:
|
||||
|
|
|
|
|
#1211 | |
|
Registered User
Join Date: Dec 2004
Location: Mountain Ranch CA USA
Posts: 3
|
Quote:
MB: ASUS P5N7A-VM CPU: Intel Core 2 Duo E8400 Wolfdale 3.0GHz 6MB L2 Cache LGA 775 GPU: nVidia MCP79 Host Bridge Video: nVidia GeForce 9300/nForce 730i Audio: Realtek ALC1200 Sony KDL 40V3000 LCD 1920x1080 @60HZ Connected to PVR via HDMI Mplayer: -ao alsa::device=hw=0.3 -vo vdpau -vc ffmpeg12vdpau |
|
|
|
|
|
|
#1212 |
|
Registered User
Join Date: Sep 2009
Posts: 45
|
I implemented smart frame dropping/timing functionality for MPlayer's VDPAU driver to work around the frame rate limitation and avoid jitter due to unstable timing. The code is currently in a temporary branch but can be tested as follows:
First do 'git clone git://repo.or.cz/mplayer-build.git' and build as normal (following the README). Then to switch to the new timing code go to the 'mplayer' subdirectory and run 'git checkout origin/tmp_vdpau' and run make again (you can run it in the subdirectory if you did a top-level compile before; running it at the top level again works too, just recompiles more things than needed). I'll change the build repo to use this code by default after some more testing and other changes. Below is the log message of the main commit with more detail: Implement vblank-aware frame timing for VDPAU Main things added are custom frame dropping for VDPAU to work around the display FPS limit, frame timing adjustment to avoid jitter when video frame times keep falling near vblanks, and use of VDPAU's timing feature to keep one future frame queued in advance. NVIDIA's VDPAU implementation refuses to change the displayed frame more than once per vblank. This set a limit on how much video could be sped up, and caused problems for nearly all videos on low-FPS video projectors (playing 24 FPS video on a 24 FPS projector would not work reliably as MPlayer may need to slightly speed up the video for AV sync). This commit adds a framedrop mechanism that drops some frames so that no more than one is sent for display per vblank. The code tries to select the dropped frames smartly, selecting the best one to show for each vblank. Because of the timing features needed the drop functionality currently does not work if the correct-pts option is disabled. The code also adjusts frame timing slightly to avoid jitter. If you for example play 24 FPS video content on a 72 FPS display then normally a frame would be shown for 3 vblanks, but if the frame times happen to fall near vblanks and change between just before and just after then there could be frames alternating between 2 and 4 vblanks. The code changes frame timing by up to one quarter vblank interval to avoid this. The above functionality depends on having reliable vblank timing information available. This is not directly provided by the VDPAU API, but can be deduced from the frameflip timing information provided by VDPAU. The code calculating this is somewhat tricky but should work quite robustly as long as the per-frame timing information is precise. It works without needing any separate measurement phase and can handle changes in display FPS in the middle of playback. After the changes in this commit MPlayer now always tries to keep one frame queued for future display using VDPAU's internal timing mechanism (however no more than 50 ms to the future). This should make video playback somewhat more robust against timing inaccuracies caused by system load. |
|
|
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| xorg locks-up with newest nvidia drivers w/ vdpau. | theroot | NVIDIA Linux | 1 | 06-24-12 11:04 AM |
| NVIDIA VDPAU Reference Benchmarks | News | Latest Tech And Game Headlines | 0 | 06-11-12 05:30 AM |
| VDPAU and KDE 4.8 compositing = slow | Pie-rate | NVIDIA Linux | 30 | 05-23-12 07:07 AM |
| VDPAU testing tool | crisalide | NVIDIA Linux | 392 | 04-29-12 06:01 PM |
| mplayer & xmms problems! | replys2me | NVIDIA Linux | 5 | 09-06-02 02:34 PM |