Hi,

CJ van den Berg <[EMAIL PROTECTED]> writes:
> Yes, that is correct. You need to comment out module-detect and
> module-hal-detect to use auto-load because they both load the alsa module
> automatically.

I commented

load-module module-alsa-sink device=hw:0
load-module module-alsa-source device=hw:0

out and added

add-autoload-sink output module-alsa-sink device=hw:0 sink_name=output

Now pulseaudio does not keep the devices open or consume extra cpu
time. However, when I try to use pulseaudio from mplayer (through
alsa) I get

*** PULSEAUDIO: Unable to create stream.
alsa-init: unable to set hw-parameters: Input/output error
Could not open/initialize audio device -> no sound.

"sudo pacmd" says "pacmd.c: no PulseAudio daemon running" but the
daemon clearly is running according to ps but this is probably a
different problem since I have not ever managed to get pacmd working
even though strace clearly shows

21700 open("/usr/lib/pulse-0.9/modules/module-cli.so", O_RDONLY) = 12

If I do "sudo pulseaudio" (skipping init.d script) "list-sinks" does
not initially show anything but when I start mplayer it shows my usual
hw:0 there and then mplayer does not complain! (I can't verify if it
really plays anything since I'm debugging this remotely).

Strace shows the following differences in files that are opened in both cases:

$ grep open\( pulseaudio-from-init.d.strace s|grep dev
21734 open("/dev/tty", O_RDWR|O_NONBLOCK|O_LARGEFILE) = 3
21735 open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 3
21736 open("/dev/null", O_RDONLY|O_LARGEFILE) = 0
21736 open("/dev/null", O_WRONLY|O_LARGEFILE) = 1
21736 open("/dev/null", O_WRONLY|O_LARGEFILE) = 2
21736 open("/dev/tty", O_RDWR|O_LARGEFILE) = -1 ENXIO (No such device or 
address)
21736 open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 6
[EMAIL PROTECTED]:~$ grep open\( pulseaudio-from-commandline-as-root.strace 
|grep dev
21732 open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 3
21732 open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 5
21732 open("/dev/snd/controlC0", O_RDONLY) = 11
21732 open("/dev/snd/controlC0", O_RDWR) = 11
21732 open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 12
21732 open("/dev/snd/controlC0", O_RDONLY) = 11
21732 open("/dev/snd/controlC0", O_RDWR) = 11

At this point I noticed DISALLOW_MODULE_LOADING in /etc/default/pulse
but changing it to 0 did not seem to have any effect either. Then I
tried --system and noticed that "sudo pulseaudio" works but "sudo
pulseaudio --system" doesn't cause the mplayer errors. strace output
difference between these two cases is very long and I can't see any
obvious problems. Both get

recvmsg(7, {msg_name(0)=NULL, msg_iov(1)=[{"L\0\0\0\tL\0\0\0\1tALSA plug-in 
[mplayer]\0", 34}]

and "sudo pulseaudio" then proceeds with

open("/usr/lib/pulse-0.9/modules/module-alsa-sink.so", O_RDONLY)

while "sudo pulseaudio --system" just does

send(7, "\0\0\0\17\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0", 20, MSG_NOSIGNAL)

which apparently tells mplayer that pulseaudio is unable to create the
stream. Also, sound works with "pulseaudio" started with the
priviledges of my normal user account.

I also briefly grep'd though pulseaudio source for "system" but could
not find anything related to autoloading modules. Any idea what should
I check next?

best regards,
Timo Lindfors


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to