Smoothvideo ("Sync playback to display" feature) now merged in the mainline branch
#16
I was running version 20291. It seems I have quite similar problems to Hitchers, not exactly the same though, it could be ATI related...

Smoothvideo works fine playing 24fps material if I set my desktop refresh rate to 24hz BEFORE I start XBMC, so it's not all misery Wink However the Adjust Refresh Rate option is supposed to to this change automatically, but it fails Sad

If my desktop resolution isn't already set to 24Hz, the Adjust Refresh Rate function does change my desktop refresh rate to the correct 24Hz, but XBMC's fullscreen resolution stays at it's initial refresh rate value (60Hz). I can verify this by alt-tabbing while playing a movie. If I run XBMC without the -fs option, then the Adjust Refresh Rate function doesn't even seem to try to change the resolution.
----------------

Same problem with latest build:

13:10:48 T:43188 M:1182904320 NOTICE: Starting XBMC, Platform: Windows Vista, 32-bit Service Pack 1 build 6001. Built on May 16 2009 (SVN:20361, compiler 1500)
13:10:48 T:43188 M:1182904320 NOTICE: AMD Athlon™ Dual Core Processor 4850e
13:10:48 T:43188 M:1182904320 NOTICE: Desktop Resolution: 1920x1080 32Bit at 60Hz
...
13:10:48 T:43188 M:1181425664 NOTICE: Enabled debug logging due to GUI setting
13:10:48 T:43188 M:1181425664 NOTICE: Getting hardware information now...
13:10:48 T:43188 M:1181425664 INFO: Using digital output
13:10:48 T:43188 M:1181425664 INFO: AC3 pass through is enabled
13:10:48 T:43188 M:1181425664 INFO: DTS pass through is enabled
13:10:48 T:43188 M:1181425664 NOTICE: Checking resolution 12
13:10:48 T:43188 M:1181364224 NOTICE: Default DVD Player: dvdplayer
13:10:48 T:43188 M:1181364224 NOTICE: Default Video Player: dvdplayer
13:10:48 T:43188 M:1181364224 NOTICE: Default Audio Player: paplayer
13:10:48 T:43188 M:1181360128 NOTICE: special://masterprofile/sources.xml
13:10:48 T:43188 M:1181294592 DEBUG: Constructing surface 1920x1080, shared=00000000, fullscreen=1
13:10:48 T:43188 M:1158258688 NOTICE: GL_VENDOR = ATI Technologies Inc.
13:10:48 T:43188 M:1158242304 NOTICE: GL_RENDERER = ATI Radeon HD 3200 Graphics
13:10:48 T:43188 M:1158242304 NOTICE: GL_VERSION = 2.1.8395 Release
...
13:10:49 T:43188 M:1121308672 INFO: GUI format 1920x1080 1920x1080 @ 60.00Hz (Full Screen)
...
13:12:06 T:45972 M:1075593216 INFO: ffmpeg: Stream #0.0(eng): Video: h264, yuv420p, 1280x692, PAR 1:1 DAR 320:173, 23.98 tbr, 1k tbn, 47.95 tbc
13:12:06 T:28980 M:1074888704 DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
13:12:06 T:18168 M:1063026688 DEBUG: CDVDPlayerVideo::OutputPicture - change configuration. 1280x692. framerate: 23.98
13:12:06 T:18168 M:1063026688 NOTICE: Display resolution ADJUST : 1920x1080 @ 24.00Hz (42)
13:12:06 T:28980 M:1059057664 DEBUG: CVideoReferenceClock: CreateDevice returned D3DERR_DEVICELOST
13:12:06 T:28980 M:1059057664 DEBUG: CVideoReferenceClock: Setup failed, falling back to QueryPerformanceCounter
13:12:06 T:28980 M:1059057664 DEBUG: CVideoReferenceClock: Cleaning up Direct3d
-------------------------

...and in window mode:

