Kodi Community Forum
[WINDOWS] Internal Directshow Based Player [NO LONGER DEVELOPED] - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: [WINDOWS] Internal Directshow Based Player [NO LONGER DEVELOPED] (/showthread.php?tid=61355)



- blinkseb - 2010-06-04

hsinchu308 Wrote:My suggestion would be to put those important, or often tweaked options, that are exclusive to dsplayer, like subtitle shadow depth, inside a dsplayer tab, like the current one you have inside Video Settings. This way, 1) you don't confuse people (for example, dvdplayer does not have subtitle shadow at all), 2) you can make the whole dsplayer tab, with all its options, disappear by setting the HAS_DSPLAYER option at compile time, without altering other tabs at all, and 3) easier for the dsplayer user, because all dsplayer-specific options are inside one tab, instead of spreading over many tabs (like subtitle tab, audio tab, etc.) Wink

That would be, AFAIK, the best solution. Unfortunatly, there will be a lot of options in the same category. I'll see if there's a solution to add a new property page when clicking on DSPlayer.

hsinchu308 Wrote:Hi Joe,

Not sure if this is the cause of your problem but I thought I'd share my experience in case other people are having the same problem. I am running Windows XP SP3 w/ Nvidia 8400GS PCI.

For the past week or so I have been troubleshooting a stutter problem with dsplayer. The most curious/interesting/frustrating part for me was that I was using the same settings and codec that I use in MPC-HC, like MPCVideoDec codec (DXVA), setting of Vsync, Accurate Vsync, Flush GPU Before Vsync, subtitle maximum texture size to 800x600 (had to compile my own), subtitle subpictures to buffer to 3, etc., yet MPC-HC did not stutter, but dsplayer did - once every few seconds.

I finally found the cause: the Vsync in the XBMC Systems -Settings (Vertical Blank Sync) was set to "Always Enabled", and was interfering with the Vsync inside dsplayer! I had to disable it by setting it to "Disabled". Then the stuttering was gone. Eventually, I found the best setting was actually to disable all vsync inside dsplayer, set XBMC to true fullscreen, and set Vertical Blank Sync to "Always Enabled", to get the smoothest playback.

Curiously, in the 28xxx and 29xxx builds, this setting did not have any effect at all inside dsplayer, because it was set to "Always Enabled" as the default, yet I still got tearing in Windows XP. Huh

I guess your analyse is good. The Paint() method of the renderer is called by XBMC itself, so any vsync options delay the method calls. But, inside the Paint() method, if renderer vsync is enabled, there's another delay, resulting I guess in playback stuttering.

I see two solutions : First, disable vsync in the renderer and lets XBMC do the job (seems like the best?). Second, enable vsync in the renderer, but automatically disable XBMC vsync when using dsplayer.

I think the two solutions deserve to be tested. I add it on my todo list.

PS: On the 28xxx and 29xxx revisions, vsync was disabled by default and implementation was buggy.

Quote:Thanks, I'll give that a try later at home. Possibly what you describing is similar to a "double negative" that cancels itself out, maybe a programming logic error?

In any case do you disable the vsync options for dsplayer in specific as you suggest in the xml file that Seb posted about a couple of times a few pages back? If so, can you please paste in the settings you are using to save some trial and error on my part?

Thanks again
The REAL Joe

Beware, the xml file doesn't work with the latest build released. You'll need to build your own dsplayer to add this feature Smile

Oh, while I think about it, I've tried to add the VMR7 renderer. Unfortunatly, it uses DirectX 7, and XBMC uses DirectX 9. It would need a complete rewrite of the XBMC renderer to use DirectX 7 Shocked But it seems like tearing is gone, hopefully for ever... !


- therealjoeblow - 2010-06-04

blinkseb Wrote:Beware, the xml file doesn't work with the latest build released. You'll need to build your own dsplayer to add this feature Smile

No can do, programming and compiling skills with C++ are *nil* - I'll have to wait patiently for another 'official' testing build...

blinkseb Wrote:Oh, while I think about it, I've tried to add the VMR7 renderer. Unfortunatly, it uses DirectX 7, and XBMC uses DirectX 9. It would need a complete rewrite of the XBMC renderer to use DirectX 7 Shocked But it seems like tearing is gone, hopefully for ever... !

