http://bugs.winehq.org/show_bug.cgi?id=28040
Summary: handle_underrun=1 hack causes IMMDevice::Activate to fail with PulseAudio Product: Wine Version: 1.3.26 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winealsa.drv AssignedTo: wine-bugs@winehq.org ReportedBy: hoehle@users.sourceforge.net
Given Andrew's past 1.3.25 commit 9ad60d1d143809c6ae477eb53e75c3dc93736e0e Date: Fri Aug 5 09:33:10 2011 -0500
winealsa.drv: Inject handle_underrun=1 setting for pulse-backed devices.
IMMDevice_Activate now fails when pulse is the default device. As a result, mmdevapi is unusable (=> no more sound) and unwary apps like dlls/mmdevapi/tests/render.c:test_session crash. dmix still works.
The console log is: ALSA lib pcm_pulse.c:855:(_snd_pcm_pulse_open) Unknown field handle_underrun warn:alsa:AUDDRV_GetAudioEndpoint Unable to open PCM "default": -22 (Invalid argument) render.c:141: Test failed: Activation failed with 80004005
I'm using Ubuntu Intrepid. Please don't tell me to update. That is not the solution.
Probably the interim hack should check the effect and revert to standard behaviour/configuration in case of an error.
http://bugs.winehq.org/show_bug.cgi?id=28040
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression CC| |aeikum@codeweavers.com Regression SHA1| |9ad60d1d143809c6ae477eb53e7 | |5c3dc93736e0e
http://bugs.winehq.org/show_bug.cgi?id=28040
--- Comment #1 from Andrew Eikum aeikum@codeweavers.com 2011-08-10 07:53:25 CDT --- Sorry Jörg, I'm going to tell you to update :) Your alsa-plugins is too old. We require the handle_underrun setting to be supported to work around a PulseAudio bug[1]. Without the handle_underrun setting, your audio will drop out within about 15 minutes of playback. So your choices are:
1) Don't upgrade, remove the handle_underrun hack, and live with your audio dropping out after a few minutes; 2) Don't upgrade, leave the handle_underrun hack, and have no audio; or 3) Upgrade
I suppose there is a fourth option, which is to fiddle with the ALSA driver until the original drop-out bug stops happening. But I have spent weeks trying to make that work, and this was finally my best solution.
[1] https://bugs.launchpad.net/ubuntu/+source/alsa-plugins/+bug/805940
http://bugs.winehq.org/show_bug.cgi?id=28040
--- Comment #2 from Jörg Höhle hoehle@users.sourceforge.net 2011-08-10 10:56:33 CDT --- Strange. For over a year or more, Wine has worked well enough with PulseAudio that I repeatedly forgot "pactl exit" after logging in, i.e. PulseAudio was used. So this "15 minutes" is hard to believe. OTOH, I've had PulseAudio signal errors in rare occasions, which are usually cured with "pactl exit" in Intrepid.
Intrepid is nice because it works with and without PulseAudio. It works decently with my machines, whereas e.g. Lucid has HW issues with audio after suspend/resume and with video flickering :-( I'm considering switching to Debian but it'll cost me time.
You forgot the fifth option which I hinted at: As snd_pcm_open returns -22, retry without the extra config to not shut the door on all people with not-the-newest OS (I refuse to say "old". 3 years is *not* old, except in politics).
It is not acceptable from a user perspective that a hack for PulseAudio causes loss of sound even on desktops that have PulseAudio installed but disabled.
http://bugs.winehq.org/show_bug.cgi?id=28040
--- Comment #3 from Andrew Eikum aeikum@codeweavers.com 2011-08-10 11:03:53 CDT --- That's the same as option 1, really. It will still run into the dropped sound bug. I guess maybe that's preferable to no sound, and is certainly easy to add. I don't really relish having to dismiss bug reports from people with broken alsa-plugins versions, though.
On systems where PA is "installed but disabled," I expect that the ALSA config tree won't have "pcm.<device>.type=pulse", which the workaround checks for. If it does, then that's really someone else's bug.
http://bugs.winehq.org/show_bug.cgi?id=28040
--- Comment #4 from Jörg Höhle hoehle@users.sourceforge.net 2011-08-10 13:25:27 CDT --- Created an attachment (id=35909) --> (http://bugs.winehq.org/attachment.cgi?id=35909) patch to default to normal open when handle_underrun fails
On systems where PA is "installed but disabled," I expect that the ALSA config tree won't have "pcm.<device>.type=pulse", which the workaround checks for.
This assumption is erroneous. By disabled I meant nothing more than "pactl exit" (with auto-restart disabled). make_handle_underrun_config still finds the pulse device and reconfigures it. It is only at pcm_open time that the configuration is refused.
trace:alsa:AUDDRV_GetAudioEndpoint "default" 0x138c98 0 0x33f944 ALSA lib pcm_pulse.c:855:(_snd_pcm_pulse_open) Unknown field handle_underrun trace:alsa:AUDDRV_GetAudioEndpoint Opening PCM device "default" with handle_underrun: -22
Without fallback, open fails even when PA is not active. This is not acceptable.
My patch adds that fallback. The FIXME_ONCE functionality is based on the consideration that if handle_underrun is rejected once by Pulse, it'll always be. Better not spam the console with every invocation of PlaySound.
If you wish, one could add if(err == -EINVAL){ + ERR("Please upgrade PulseAudio & alsa-utils to at least 1.0.25\n"); handle_underrun = 0;
http://bugs.winehq.org/show_bug.cgi?id=28040
--- Comment #5 from Andrew Eikum aeikum@codeweavers.com 2011-08-10 14:35:55 CDT --- (In reply to comment #4)
Without fallback, open fails even when PA is not active. This is not acceptable.
I would say your sound API lying to the user is unacceptable. If the device is not backed by pulse, then why does it claim to be backed by pulse? Although I guess I should know better than to expect sane behavior from audio APIs by now.
I guess I'm okay with taking Option 1 here. I guess I'll add a note to the Sound wiki page explaining why users have their sound drop after a few minutes, and that they must upgrade their sound packages to fix it.
I'd prefer not to use the _ONCE-style functionality. It keeps the code a little cleaner, and I have no objection to being very loud about this failure (i.e. a pulse-backed device that doesn't allow handle_underrun).
http://bugs.winehq.org/show_bug.cgi?id=28040
--- Comment #6 from Jörg Höhle hoehle@users.sourceforge.net 2011-08-10 15:14:05 CDT --- Oops, I had forgotten that I had restarted PA by hand to rerun the mmdevapi tests. EINVAL only occurs when pulse is active under the chosen name (e.g. "default"). When "default" maps to dmix (e.g. after "pactl exit"), the configurator bails out (NULL lconf). I'm sorry for the confusion.
Still I consider it preferable to have the fallback, along with a clear FIXME or ERR line, rather than no sound on desktops running old PA (which may not be subject to that 15mins bug -- Intrepid can work for days with PA, incl. suspend/resume).
FWIW, handle_underrun addition to alsa-plugin on 2010-07-09: http://git.alsa-project.org/?p=alsa-plugins.git;a=commit;h=c20d516e229620129...
http://bugs.winehq.org/show_bug.cgi?id=28040
Rosanne DiMesio dimesio@earthlink.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |goodgod261@wp.pl
--- Comment #7 from Rosanne DiMesio dimesio@earthlink.net 2011-08-13 22:06:34 CDT --- *** Bug 28077 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=28040
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #8 from Jörg Höhle hoehle@users.sourceforge.net 2011-09-18 02:36:55 CDT --- The fallback is in wine-1.3.27, commit 8129b1847a13be248098b8d8ec773f8bdf821df6 The ERR message is in wine-1.3.28, commit 9c75a6aae5518357df464db7c352b27010dafff4
Net effect: Ubuntu Intrepid regains sound but produces the err message which should be ignored there. Ubuntu Lucid is subject to the PA/alsa_plugins bug and should not be used verbatim with PA.
http://bugs.winehq.org/show_bug.cgi?id=28040
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2011-09-23 12:59:50 CDT --- Closing bugs fixed in 1.3.29.