[pulseaudio-discuss] Pulseaudio on the XO

Simon Schamijer simon at schampijer.de
Tue Jul 24 13:35:52 PDT 2007


Hi Keith,

thanks for your comments.


keith preston wrote:
> If you want gstreamer to be efficent in an embedded device you really have
> to crank up the buffers.   This can be done by changing the "buffer-time"
> and "latency-time" on the pulsesink.   I use this instead of an alsasink.
> I generally use times like 180ms for buffer and 60ms for latency.   The
> properties come from the base class audio ring buffer that the pulse sink
> derives from.   I believe the alsasink is the same way.

I set the settings with gconftool:

gconftool-2 -t string --set /system/gstreamer/0.10/default/audiosink
'pulsesink buffer-time=180 latency-time=60'

and this sounds better now. clicks are gone for most of the time. I am 
not really convinced though of gstreamer. It uses roughly 40% of cpu 
when running on the XO and playing back an ogg file. I put together a 
simple pa client which uses liboog and this one consumes about 18%. I am 
aware that gstreamer has got a lot of features but in such an 
environment this is probably not needed. Anyway.

> I have tried another hack that made the alsa-pulse plugin refuse to set
> small buffers.   This was by changing the capabilites function of the alsa
> plugin to say that there was a minimum frag size of like 16kb or something.
> This helped for native alsa applications.
> 
> The biggest problem you will find with running it on the XO, (i've said 
> this
> before on the list)  is resampling, mixing, and software volume.
> Resampling has a little hope as there is a decent fixed point library from
> speex that is close to being done and released.   It's not hard to
> integrate.

Indeed - the problem about the resampling performance was one thing I 
have found out in my tests as well. I have been reading through the old 
thread about the resample library and will give it a go.

> As for mixing and software volume, there need to be a lot of change.   I am
> currently using a library by my processor vendor for all three of these
> areas.

On the last thread there were discussions about those changes - is this 
still on the list of future changes?

> A few hints for lowering CPU usage  Use autoload for the alsasink with a
> quick timeout.  Pulse will use 0% when no audio is playing.   Use large
> fragment sizes, my alsasink works in 6kb increments right now.

Using autoload with a quick timeout is a good one ( You mean this 
parameter I guess --module-idle-time=sec). Have been playing around with 
the fragment sizes as well.

Best,
    Simon





> 
> On 7/23/07, Simon Schamijer <simon at schampijer.de> wrote:
>>
>> Hi,
>>
>> I have put up a site where I posted my tests on using pulseaudio within
>> the OLPC environment.
>>
>> http://wiki.laptop.org/go/Pulseaudio
>>
>> Please feel free to add and comment.
>>
>> What I am a bit puzzled about is the gstreamer section. When using alsa
>>   or native clients I can run pulseaudio with sr=44100Hz on the XO.
>> When it comes to use csound, gstreamer or the sdl-mixer I have to go
>> down to 22kHz and you have to use large buffers in both csound and
>> sdl-mixer to avoid clicking. This seams not to help with gstreamer. When
>> gstreamer is connected you have mostly a click at the beginning of the
>> playback.
>>
>> I changed the fragment settings of the ALSA module of pulseaudio and
>> tried to change the buffer settings in gstreamer as well.
>>
>> gst-launch-0.10 filesrc location=/home/olpc/guitcello.ogg ! oggdemux !
>> vorbisdec ! audioconvert ! 'buffer-size=2048'
>>
>> add-autoload-sink output module-alsa-sink device=plughw:0,0 rate=22050
>> sink_name=output fragments=12 fragment_size=1024
>>
>> No luck so far. More details on the tests can be found on the wiki side.
>> Maybe someone here has an idea what else I could try.
>>
>> Best,
>>     Simon
>> _______________________________________________
>> pulseaudio-discuss mailing list
>> pulseaudio-discuss at mail.0pointer.de
>> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss





More information about the pulseaudio-discuss mailing list