Hopefully - keeping fingers crossed! (It was gone once before but then reappeared persistently for many months - hoping that doesn't occur again).

Cheers
The REAL Joe


- therealjoeblow - 2010-06-05

hsinchu308 Wrote:Hi Joe,

Not sure if this is the cause of your problem but I thought I'd share my experience in case other people are having the same problem. I am running Windows XP SP3 w/ Nvidia 8400GS PCI.

For the past week or so I have been troubleshooting a stutter problem with dsplayer. The most curious/interesting/frustrating part for me was that I was using the same settings and codec that I use in MPC-HC, like MPCVideoDec codec (DXVA), setting of Vsync, Accurate Vsync, Flush GPU Before Vsync, subtitle maximum texture size to 800x600 (had to compile my own), subtitle subpictures to buffer to 3, etc., yet MPC-HC did not stutter, but dsplayer did - once every few seconds.

I finally found the cause: the Vsync in the XBMC Systems -Settings (Vertical Blank Sync) was set to "Always Enabled", and was interfering with the Vsync inside dsplayer! I had to disable it by setting it to "Disabled". Then the stuttering was gone. Eventually, I found the best setting was actually to disable all vsync inside dsplayer, set XBMC to true fullscreen, and set Vertical Blank Sync to "Always Enabled", to get the smoothest playback.

Curiously, in the 28xxx and 29xxx builds, this setting did not have any effect at all inside dsplayer, because it was set to "Always Enabled" as the default, yet I still got tearing in Windows XP. Huh

Ok, I disabled Vsync from the main system settings page, and sure enough, the cures the judder problem when using the dxva decoder and video displays perfectly smooth with no tearing. HOWEVER, it reintroduces tearing when using the software decoder.

So that's only a partial solution, either I get judder s/dxva and no tearing with software decoder, or no judder w/dxva and tearing with software :-(

Hopefully this can be sorted to give no judder and no tearing regardless of the decoder.

At least we're on the right track here and seem to have narrowed things down.

Have a great weekend everyone!

Cheers
The REAL Joe


- hsinchu308 - 2010-06-05

blinkseb Wrote:I guess your analyse is good. The Paint() method of the renderer is called by XBMC itself, so any vsync options delay the method calls. But, inside the Paint() method, if renderer vsync is enabled, there's another delay, resulting I guess in playback stuttering.

I see two solutions : First, disable vsync in the renderer and lets XBMC do the job (seems like the best?). Second, enable vsync in the renderer, but automatically disable XBMC vsync when using dsplayer.

I think the two solutions deserve to be tested. I add it on my todo list.

PS: On the 28xxx and 29xxx revisions, vsync was disabled by default and implementation was buggy.

Thanks for the explanation about the Paint() method. Now it makes sense to me. I was thinking of an easy (hopefully) solution: Right now you have 3 choices in Vertical Blank Sync - 1) Always Enabled, 2) Disabled and 3) Enabled During Video Playback; how about adding a fourth choice: Disabled During Video Playback Laugh. This way the user has a more complete control over when Vsync is used inside XBMC.

PS. I just want to thank you again for all the time you've spent helping us with our questions and problems.


- blinkseb - 2010-06-05

hsinchu308 Wrote:Thanks for the explanation about the Paint() method. Now it makes sense to me. I was thinking of an easy (hopefully) solution: Right now you have 3 choices in Vertical Blank Sync - 1) Always Enabled, 2) Disabled and 3) Enabled During Video Playback; how about adding a fourth choice: Disabled During Video Playback Laugh. This way the user has a more complete control over when Vsync is used inside XBMC.

PS. I just want to thank you again for all the time you've spent helping us with our questions and problems.

Why not! It's a little bit weird to have vsync for the gui but not for the video, but in our case, it makes sense. But wouldn't it be confusing for the user? I guess we could do something like that : when the user enable vsync in dsplayer, it aucomatically switch to "Disabled During Video Playback". This way, no more conflicts.

Hm, I like this idea! I add it on my todo list Smile


- tiben20 - 2010-06-05

hsinchu308 Wrote:My suggestion would be to put those important, or often tweaked options, that are exclusive to dsplayer, like subtitle shadow depth, inside a dsplayer tab, like the current one you have inside Video Settings. This way, 1) you don't confuse people (for example, dvdplayer does not have subtitle shadow at all), 2) you can make the whole dsplayer tab, with all its options, disappear by setting the HAS_DSPLAYER option at compile time, without altering other tabs at all, and 3) easier for the dsplayer user, because all dsplayer-specific options are inside one tab, instead of spreading over many tabs (like subtitle tab, audio tab, etc.) Wink
Since the start i coded in a way dsplayer is only seen for the people using windows with directx rendering. I dont know why we would need an option HAS_DSPLAYER. The only problem we are facing for the settings is i really dont want to add a button on the osd gui for the dsplayer options. This would require to add the button in every skin this would be way too long and confusing for users.


