Modified by: [email protected]
Date: 11/19/2009
Project: RealPlayer for Netbook
Synopsis:
Fixing bug #9770: Crash occasionally when seeking audio content.
It was caused by pa_stream_flush() calls without locking mainloop.
Overview:
Intel noticed that RealPlayer's PulseAudio support
crash occassionally (reported as a probably "random" 10%).
It was found to be repro-able by clicking the timeline bar
as quickly as possible for about 2 minutes or more.
This turned out to be a real bug with:
pa_stream_flush()
called from outside PulseAudio (equivalently Helix audio) thread during:
CAudioOutLinuxPA::_Reset()
calls.
pa_stream_flush() was added last in the PulseAudio implementation
to make seek performance really good,
but I must have not gone through the file one more time
making sure that all "outside" PulseAudio function calls were made
with PulseAudio mainloop locking.
(It is the second bug reported by customer
with the new PulseAudio implementation.
This is the first bug that was found by the customer
that I wasn't aware of.)
This change simply add mainloop locking before calling:
pa_stream_flush().
Files Modified:
audio/device/platform/unix/audlinux_pulseaudio.cpp
Image Size and Heap Use impact (Client -Only):
None.
Platforms and Profiles Affected:
Linux
Distribution Libraries Affected:
None.
Distribution library impact and planned action:
None.
Platforms and Profiles Build Verified:
Profile: helix_client_moblin
Platform: linux-2.2-libc6-gcc32-i586
Platforms and Profiles Functionality verified:
Profile: helix_client_moblin
Platform: linux-2.2-libc6-gcc32-i586
Branch: 310Atlas, 3_4_10Atlas.
Copyright assignment: I am a RealNetworks employee.
--
Daniel Yek.
Index: audio/device/platform/unix/audlinux_pulseaudio.cpp
===================================================================
RCS file: /cvsroot/audio/device/platform/unix/audlinux_pulseaudio.cpp,v
retrieving revision 1.1.2.1.6.4
diff -u -w -r1.1.2.1.6.4 audlinux_pulseaudio.cpp
--- audio/device/platform/unix/audlinux_pulseaudio.cpp 12 Dec 2009 22:36:22 -0000 1.1.2.1.6.4
+++ audio/device/platform/unix/audlinux_pulseaudio.cpp 14 Dec 2009 23:55:05 -0000
@@ -1553,10 +1553,14 @@
{
HXLOGL4 (HXLOG_ADEV, "CAudioOutLinuxPA::_Reset(): Throwing away Audio Data!");
+ HX_LOCK(m_pPulseAudioMainloopLock);
+
pa_operation *op = pa_stream_flush(m_pa_stream,
NULL, // pa_stream_success_cb_t; Don't wait for flush!
NULL); // userdata
hx_pa_operation_unref(op);
+
+ HX_UNLOCK(m_pPulseAudioMainloopLock);
}
}
_______________________________________________
Audio-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/audio-dev