WinePulse – PulseAudio for Wine
What is It?
It’s a PulseAudio backend for WINE, an opensource implementation of the Windows API on X/Unix. PulseAudio is a modern sound system for Linux. Currently WINE applications cannot fully cooperate with pulseaudio, creating an either-or situation which is messy. WinePulse means that on a PulseAudio setup audio will always work in WINE for you. Doesn’t matter what kind of device the audio is coming out of or captured from, things will work. It also means that you get all the benefits of PulseAudio (moving streams between devices on-the-fly, network transparency… )
Why?
Firstly, while it’s true that WINE currently has many audio backends, some of which can be made to work indirrectly with pulseaudio, no solution works well enough in my opinion. Secondly, a native interface to pulseaudio can be written as “a PCM output abstraction layer is already available in [WINE] and it thus makes sense to add an additional backend to it for PulseAudio to keep the stack of audio layers minimal.” (Lennart Poettering, http://0pointer.de/blog/projects/guide-to-sound-apis.html). Thirdly, writing such a backend seemed like a good spare time project.
Getting WinePulse
For Ubuntu try Neil Wilson’s packages: https://launchpad.net/~neil-aldur/+archive/ppa
For Fedora, you don’t have to do anything, they are already included!
For Gentoo, Quarks Overlay (more info) for wine includes the patches.
From Git source, read on. WinePulse exists in the form of patches to the main wine git repository.
Latest
- winepulse-0.35.patch
- winepulse-0.35-configure.ac.patch
- winepulse-0.34-winecfg.patch (thanks to Sardemff7)
- UPDATE 05/02/10: Use winepulse-0.32-configure.ac.patch for wine versions ≤ 1.1.37 instead
How to Build / Use Wine with PulseAudio Support
You don’t need to do this if you use one of the precompiled packages for/from your distro.
Clone the wine git repository and apply the winepulse patches:
git clone git://source.winehq.org/git/wine.git wine-git cd wine-git patch -p1 < path/to/patches/winepulse-0.35.patch patch -p1 < path/to/patches/winepulse-0.35-configure.ac.patch patch -p1 < path/to/patches/winepulse-0.34-winecfg.patch
The patch contains changes to configure.ac to add checks for pulesaudio, thus you must rebuild the configure script with autoreconf before building as else only a stub driver will be built.
autoreconf ./configure <optionally your configure arguments here>
To check to see if pulseaudio support will be built run
grep HAVE_PULSEAUDIO include/config.h
from the root of the wine source. “#define HAVE_PULSEAUDIO 1″ should be output if pulseaudio was found. After you can build wine as normal.
make depend && make
If all goes well there should be the file dlls/winepulse.drv/winepulse.drv.so in the wine tree. If you used the winecfg patch you should be able to run winecfg and see the pulesaudio driver. To debug winepulse use the debug channel “wave” using the WINEDEBUG environment variable. For example;
WINEDEBUG=+wave wine <your program>
Requirements
Requires pulseaudio >= 0.9.15 and the latest git version of wine. Can compile and mostly work against versions 0.9.11 and up, but pulseaudio bugs (which might be patched by your distro) could cause failures.
On 64-bit systems beware of old 32-bit libraries. Some distributions ship old version of libpulse for the 32-bit compatibility (on gentoo be aware that your native libraries are continually updated while emul-linux packages get update less frequently). Wine compiles against the system pulse headers but links against the 32-bit libraries. If these libraries are old, there can be issues with the shared memory transport or hangs on playback/record. The trace messages (environment variable WINEDEBUG=trace+wave)
trace:wave:PULSE_WaveInit libpulse protocol version: x. API Version y trace:wave:PULSE_WaveInit Connected to server ------ with protocol version: x.
should help to debug the problem. On a local instance both x’s should be the same version number.
Features
Support exists for the WaveIn, WaveOut APIs and the DirectSound API through emulation. Tested with WinAmp 2, Foobar2000, Audacity (capture and playback), Ventrilo, Max Payne 1/2, Civ 4 (only menu screen, 3D crashes beyond that for me), VirtualDub, ModPlugTracker, Guild Wars and Quake 3.
Changelog
Version 0.35 (05/02/2010)
- Device name UTF-8 fix from Oldřich Jedlička (Thanks!)
- Update the checks in configure.ac to complain about old libraries.
Version 0.34 (26/01/2010)
- Fixed/cleaned up capture support (finally).
- Updated configure.ac patch to work against newer versions of wine. edit: only applied to git head.
- Updated winecfg patch to work against newer version of wine.
Version 0.33 (23/11/2009)
- Improvements to calculation of buffer_attr.
Version 0.32 (12/10/2009)
- Update to configure.ac patch because of changes to winehq git head.
- Go against MSDN and use linear volume because it seems more correct.
- Fix stalling problems
Version 0.31 (16/09/2009)
- Update to configure.ac only to add a warning for when libpulse is not found. Aids debugging of patch application.
Version 0.30 (10/08/2009)
- Decreased version dependency to 0.9.14.
- Fixed a playback stall situation.
- Fixed winecfg patch to work with latest git.
Version 0.29 (18/07/2009)
- PulseAudio version requirement bump to 0.9.15
- Change the way dwUser is cast to a WINE_WAVEINST.
- Fix the winecfg patch to apply again (Neil Wilson), sort winepulse into the library list of library.c.
- Improve latency a little, little bit in wodPlayer_CheckReleasing().
- Remove work arounds and warnings for old PulseAudio versions.
Version 0.28 (19/06/2009)
- Whitespace cleanup (finally).
- Fix underrun recovery so it doesn’t cause incorrect buffer_attr request which then will cause stalls.
- All winmm tests passed – wave: 15234 tests executed (0 marked as todo, 0 failures), 0 skipped. capture: 7513 tests executed (0 marked as todo, 0 failures), 0 skipped.
- Removal of unnecessary or not 64-bit safe includes and dependencies.
- Share GetPosition MMTime code between waveout and wavein.
- Fix smtpe MMTime format.
- Make sure WINE_WAVEINST pointers are 64-bit safe.
Version 0.27 (15/06/2009)
- Large simplification to waveOut support.
- Removal of specific dsound support as while it was low-latency, it was broken.
- Removal of broken 24-bit support.
- Small crash fix for waveIn.
- Change in the way pa_timing_info data is used.
Todo
- Daemon reconnection / Deal with daemon connection dying.
- Better handling of directsound streams failing.
- ??
- ??
- Profit.
Relation With the Wine Project
Many prominent Wine devlopers have stated that they do not intend to accept a new audio backend into the offical Wine GIT repository. Current efforts are mostly focused on improving the existing winealsa.drv backend to work better with the pulse libasound plugin. Thus the wine pulse backend will not be included in the official Wine sources. However, this patch exists, behaves well and is shorter stack of wrappers. WinePulse shall continued to be maintained here for as long as the patches are useful. See http://bugs.winehq.org/show_bug.cgi?id=10495 for more information.
Please note that if you use WinePulse, be it specifically compiled or provided by your distro, do not file bug reports at bugs.winehq.org. You will be either redirect here or to your distro’s bugzilla.
Contact
- theycallhimart < at > gmail dot com.