13:53:41 T:30960 M:1180618752 NOTICE: Desktop Resolution: 1920x1080 32Bit at 60Hz
13:53:41 T:30960 M:1179013120 DEBUG: Constructing surface 1920x1080, shared=00000000, fullscreen=0
13:53:42 T:30960 M:1142870016 INFO: GUI format 1920x1080 1920x1080 @ 60.00Hz (Full Screen)
13:53:42 T:30960 M:1130491904 ERROR: unable to loadConfusedpecial://home/skin/Aeon/720p/Pointer.xml, Line 0
13:53:56 T:34876 M:1092116480 INFO: ffmpeg: Stream #0.0(eng): Video: h264, yuv420p, 1280x692, PAR 1:1 DAR 320:173, 23.98 tbr, 1k tbn, 47.95 tbc
13:53:56 T:44596 M:1091448832 DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
13:53:56 T:29672 M:1081085952 DEBUG: CDVDPlayerVideo::OutputPicture - change configuration. 1280x692. framerate: 23.98
13:53:56 T:29672 M:1081085952 NOTICE: Display resolution ADJUST : 1920x1080 @ 24.00Hz (42)
13:53:56 T:44596 M:1076633600 DEBUG: CVideoReferenceClock: CreateDevice returned D3DERR_DEVICELOST
13:53:56 T:44596 M:1076633600 DEBUG: CVideoReferenceClock: Setup failed, falling back to QueryPerformanceCounter
13:53:56 T:44596 M:1076633600 DEBUG: CVideoReferenceClock: Cleaning up Direct3d
#17
I put some updates in revision 20366, those might help, but if they don't then I'm out of ideas, there's nothing on the microsoft site about it other than the possibility of CreateDevice returning D3DERR_DEVICELOST.
#18
Thanks bobo1on1 for all of your hard work and congrats on the merge into the main branch.

I haven't bought a "24p" capable LCD yet and before I do I want to make sure that I can playback all of my 23.976 and 24 fps content smoothly with passthrough.

I read the entire original thread on Smoothvideo and still have some questions:

- Do I understand correctly that even if everything is set to 23.976 fps/hz (video itself, graphics driver (i.e. xorg.conf modeline), and TV), that Smoothvideo will round to the nearest integer (24) and thus require some handling for the audio (resampling or add/drop for passthrough)?

- How do the "1080/24p" blu-ray players and TVs handle 23.976 and 24fps content? Do the TVs all support both framerates or just one and the audio discrepancy is handled somehow?

Thanks!
#19
im still struggeling to understand that, but lemme say im impressed and thankfull for your work.

but just to get it straigt, this will only work with passtrough disabled? so no chance to get the audio in sync without loosing the capability to get ac3/dts out trough spdif until some sofware encoder is implemented?
#20
mason Wrote:im still struggeling to understand that, but lemme say im impressed and thankfull for your work.

but just to get it straigt, this will only work with passtrough disabled? so no chance to get the audio in sync without loosing the capability to get ac3/dts out trough spdif until some sofware encoder is implemented?
It depends on how close to exact refresh rates your monitor is able to get. If it's close by a 0.00x factor, you should probably get by with just skip. Which is what I do.
#21
Is there anyway to reset the clock after a video is done playing? I have found out that if I play a file that is encoded wrong that it will mess up the clock for every file thereafter until I quit out and restart XBMC.

For example I have episode(s) of Greys Anatomy that were recorded from TV and originally aired at 30fps but converted to 24fps for the file. I will assume it wasnt done correctly. When I play it and press "o" the missed vblank count is literally increased by every frame. So after a a few seconds are watched I have hundreds. So once I stop the file from playing and go back into XBMC's interface every file I play from there one out has the same high missed vblank count and becomes jerky. But if I play these files before the Greys Anatomy they play fine.

Edit: So after restarting XBMC and trying the process again so I can get a log it took a few tries to get the file to miss the vblanks. So Im not sure if I can blame the Greys Anatomy file. But after about 4-5 tries of playing random Greys Anatomy files it did it. Here is the log. The vblank reports happened on the last 2 files aplyed. So once this happens it will happen for every file player thereafter, no mater what the fps or type.

