IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
WASAPI plugin 3.0 (release) sometimes stop playback between songs
pgruebele@cox.ne...
post Nov 30 2012, 04:04
Post #1





Group: Members
Posts: 5
Joined: 30-November 12
Member No.: 104864



Hi.

I develop windows device drivers and am testing a driver against the WASAPI 3.0 plugin.

This plugin apears to have a bug:

Sometimes it gets stuck between songs of different sample rates and juut stays there at the beginning of the new song. When this happens the device driver never receives a STOP state and never is requested to change sample rates.

When this happens the device driver simply stops receiving audio packets, and continues to get polled for audio position. When it works, there are either 0 or 1 position polls before the stream is stopped (STOP state). So, either it hangs for good or it works immediately. If I stop playback everything works again. It may have something to do with the fact that my buffer position advances with very high precision. It almost seems that if the plugin sent the last packet, and it it then manages to poll the position 2 times, this causes it to go into a weird state of waiting for the buffer position to stop moving (which it is not suppsed to do until exiting the RUN state.

If I modify the driver to stop advancing the postition when it runs out of audio packets, then foobar no longer gets stuck. I can't release my driver like that since this violates Microsoft specs.

Cheers
Philip

Go to the top of the page
+Quote Post
SevenTwo
post Dec 1 2012, 19:31
Post #2





Group: Members
Posts: 4
Joined: 2-July 10
Member No.: 81989



QUOTE (pgruebele@cox.net @ Nov 30 2012, 05:04) *
Sometimes it gets stuck between songs of different sample rates and juut stays there at the beginning of the new song. When this happens the device driver never receives a STOP state and never is requested to change sample rates.


I had also exactly the same behavior here with two songs.

Now I checked again: flac has 44.1kHz and mp3 has 48kHz

Sometimes foobar hangs at beginning of 2nd song, position slider disappears and flickers.
Until I click on slider or double click the song to resume playback.

intel d525mw, atom d525, w7x64sp1 upd, foobar 1.1.18, only official components, wasapi push 200ms, buffer 500ms, realtek hda -> speaker



This post has been edited by SevenTwo: Dec 1 2012, 19:47
Go to the top of the page
+Quote Post
pgruebele@cox.ne...
post Dec 1 2012, 19:41
Post #3





Group: Members
Posts: 5
Joined: 30-November 12
Member No.: 104864



Yes, I can confirm that this is EXACTLY the same behaviour I see. THis must be a WASAPI plugin bug...

Does anyone know how to get in touch with Pete (I think he is the author), in order to get this fixed?

Cheers
Philip
Go to the top of the page
+Quote Post
Peter
post Dec 3 2012, 10:55
Post #4


foobar2000 developer


Group: Admin
Posts: 3313
Joined: 30-September 01
Member No.: 84



Problem acknowledged, thanks for reporting.
Go to the top of the page
+Quote Post
Peter
post Dec 3 2012, 13:00
Post #5


foobar2000 developer


Group: Admin
Posts: 3313
Joined: 30-September 01
Member No.: 84



Beta version:
http://www.foobar2000.org/temp/WASAPI-beta....fb2k-component

No changes since 3.0 other than this fix.
Go to the top of the page
+Quote Post
pgruebele@cox.ne...
post Dec 4 2012, 00:08
Post #6





Group: Members
Posts: 5
Joined: 30-November 12
Member No.: 104864



QUOTE (Peter @ Dec 3 2012, 07:00) *
Beta version:
http://www.foobar2000.org/temp/WASAPI-beta....fb2k-component

No changes since 3.0 other than this fix.



Thanks for the quick fix. 3.1 appears to fix this. I will do some more testing and let you know if there are any problems.

Cheers
Philip
Go to the top of the page
+Quote Post
pgruebele@cox.ne...
post Jan 4 2013, 13:39
Post #7





Group: Members
Posts: 5
Joined: 30-November 12
Member No.: 104864



QUOTE (Peter @ Dec 3 2012, 07:00) *
Beta version:
http://www.foobar2000.org/temp/WASAPI-beta....fb2k-component

No changes since 3.0 other than this fix.



Hi Pete. Doing further testing shows that WASAPI push now works reliably, but there appears to be a problem with WASAPI event mode.

It appears that you are calling IAudioClient->Initialize() with the periodicity parameter set to about 10ms. This will sometimes cause event mode to underflow the buffer of WaveCyclic miniport drivers which have a DPC periodicity of 10ms, causing the well known popping/clicking effect. This could be solved by setting this parameter to 15ms (5ms higher than required) or even 20ms.

I'm not 100% sure about this but if you provide a test build I can confirm whether or not this theory is correct.

Cheers
Philip Gruebele
Go to the top of the page
+Quote Post
Canar
post Jan 4 2013, 16:02
Post #8





Group: Super Moderator
Posts: 3373
Joined: 26-July 02
From: To:
Member No.: 2796



QUOTE (pgruebele@cox.net @ Jan 4 2013, 04:39) *
It appears that you are calling IAudioClient->Initialize() with the periodicity parameter set to about 10ms. This will sometimes cause event mode to underflow the buffer of WaveCyclic miniport drivers which have a DPC periodicity of 10ms, causing the well known popping/clicking effect. This could be solved by setting this parameter to 15ms (5ms higher than required) or even 20ms.
Try changing Preferences > Advanced > Playback > WASAPI > Hardware buffer in MS - event mode


--------------------
You cannot ABX the rustling of jimmies.
No mouse? No problem.
Go to the top of the page
+Quote Post
pgruebele@cox.ne...
post Jan 4 2013, 16:22
Post #9





Group: Members
Posts: 5
Joined: 30-November 12
Member No.: 104864



QUOTE (Canar @ Jan 4 2013, 10:02) *
QUOTE (pgruebele@cox.net @ Jan 4 2013, 04:39) *
It appears that you are calling IAudioClient->Initialize() with the periodicity parameter set to about 10ms. This will sometimes cause event mode to underflow the buffer of WaveCyclic miniport drivers which have a DPC periodicity of 10ms, causing the well known popping/clicking effect. This could be solved by setting this parameter to 15ms (5ms higher than required) or even 20ms.
Try changing Preferences > Advanced > Playback > WASAPI > Hardware buffer in MS - event mode


I am trying that now, thanks. It appears to work but I will test a bit more. The WASAPI plugin should call IAudioClient::GetDevicePeriod() to obtain the correct default no? If not, any chance this can be changed to 15 by default? That would save a lot of people a lot of headaches...
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th December 2014 - 06:53