http://bugs.winehq.org/show_bug.cgi?id=22261
Summary: Love: "device already allocated" handling - requires patching winealsa.drv or using esound backend Product: Wine Version: 1.1.42 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winmm&mci AssignedTo: wine-bugs@winehq.org ReportedBy: ttimo@ttimo.net
Created an attachment (id=27188) --> (http://bugs.winehq.org/attachment.cgi?id=27188) alsa driver patch
While figurinig out the kinks to get Love working, I had to patch the Alsa driver to make it behave like the esound one.
The thread about that process is available here: http://www.gaminglove.net/forums/showthread.php?t=1057
AppDB entry for the game: http://appdb.winehq.org/objectManager.php?sClass=application&iId=11327
To summarize, my understanding is that love.exe tries to open the sound device twice. It works if you use the esound backend, and after a bit of investigation we found that applying the attached patch would make things work with the Alsa backend as well (e.g. change the return code from MMSYSERR_ALLOCATED to MMSYSERR_NOERROR).
(thanks to Kevlarman for initially coming up with this fix)
http://bugs.winehq.org/show_bug.cgi?id=22261
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=22261
Raymond superquad.vortex2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |superquad.vortex2@gmail.com
--- Comment #1 from Raymond superquad.vortex2@gmail.com 2010-10-27 03:28:59 CDT --- To allow multiple open , you need to modify WINE_WAVEDEV so that each PCM stream have its own parameter
WAVEFORMATPCMEX format; snd_pcm_t* pcm; /* handle to ALSA playback device */ snd_pcm_hw_params_t * hw_params; DWORD dwBufferSize; /* size of whole ALSA buffer in bytes */ LPWAVEHDR lpQueuePtr; /* start of queued WAVEHDRs (waiting to be notified) */ LPWAVEHDR lpPlayPtr; /* start of not yet fully played buffers */ LPWAVEHDR lpLoopPtr; /* pointer of first buffer in loop, if any */ DWORD dwLoops; /* private copy of loop counter */ DWORD dwPlayedTotal; /* number of bytes actually played since opening */ DWORD dwWrittenTotal; /* number of bytes written to ALSA buffer since opening */
DWORD dwPeriodSize; /* size of OSS buffer period */ DWORD dwTotalRecorded;
http://bugs.winehq.org/show_bug.cgi?id=22261
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |turbolad995@hotmail.co.uk
--- Comment #2 from Austin English austinenglish@gmail.com 2010-10-27 12:26:55 CDT --- *** Bug 22880 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=22261
--- Comment #3 from Raymond superquad.vortex2@gmail.com 2010-10-27 19:19:26 CDT --- (In reply to comment #0)
Created an attachment (id=27188)
--> (http://bugs.winehq.org/attachment.cgi?id=27188) [details]
alsa driver patch
While figurinig out the kinks to get Love working, I had to patch the Alsa driver to make it behave like the esound one.
it is because wineesd.drv has MAX_WAVEOUTDRV
215 static WINE_WAVEOUT WOutDev [MAX_WAVEOUTDRV]; 216 static WINE_WAVEIN WInDev [MAX_WAVEINDRV];
To summarize, my understanding is that love.exe tries to open the sound device twice. It works if you use the esound backend, and after a bit of investigation we found that applying the attached patch would make things work with the Alsa backend as well (e.g. change the return code from MMSYSERR_ALLOCATED to MMSYSERR_NOERROR).
(thanks to Kevlarman for initially coming up with this fix)
http://bugs.winehq.org/show_bug.cgi?id=22261
--- Comment #4 from David turbolad995@hotmail.co.uk 2010-11-27 14:44:49 CST --- As bug 22880 has been marked a duplicate, the missing sounds are still a problem with Wine version 1.3.8 and I can confirm games like Chips Challenge and Lemmix have sounds missing. The missing sounds do play when these games are opened in Windows XP (32-bit Windows, as 64-bit versions of Windows won't run Chips Challenge because it's 16-bit).
To test the games I've mentioned, here's the download links..
Lemmix (a free clone of the classic lemmings games) it is NOT a DOS game, it runs in Windows: http://www.ericenzwaan.nl/eric/lemmings/lemmix.htm
Chips Challenge: http://www.freewebs.com/chipshome/chips.html
If you can run these games on both Windows 32-bit and the latest release of Wine, you will notice the missing sounds when you play them games in Wine.
http://bugs.winehq.org/show_bug.cgi?id=22261
--- Comment #5 from Raymond superquad.vortex2@gmail.com 2010-12-06 22:48:43 CST --- (In reply to comment #4)
As bug 22880 has been marked a duplicate, the missing sounds are still a problem with Wine version 1.3.8 and I can confirm games like Chips Challenge and Lemmix have sounds missing. The missing sounds do play when these games are opened in Windows XP (32-bit Windows, as 64-bit versions of Windows won't run Chips Challenge because it's 16-bit).
To test the games I've mentioned, here's the download links..
Lemmix (a free clone of the classic lemmings games) it is NOT a DOS game, it runs in Windows: http://www.ericenzwaan.nl/eric/lemmings/lemmix.htm
Chips Challenge: http://www.freewebs.com/chipshome/chips.html
If you can run these games on both Windows 32-bit and the latest release of Wine, you will notice the missing sounds when you play them games in Wine.
For lemmix , you can still use wineesd to get all the sound effect and music
chips seem to be an win3.1 application which use midi (i.e. sb pro FM synth )
http://bugs.winehq.org/show_bug.cgi?id=22261
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hoehle@users.sourceforge.ne | |t
--- Comment #6 from Jörg Höhle hoehle@users.sourceforge.net 2010-12-20 06:54:32 CST --- Bug #23080 contains another patch by Dmitry Baryshev to allow ALSA to use multiple waveout units. It was not accepted in June 2010. http://www.winehq.org/pipermail/wine-devel/2010-June/084145.html
Bug #23080 is a duplicate of this older one. Unless we decide to declare this one as duplicate, because the other one is less cluttered with noise and it contains a real patch, not a hack. Some admins, please decide either way and update the state of these 2=1 bugs.
I find Maarten's patch in bug #22498, comment #4 conceptually most interesting. Instead of pull callbacks, he uses a push design, periodically sending data downto ALSA. I've not tested it yet. It appears very simple and does not mess with lots of ALSA calls in bad order. Hence it could be most compatible with PulseAudio. It almost does what the OSS guys advocate in their design document except that they recommend simply sending bytes and having the call block, not using an API call to ask the number of bytes that can be sent without blocking.
http://bugs.winehq.org/show_bug.cgi?id=22261
--- Comment #7 from Raymond superquad.vortex2@gmail.com 2010-12-21 22:18:24 CST --- (In reply to comment #6)
I find Maarten's patch in bug #22498, comment #4 conceptually most interesting. Instead of pull callbacks, he uses a push design, periodically sending data downto ALSA. I've not tested it yet. It appears very simple and does not mess with lots of ALSA calls in bad order. Hence it could be most compatible with PulseAudio.
I have tried Maartenn's waveout.c with Lemmix Lemmix in bug#22880 but it does not produce background music and effect
you can try waveout.c in comment #41
unless you don't mind the latency when PA server use a 2 seconds buffer for HDA
http://bugs.winehq.org/show_bug.cgi?id=22261
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ksquirrel.iv@gmail.com
--- Comment #8 from Austin English austinenglish@gmail.com 2010-12-23 17:56:34 CST --- *** Bug 23080 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=22261
--- Comment #9 from Raymond superquad.vortex2@gmail.com 2011-01-05 00:48:10 CST --- (In reply to comment #4)
As bug 22880 has been marked a duplicate, the missing sounds are still a problem with Wine version 1.3.8 and I can confirm games like Chips Challenge and Lemmix have sounds missing. The missing sounds do play when these games are opened in Windows XP (32-bit Windows, as 64-bit versions of Windows won't run Chips Challenge because it's 16-bit).
bug#25633
chips challenge use 11025Hz mono 8bit wave file for the sound effects, winealsa.drv snd_pcm_hw_params_set_buffer_time() fail when using "plughw:0,0" of the most common HDA intel driver
winealsa just report those fatal error as warning so you have to specify WINEDEBUG=+wave
winmm_test wave also fail with "hw" at 11025Hz 16bit stereo even when your HDA codec support 11025Hz
it does not fail when using "plug:dmix" or "pulse" since "dmix" force the slave pcm "hw:0,0" to use the buffer size/period size accepted by HDA intel
just change the buffer size/period size to get the sound effect
you need a wavetable snyth or software synth to hear the background music
http://bugs.winehq.org/show_bug.cgi?id=22261
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|winmm&mci |winealsa.drv
http://bugs.winehq.org/show_bug.cgi?id=22261
--- Comment #10 from Raymond superquad.vortex2@gmail.com 2011-04-12 18:13:01 CDT --- As you can see in winepulse, it also support multiple waveoutopen
Version 0.29 (18/07/2009)
* Change the way dwUser is cast to a WINE_WAVEINST.
http://bugs.winehq.org/show_bug.cgi?id=22261
--- Comment #11 from Jörg Höhle hoehle@users.sourceforge.net 2011-08-05 03:45:41 CDT --- Admins, please mark as fixed. Since 1.3.25, winmm uses the mmdevapi backend which supports multiple opens with ALSA.
http://bugs.winehq.org/show_bug.cgi?id=22261
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #12 from Austin English austinenglish@gmail.com 2011-08-05 13:09:07 CDT --- (In reply to comment #11)
Admins, please mark as fixed. Since 1.3.25, winmm uses the mmdevapi backend which supports multiple opens with ALSA.
Should be fixed.
http://bugs.winehq.org/show_bug.cgi?id=22261
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org 2011-08-26 13:25:39 CDT --- Closing bugs fixed in 1.3.27.