[pulseaudio-discuss] Pulseaudio sends out zeroes to sound

Lennart Poettering lennart at poettering.net
Tue Sep 4 06:40:38 PDT 2007


On Tue, 04.09.07 18:09, DSK (dsk.in.2007 at gmail.com) wrote:

> > So, if you want to save power and have sane sound drivers+hardware,
> > load that module. If you don't care about power consumption or care
> > about those crackling noises, don't load them. The default config will
> > now load it.
> 
> Tht sounds good w.r.t to unloading  when idle for longer time ..

The default idle time is 1s, which is pretty short I would say.

> But for now,say i keep the device open, and i avoid writing zeroes to it
> wen no client is attached,
> which i tried to do by commenting out writing silence to alsa sound card and
> simply return from do_write() .
> This apparently hogs the CPU and daemon gets terminated .. So writing zeroes
> seems to be a necessary thing ..
> Though i dont understand why?

PA tries to guarantee that time advances monotonically and linearly
for all playback streams. If you stop writing data to the device you
also lose timekeeping because you cannot count the samples written to
the device anymore. To deal with this properly I have introduced the
"SUSPENDED" state for sinks/sources which makes it explicit when "time
stops".

Also, not writing data to the device offers exactly zero benefit,
since someone has to clear the hw playback buffer. If it's not PA it's
the kernel drivers themselves. It doesn't really matter which one
does.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list