[pulseaudio-discuss] Dealing with the PC speaker sound output via ALSA, aka snd-pcsp

Colin Guthrie gmane at colin.guthr.ie
Fri Sep 12 05:50:23 PDT 2008


Luke Yelavich wrote:
> Greetings all, Ubuntu intrepid will be shipping kernel version
> 2.6.27, and alsa 1.0.17. However, for some reason which I am not
> really sure of yet, our kernel team have enabled snd-pcsp, and
> disabled pcspkr, resulting in the PC speakerbeing available for audio
> output. We have also added relevant options to ensure that snd-pcsp
> is not the first card, however when pulseaudio loads, hal lists the
> PC speaker device first, causing pulseaudio to use it as the default
> sink, unless the user has configuration present that states
> otherwise.

If you've still got time, I'd go for alsa 1.0.18 which will be
finished in < 2wks. Certainly I'd backport all the pulse code from
1.0.18 to your alsa-plugins package at very least as it contains a
substantial rewrite that solves a lot of issues.

> At the moment, I have patched the hal module to prevent the PC
> speaker being available as a sink, however from arguments put to me,
> the PC speaker being available as a sink *MAY* be useful at times.
> 
> Attempting to look at this from an upstream's point of view, I think
> it would be better to patch the hal module to enable the PC speaker
> as a sink option, but after all other sinks have been set up,
> ensuring that the PC speaker sink will only be used if the user
> requests it. However, you may well want to blacklist it entirely.
> 
> So I'm interested in people's thoughts on the matter. If Lennart
> thinks its worth changing something along either these two lines, I'm
> happy to send a patch through.

Hmmm, interesting problem.

One possible solution would be to take a similar approach to my 
always-sink module which is included in PA since 0.9.11.

It ensures that a sink is always available even if there is no real 
hardware there. At present this is a null sink (it was developed in 
response to deploying PA by default on e.g. a virtualbox setup that has 
no sound hardware defined - the inability of some apps to output caused 
issues so keeping a null-sink always loaded was a neat enough workaround 
for this).

If hal-detect was blacklisted to ignore snd-pcsp, then you could always 
modify the always-sink module to try and load the alsa sink with the 
snd-pcsp device first before loading a null sink. If it loads then this 
will be used as your fallback.

I've not given this much thought so it's maybe a stupid suggesting, and 
it would also stop the pcsp being loaded at the same time as a real 
device (unless it was loaded manually of course), but I don't think 
that's necessarily a major restriction anyone would care about!

Some food for thought perhaps...

Col.


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list