-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 7: changing sound device properties mid-playback causes mpv to hang #674
Comments
|
Needs someone to fix this, ping @Kovensky |
Apparently nobody cares, I don't either. |
This is still a legitimate reproducible bug. Just because nobody knows how to fix it doesn't change that. |
True, but it clogs the bug list for no reason. |
PS: as a half-measure, I already moved ao_dsound above ao_wasapi in the list of preferred audio drivers. dsound doesn't appear to have this problem, and works just as well. |
Indeed dsound doesn't have the problem. It would be nice to get the wasapi ao up the the same level though. I'm trying to figure out where exactly this is going wrong. To summarize the progression of the behaviour is
breaking gdb always says I'm at input/input.c:1020. I guess it's picking up my break key-press (which still seems to happen with --no-input-terminal.) There doesn't appear to be any abnormal condition in the last call to ao_wasapi.c:thread_feed (marked by "ao/wasapi: device delay: 2860 samples (29.7917 ms)"). There are no futher calls to anything inside ao_wasapi.c after that.
So even if AUDCLNT_E_DEVICE_INVALIDATED triggered an ao reset, it would still require a pause/unpause to escape the hang to actually get to a place where the error could be detected. This is as far as I've been able to get. I'm not sure how to catch and detect this error if there's no sign of it in the mpv wasapi code until after the pause/unpause. |
At that line is the select() call, which is where the playback thread waits if there's nothing else to do. Maybe the player thinks it still has some audio to play, and ao_wasapi always returns the same status. |
Oh, here we go. It looks like the last place the wasapi code is seen is ao_wasapi.c:125
It's waiting forever for playcontrol (namely state->hFeed) that never signals because the audio device has be deinitialized. |
it should probably be signalling state->hUninit, but for some reason doesn't |
What a pain in the ass: the exclusive mode example isn't self contained. It expects you to create your own data source. I linked the exclusive mode example above, because it also uses That code seems to only wait for the handle set by IAudioClient_SetEventHandle. The hUninit is only triggered manually by the ao_wasapi code in mpv. At this stage, it seems that the best thing to do would be have a non-infinite timeout on the MsgWaitForMultipleObjects and have a separate swtich clause for it. |
I also give up. |
pause/unpause results in the command line output
"q" closes mpv as expected, so the hang isn't that bad.
The same thing happens changing settings in the "Advanced" tab.
The text was updated successfully, but these errors were encountered: