[vbox-dev] PulseAudio support rewrite [Patch]

Frank Mehnert Frank.Mehnert at Sun.COM
Fri Feb 26 09:05:49 GMT 2010


Hi Arthur,

On Thursday 25 February 2010, Arthur Taylor wrote:
> Humm. The reason there was a call to pa_stream_drain there is that
> windows likes to open the device, play a very short sound (like the
> click noise when you enter directories) and the close the device right
> away again. This causes a stream uncork, stream write, stream cork and
> then stream flush. The problem with this is that pulseaudio waits for
> at lease buffer_attr->prebuf bytes to be written before starting
> playback^1. If less than prebuf data was written, playback never
> starts and the buffer gets flushed.

The order of sequences is normally like this:

  1. the guest user application wants to play a short sound
     and calls the proper guest sound system function
  2. the guest sound system unpauses the sound card
  3. the guest sound system plays the short sound sequence
  4. now the guest sound system waits for a short amount of time
     for more audio date (for instance WinXP waits for about 2-3
     seconds)
  5. the guest sound system pauses the sound card

> In the close routine causing a 
> trigger and a drain solved this as it ensure that if playback wasn't
> started that any written data would still be played before corking
> again. The bug that this fixed was that without it the directory click
> noises and other very short sounds disappeared.

So the previous behavior was that short sound sequences were not
ignored but sometimes played with a delay of 2-3 seconds and this
isn't acceptable.

So there must be a mechanism in PulseAudio which starts playing
after a short amount of time (perhaps 20 ms or so) even if the
buffer limit is not reached. If there isn't such a mechanism, we
have to add a timer which calls pa_stream_trigger after such a
short amount of time.

Kind regards,

Frank
-- 
Dr.-Ing. Frank Mehnert

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, 85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels
Vorsitzender des Aufsichtsrates: Martin Häring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100226/faa439d2/attachment.sig>


More information about the vbox-dev mailing list