As you can see this is from SVN20365 for windows
Here is the log. Being too big (2M) for pastebin I uplaoded to rapidshare.
http://rapidshare.com/files/233770684/xbmc.log.html
#22
The clock is already reset after each video, you have a different problem:

Quote:13:05:34 T:1092 M:3041542144 DEBUG: Alloc resources: 1.17ms (0.00 ms skin load)
13:05:34 T:1092 M:3041804288 DEBUG: CTextureBundle::LoadFile, loading osdprogressback.png
13:05:34 T:1092 M:3041804288 DEBUG: CTextureBundle::LoadFile, loading osdprogressmid.png
13:05:34 T:1092 M:3041804288 DEBUG: CTextureBundle::LoadFile, loading seeksliderback.png
13:05:34 T:1092 M:3041542144 DEBUG: CTextureBundle::LoadFile, loading scrollbarnibfo.png

You've got thousands of those.
#23
Can those be from having the "o" display up while watching the video? Maybe the skin refeshing to keep up?

Im just lost on why the clock works fine for the first 5 tries then on the 6th and outward it gathers up during the playback of the whole video.
#24
It could be because something is hogging the videocard.
#25
OK, so I finally took the time to setup VS 2008 Express and built the latest SVN - and without a single hickup, that's a first! Big Grin Well done XBMC Team (in other projects I normaly have to guess and google alot to get stuff to compile), this was a breeze. Smile

Anyway bobo your latest changes didn't solve my problem (same symptoms) but they do seem to be one more step in the right direction:
Code:
NOTICE: Starting XBMC, Platform: Windows Vista, 32-bit Service Pack 1 build 6001.  Built on May 17 2009 (SVN:20377, compiler 1500)
NOTICE: Desktop Resolution: 1920x1080 32Bit at 60Hz
   INFO: GUI format 1920x1080 1920x1080 @ 60.00Hz (Full Screen)
  ERROR: unable to load:special://home/skin/Aeon/720p/Pointer.xml, Line 0
   INFO: ffmpeg:     Stream #0.0(eng): Video: h264, yuv420p, 1280x692, PAR 1:1 DAR 320:173, 23.98 tbr, 1k tbn, 47.95 tbc
  DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
  DEBUG: CDVDPlayerVideo::OutputPicture - change configuration. 1280x692. framerate: 23.98
NOTICE: Display resolution ADJUST : 1920x1080 @ 24.00Hz (42)
  DEBUG: CVideoReferenceClock: Detected refreshrate: 60 hertz
  DEBUG: CVideoReferenceClock: Clock speed 100.099992%
  DEBUG: CVideoReferenceClock: Detected refreshrate: 24 hertz
  DEBUG: CVideoReferenceClock: Displaymode changed
  DEBUG: CVideoReferenceClock: Cleaning up Direct3d
  DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
  DEBUG: CVideoReferenceClock: CreateDevice returned D3DERR_DEVICELOST
  DEBUG: CVideoReferenceClock: Setup failed, falling back to QueryPerformanceCounter
  DEBUG: CVideoReferenceClock: Cleaning up Direct3d

I might just start tinkering with the code tomorrow since I got it to build, maybe I can come up with something even though I'm a total newbie when it comes to windows and directx programming. Rolleyes

Again, thanks for your efforts bobo, really appreciated!
#26
ashlar Wrote:It depends on how close to exact refresh rates your monitor is able to get. If it's close by a 0.00x factor, you should probably get by with just skip. Which is what I do.

But, doesn't Smoothvideo round up to the nearest integer making it impossible to get within 0.00x factor for 23.976 video or am I missing something?
#27
seeker83 Wrote:OK, so I finally took the time to setup VS 2008 Express and built the latest SVN - and without a single hickup, that's a first! Big Grin Well done XBMC Team (in other projects I normaly have to guess and google alot to get stuff to compile), this was a breeze. Smile

