WASAPI plugin 3.0 (release) sometimes stop playback between songs |
![]() ![]() |
WASAPI plugin 3.0 (release) sometimes stop playback between songs |
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 |
|
|
|
Dec 1 2012, 19:31
Post
#2
|
|
|
Group: Members Posts: 4 Joined: 2-July 10 Member No.: 81989 |
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 |
|
|
|
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 |
|
|
|
Dec 3 2012, 10:55
Post
#4
|
|
![]() Group: Admin Posts: 3226 Joined: 30-September 01 Member No.: 84 |
Problem acknowledged, thanks for reporting.
-------------------- This job would be great if it wasn't for the users.
|
|
|
|
Dec 3 2012, 13:00
Post
#5
|
|
![]() Group: Admin Posts: 3226 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. -------------------- This job would be great if it wasn't for the users.
|
|
|
|
Dec 4 2012, 00:08
Post
#6
|
|
|
Group: Members Posts: 5 Joined: 30-November 12 Member No.: 104864 |
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 |
|
|
|
Jan 4 2013, 13:39
Post
#7
|
|
|
Group: Members Posts: 5 Joined: 30-November 12 Member No.: 104864 |
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 |
|
|
|
Jan 4 2013, 16:02
Post
#8
|
|
![]() Group: Super Moderator Posts: 3268 Joined: 26-July 02 From: princegeorge.ca Member No.: 2796 |
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
-------------------- (atrix|(fb2k->e-mu 0404 usb|audio 8 dj))->hd280|jvc ha-fx35-b
|
|
|
|
Jan 4 2013, 16:22
Post
#9
|
|
|
Group: Members Posts: 5 Joined: 30-November 12 Member No.: 104864 |
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 modeI 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... |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 24th May 2013 - 13:04 |