http://bugs.winehq.org/show_bug.cgi?id=27937
Summary: winmm kept busy playing silence after play finishes Product: Wine Version: 1.3.25 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: mmdevapi AssignedTo: wine-bugs@winehq.org ReportedBy: hoehle@users.sourceforge.net CC: aeikum@codeweavers.com
The winmm player is kept busy for several seconds after audible rendering ends.
This is easily reproduced using my MCI shell from bug #20232, comment #10. Issue these commands to the MCI: open 8k8bitpcm.wav alias 8 ; any sample with at least 2 seconds of data play 8 from 1000 to 2000 notify ; play sample from position 1s to 2s play 8 from 1000 to 2000 WAIT status 8 mode I recommend to use a multi-line copy&paste to the console instead of typing.
The MCIWAVE player will correctly play 1 second worth of data. After that however, a random amount of upto 4 messages about ALSA pcm underrun are sent to the console, approx. 1 per second. It's only after those that the player eventually stops, i.e. execution of the synchronous command ends. The command "status 8 mode" serves to show when execution of the previous command ends.
I suspect the cause is the way mmdevapi handles silence and/or feeds too much data into the "default" ALSA device. I have no idea where that 1s log message spacing comes from.
Expected behaviour (as in 1.3.24): the synchronous (WAIT flag) player is kept busy for 1 second, after which the MCI shell processes the next command. Upto one ALSA pcm underrun log message is the norm, since indeed WINMM is closed only after all buffers (headers in waveOut* speak) have been returned to the app, i.e. there's a tiny gap between "played last header => Set Event" and waveOutClose. I.e. one underrun is designed into the WINMM API, after playing ends.