- blinkseb - 2010-06-05

tiben20 Wrote:Since the start i coded in a way dsplayer is only seen for the people using windows with directx rendering. I dont know why we would need an option HAS_DSPLAYER. The only problem we are facing for the settings is i really dont want to add a button on the osd gui for the dsplayer options. This would require to add the button in every skin this would be way too long and confusing for users.

The HAS_DS_PLAYER define is already in place in the code, as requested by spdiff. Indeed, some may want to compile xbmc without dsplayer (microsoft, closed source, etc...), and futhermore, what if someone want to port xbmc to win mobile 7 / WinCE ? DirectX would be present, but not DirectShow.

Anyway it's not a big deal Smile

And I agree on the OSD button, it will only be confusing for users.


- hsinchu308 - 2010-06-05

blinkseb Wrote:Why not! It's a little bit weird to have vsync for the gui but not for the video, but in our case, it makes sense. But wouldn't it be confusing for the user? I guess we could do something like that : when the user enable vsync in dsplayer, it aucomatically switch to "Disabled During Video Playback". This way, no more conflicts.

Hm, I like this idea! I add it on my todo list Smile

Cool. Hopefully this automatic switch will prevent future dsplayer users from spending hours or days tinkering, wondering why he/she cannot get smooth playback. Nod


- zoing - 2010-06-05

Hi Seb,

maybe it is my stupidity, but for me it is not possible to change the dxva codec?
I tested it with the arcsoft and the cyberlinc codec but dsplayer uses always the mpc codec. I use the 30829 build.
I can change the codec for the xvid/divx to arcsoft for example. This works.
In the debug log there seems no error. http://pastebin.com/3ZAd5S4c

Here is the section from the mediasconfig file.
<video>
<video dxva="true" filter="arcsoftvideodec" />
<!video filter="mpcvideodec" />
</video> -->

Maybe you can look into this.

PS: Great work on the FastForward and Rewind part of the player. Works flawlessly Wink


- blinkseb - 2010-06-05

zoing Wrote:Hi Seb,

maybe it is my stupidity, but for me it is not possible to change the dxva codec?
I tested it with the arcsoft and the cyberlinc codec but dsplayer uses always the mpc codec. I use the 30829 build.
I can change the codec for the xvid/divx to arcsoft for example. This works.
In the debug log there seems no error. http://pastebin.com/3ZAd5S4c

Here is the section from the mediasconfig file.
<video>
<video dxva="true" filter="arcsoftvideodec" />
<!video filter="mpcvideodec" />
</video> -->

Maybe you can look into this.

PS: Great work on the FastForward and Rewind part of the player. Works flawlessly Wink

It seems like you're not very familiar with XML syntax, no? In case of, read this http://www.w3schools.com/xml/xml_tree.asp Smile

If you want to use DXVA with arcsoft for example :

Quote:<rule filetypes="mkv">
<source filter="mkvsource" />
<splitter filter="mkvsplitter" />
<video>
<video dxva="true" filter="arcsoft" />
<video filter="mpcvideodec" />
</video>
<audio filter="ffdaudiodec" />
</rule>

You can't have a "!" in your tag name. Moreover, the "-->" is only here to say "this is the end of my comment, which starts with "<!--" ".


- tiben20 - 2010-06-05

blinkseb Wrote:The HAS_DS_PLAYER define is already in place in the code, as requested by spdiff. Indeed, some may want to compile xbmc without dsplayer (microsoft, closed source, etc...), and futhermore, what if someone want to port xbmc to win mobile 7 / WinCE ? DirectX would be present, but not DirectShow.

Anyway it's not a big deal Smile

And I agree on the OSD button, it will only be confusing for users.
Xbmc code is already a big piece of code when you consider the amount of #ifdef we already have for a multi platform media player. Maybe if we were doing a cross-platform library but its not the case. If you want to port to mobile 7 you do like opengl gles which added #if HAS_GLES and add example HAS_WINCEDX or something like that


- zoing - 2010-06-05

blinkseb Wrote:It seems like you're not very familiar with XML syntax, no? In case of, read this http://www.w3schools.com/xml/xml_tree.asp Smile

If you want to use DXVA with arcsoft for example :



You can't have a "!" in your tag name. Moreover, the "-->" is only here to say "this is the end of my comment, which starts with "<!--" ".

As i said it before it was my stupidity. Thanks for looking into it. It works now.
And no I am not familiar with XML syntax but always willing to learn.Smile


- tiben20 - 2010-06-06

