http://bugs.winehq.org/show_bug.cgi?id=32314
--- Comment #1 from Jörg Höhle hoehle@users.sourceforge.net 2012-12-07 14:52:43 CST --- The original Japanese pikachu is not affected because it uses the winmm:midiStream API, while the English versions uses the MCI sequencer.
It was not a good idea of Alexandre Julliard to stop applying my mciseq patch series after patch #6 this October. http://www.winehq.org/pipermail/wine-patches/2012-October/thread.html
The sequence was never expected to stop at patch #6. The only cut point that I defined was after patch #12, as I wrote in: http://www.winehq.org/pipermail/wine-patches/2012-October/118516.html
The set 2-12 implements the new thread design. It will be enough to fix e.g. bug #22978. The rest [...]
I pinpointed this particular problem in patch #4 (applied):
Waiting for the thread to finish guarantees that at CLOSE time, we can reliably shut down and free resources. That cannot be achieved with a final SetEvent from within the player thread: the driver could then exit while the player thread (is waiting to or) performs its last instructions.
That issue (which has always been present, just made worse with patch #4) was to be fixed only with patch #9: [PATCH 09/25] mciseq: Make sure MCI_WAIT waits for the player to terminate.
So all that's needed is to come to an agreement on the single writer - multiple reader threads protocol.