Anyway bobo your latest changes didn't solve my problem (same symptoms) but they do seem to be one more step in the right direction:
Code:
NOTICE: Starting XBMC, Platform: Windows Vista, 32-bit Service Pack 1 build 6001.  Built on May 17 2009 (SVN:20377, compiler 1500)
NOTICE: Desktop Resolution: 1920x1080 32Bit at 60Hz
   INFO: GUI format 1920x1080 1920x1080 @ 60.00Hz (Full Screen)
  ERROR: unable to load:special://home/skin/Aeon/720p/Pointer.xml, Line 0
   INFO: ffmpeg:     Stream #0.0(eng): Video: h264, yuv420p, 1280x692, PAR 1:1 DAR 320:173, 23.98 tbr, 1k tbn, 47.95 tbc
  DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
  DEBUG: CDVDPlayerVideo::OutputPicture - change configuration. 1280x692. framerate: 23.98
NOTICE: Display resolution ADJUST : 1920x1080 @ 24.00Hz (42)
  DEBUG: CVideoReferenceClock: Detected refreshrate: 60 hertz
  DEBUG: CVideoReferenceClock: Clock speed 100.099992%
  DEBUG: CVideoReferenceClock: Detected refreshrate: 24 hertz
  DEBUG: CVideoReferenceClock: Displaymode changed
  DEBUG: CVideoReferenceClock: Cleaning up Direct3d
  DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
  DEBUG: CVideoReferenceClock: CreateDevice returned D3DERR_DEVICELOST
  DEBUG: CVideoReferenceClock: Setup failed, falling back to QueryPerformanceCounter
  DEBUG: CVideoReferenceClock: Cleaning up Direct3d

I might just start tinkering with the code tomorrow since I got it to build, maybe I can come up with something even though I'm a total newbie when it comes to windows and directx programming. Rolleyes

Again, thanks for your efforts bobo, really appreciated!

Well I've found the issue, kind of. It seems direct3d wants some sort of exclusive lock, which it can't get because the xbmc window keeps setting itself on the foreground when it's running fullscreen.
It's a little tricky to solve though.

freddyflinty Wrote:But, doesn't Smoothvideo round up to the nearest integer making it impossible to get within 0.00x factor for 23.976 video or am I missing something?
It also adjusts the speed of the clock so the fps of the video will match the refreshrate perfectly.
#28
I've been testing again this afternoon with build 20385 and it seems the only time it doesn't work is when using 'Adjust Refresh Rate'.

Adjust Refresh Rate: Off

DEBUG: CVideoReferenceClock: Detected refreshrate: 60 hertz
...
DEBUG: CDVDPlayerVideo::OutputPicture - change configuration. 1276x692. framerate: 23.98
NOTICE: Display resolution AUTO : 1920x1080 @ 60.00Hz (76)
WARNING: Upscale: selected algorithm 1
DEBUG: CVideoReferenceClock: Clock speed 100.099992%
...
DEBUG: CWin32DirectSound::CheckPlayStatus: Resuming Playback
...
NOTICE: Using GL_TEXTURE_2D

Adjust Refresh Rate: On

DEBUG: CVideoReferenceClock: Detected refreshrate: 60 hertz
...
DEBUG: CDVDPlayerVideo::OutputPicture - change configuration. 1276x692. framerate: 23.98
NOTICE: Display resolution ADJUST : 1920x1080 @ 24.00Hz (70)
WARNING: Upscale: selected algorithm 1
DEBUG: CVideoReferenceClock: Clock speed 100.099992%
...
DEBUG: Asking to resize surface to 1920 x 1080
DEBUG: New size covers the screen
DEBUG: CWin32DirectSound::CheckPlayStatus: Resuming Playback
...
DEBUG: Alloc resources: 0.15ms (0.00 ms skin load)
DEBUG: CVideoReferenceClock: Detected refreshrate: 24 hertz
DEBUG: CVideoReferenceClock: Displaymode changed
DEBUG: CVideoReferenceClock: Cleaning up Direct3d
DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
DEBUG: CVideoReferenceClock: CreateDevice returned D3DERR_DEVICELOST
DEBUG: CVideoReferenceClock: Setup failed, falling back to QueryPerformanceCounter
DEBUG: CVideoReferenceClock: Cleaning up Direct3d
NOTICE: Using GL_TEXTURE_2D
#29
bobo1on1 Wrote:Well I've found the issue, kind of. It seems direct3d wants some sort of exclusive lock, which it can't get because the xbmc window keeps setting itself on the foreground when it's running fullscreen.
It's a little tricky to solve though.
Ok, maybe your onto something there, I'm pretty lost there still, hehe.