zoing Wrote:As i said it before it was my stupidity. Thanks for looking into it. It works now.
And no I am not familiar with XML syntax but always willing to learn.Smile

http://sourceforge.net/projects/notepad-plus/
Try this program for editing text file. for xml its perfect and also lightweight. Editing an xml file with something like wordpad is really confusing when you dont really know how xml should be written.


- therealjoeblow - 2010-06-06

therealjoeblow Wrote:Ok, I disabled Vsync from the main system settings page, and sure enough, the cures the judder problem when using the dxva decoder and video displays perfectly smooth with no tearing. HOWEVER, it reintroduces tearing when using the software decoder.

So that's only a partial solution, either I get judder s/dxva and no tearing with software decoder, or no judder w/dxva and tearing with software :-(

Hopefully this can be sorted to give no judder and no tearing regardless of the decoder.

At least we're on the right track here and seem to have narrowed things down.

Have a great weekend everyone!

Cheers
The REAL Joe

Just wanted to post an update after watching several films and many more tests:

1) with dxva filter: if I disable Vsync as was suggested, the judder doesn't seem to be therem however I actually *DO* get tearing, only it's not as bad as when using the software decoder. Nevertheless, vsync (from the main GUI) has to be enabled or I get tearing with any filter.

2) with the software filter: I actually *DO* get judder with this too, but again, it's not as bad as with the dxva filter and vsync enabled - with the dxva filter, as previously reported it's there every 2 to 3 seconds; with the software decoder, it's more like every 8 to 10 seconds or so, but nevertheless, both the dxva and the software filter get judder

So, in summary, simply disabling vsync isn't going to work, because that reintroduces the tearing problem, and that can't be a workable solution (there is no tearing in current builds anymore thank God as long as vsync is enabled); and both dxva and software fliters suffer from judder to varying degrees that wasn't there in older builds.

Since the old builds had *no* (zero!) tearing and *no* (again zero) judder, ie, absolutely perfect playback, I am still remaining *very* hopeful that these issues will eventually be resolved once and for all.

Also wanted to report (not sure if it's a trunk issue or not) that the screensaver (set to go black) doesn't work in 30385 when paused while playing video. It kicks in just fine from the GUI but NOT when playing video. Unfortunately with a Plasma TV, this is a must-have feature, as well as smooth and clean playback, so once again it's back to 28016 for me.

Cheers
The REAL Joe


- dlmh - 2010-06-06

Hi,

I just got my new hardware (Intel DH57JG + Core i3 530), installed Windows 7 Home Premium (32-bit) and the latest build of XBMC DSPlayer, but I'm having some issues with playback:

(using DVDPlayer)
1: My display (Samsung LE46A686) is set to 60Hz in Windows, as is in XBMC. I've set "Switch refreshrate" to ON. When directly connected to the display a 24p source will play perfectly @ 24Hz.

When connected through my receiver (Onkyo TX-SR875), after starting a video, the screen goes black and the receiver starts switching inputs (clicking noises) and after a while I get the "No input" message from my display.

If I set my desktop refreshrate to 23Hz the video will play perfectly at 24Hz. I'm guessing there's a negotiation issue between my hardware and the receiver, but I don't know how to fix it.

(when using DSPlayer)
2: I first couldn't get a file to play through DSPlayer. I would keep getting the error that the " file couldn't be rendered" and the XBMC log shows an error that the filter couldn't be loaded. I finally managed to fix this by loading a movie from a network share mapped to drive letter (MSmile instead of directly over samba (SMB://user@pwConfusedhare). I don't know why this is an issue, DVDPlayer works perfectly like this.

However, after fixing this issue, I cannot play the file through DSPlayer. The audio starts playing, but the screen is stuck at the XBMC interface and the "loading" animation is stuck as well.

I tried many options in the ffdshow config windows, switching them on and off, but to no avail. Because I wanted to test if I could get DTS-HD/TrueHD to play through my hardware I installed Total Media Theater 3 first and then MPC-HC. They played back my media perfectly, but no HD Audio.

Then I switched back to my XBMC trials and was quite surprised that when starting a .M2TS file, all the pretty lights on the receiver indicating TrueHD/DTS-HD(MA) showed and I actually got HD audio through my speakers!!! Still no video though, still stuck at the XBMC interface.

Anyone got a clue why this is happening? The log shows no errors, but XBMC becomes unresponsive (although audio will keep playing).

Edit: here's the log after playing the same file, first with DVDPlayer, then with DSPlayer.
Edit2: here's the log when playing Dolby TrueHD