Anyway I compiled the latest version and run it both in release and debug mode, and actually everything I threw at it worked good on my build PC (C2D 3GHz, 4GB DDR2, Nvidia 8800gts512, Windows XP SP2 32bit). It even worked flawlessly without jerkiness without refresh rate adjust (i.e. playing 24pfs content at 60hz worked nicely)! When I turned on adjust refresh rate it worked flawless aswell, it changed the RR to 24Hz just as it should and the movie played perfectly there aswell. But when I copied over the XBMC.exe to my HTPC (AMD X2 4850e 2.5GHz, 4GB DDR2, Integrated ATI Radeon HD 3200, Windows Vista SP1 64bit) and tried the same thing there my old problem persisted. However I noticed a small difference this time - for a split second during the launch of the movie I saw the TV reporting 1080/24p, then it went back to 1080p (60Hz).

It's too bad both my graphic cards and OS'es are different, so there's still no certainty where the problem comes from. All I can say for now is that the problem is ATI or Windows Vista related.

The debug logs from these last tests were practically copies of each other so I'll only post one (from my HTPC):

Code:
NOTICE: Starting XBMC, Platform: Windows Vista, 32-bit Service Pack 1 build 6001.  Built on May 17 2009 (SVN:20386, compiler 1500)
NOTICE: Desktop Resolution: 1920x1080 32Bit at 60Hz
   INFO: GUI format 1920x1080 1920x1080 @ 60.00Hz (Full Screen)
  ERROR: unable to load:special://home/skin/Aeon/720p/Pointer.xml, Line 0
   INFO: ffmpeg:     Stream #0.0(eng): Video: h264, yuv420p, 1280x692, PAR 1:1 DAR 320:173, 23.98 tbr, 1k tbn, 47.95 tbc
  DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
  DEBUG: CDVDPlayerVideo::OutputPicture - change configuration. 1280x692. framerate: 23.98
NOTICE: Display resolution ADJUST : 1920x1080 @ 24.00Hz (42)
  DEBUG: CVideoReferenceClock: Detected refreshrate: 60 hertz
  DEBUG: CVideoReferenceClock: Clock speed 100.099992%
  DEBUG: CVideoReferenceClock: Detected refreshrate: 24 hertz
  DEBUG: CVideoReferenceClock: Displaymode changed
  DEBUG: CVideoReferenceClock: Cleaning up Direct3d
  DEBUG: CVideoReferenceClock: Setting up Direct3d on adapter 0
  DEBUG: CVideoReferenceClock: Detected refreshrate: 24 hertz
  DEBUG: CVideoReferenceClock: Clock speed 100.099992%
  DEBUG: CVideoReferenceClock: Cleaning up Direct3d

Notes about the log:

* The refresh rate was detected twice (before and after the adjust), that might be why I was able to see the TV flash that 1080/24p indication.

* The "D3DERR_DEVICELOST" and "Setup failed, falling back to QueryPerformanceCounter" warnings are gone (woho! Smile).

* My XP machine reports "NOTICE: Display resolution ADJUST : 1920x1080 @ 24.00Hz (32)" while my Vista machine reports " NOTICE: Display resolution ADJUST : 1920x1080 @ 24.00Hz (42)" Perhaps a clue? In the code it says that this value means "the resolution we're running in", but that doesn't seem correct with these values?

* It's intersting that the logs are practically identical even though the XP/Nvidia machine succeeds in keeping it's adjusted refresh rate, while the Vista/ATI machine fails.
#30
The numbers in brackets are the resolution ids found in your guisettings.xml which vary from machine to machine.

It's interesting that you're also having trouble on a Vista set up because that's what I'm running as well.

Logout Mark Read Team Forum Stats Members Help
Smoothvideo ("Sync playback to display" feature) now merged in the mainline branch0