You are not logged in.

#1 2011-08-29 21:47:11

adr3nal1n
Member
Registered: 2010-09-23
Posts: 60

[SOLVED] How to start pulseaudio on boot without a DE or WM? (XBMC)

Hi Guys,

I run XBMC without a desktop environment or Window Manager, it launches via my .xinitrc as below:

exec /usr/bin/ck-launch-session /usr/bin/dbus-launch --exit-with-session /usr/bin/xbmc --standalone -fs

I can use pulseaudio with xbmc if I run from an ssh session "/usr/bin/start-pulseaudio-x11" after xbmc has loaded up.

My question is, how do I start this automatically? If I add /usr/bin/start-pulseaudio-x11 directly above the exec line in my .xinitrc XBMC seems to take a good deal longer to start.

Any tips much appreciated.

Last edited by adr3nal1n (2011-08-30 19:11:01)

Offline

#2 2011-08-30 12:27:24

vendion
Member
From: Tennessee, USA
Registered: 2010-03-10
Posts: 204
Website

Re: [SOLVED] How to start pulseaudio on boot without a DE or WM? (XBMC)

Have you tried backgrounding your call to start-pulseaudio-x11?  Try calling it like

/usr/bin/start-pulseaudio-x11 &

that way while pulse is starting your system can also be starting up XBMC, won't solve the fact that Pulse takes a bit to start but should make it less noticeable.

Last edited by vendion (2011-08-30 12:28:06)

Offline

#3 2011-08-30 18:51:33

adr3nal1n
Member
Registered: 2010-09-23
Posts: 60

Re: [SOLVED] How to start pulseaudio on boot without a DE or WM? (XBMC)

Thanks very much Vendion, I have tried as you suggested and it does work and XBMC loads up faster as a result of pulseaudio starting in the background. However this method leaves a defunct pulseaudio process after XBMC has started (along with the running pulseaudio processes). Is this normal when starting a process in the background from .xinitrc?

Out of curiosity, I have also tried another approach. I #'ed out the "/usr/bin/start-pulseaudio-x11 &"entry in the .xinitrc and added "/usr/bin/start-pulseaudio-x11" (without the &) at the start of the /usr/bin/xbmc shell script that the exec line of the .xinitrc uses to launch xbmc and it loads just as fast as the suggested approach but minus the defunct pulseaudio process after xbmc starts. Weird, because if I try removing the & from the /usr/bin/start-pulseaudio-x11" entry in .xintrc pulseaudio seems to hang on startup and /var/log/everything.log shows console kit timeout errors.

I am happy I have a fix for this now, I am just confused as to the behaviour encountered when trying to do this in the .xinitrc rather than editiing the xbmc launch script directly. Have you seen anything like this before?

Thanks again for all your help on this.

Offline

#4 2011-08-30 18:58:45

vendion
Member
From: Tennessee, USA
Registered: 2010-03-10
Posts: 204
Website

Re: [SOLVED] How to start pulseaudio on boot without a DE or WM? (XBMC)

It is strange to me as well that calling start-pulseaudio-x11 in the foreground from xbmc's launcher script is more effective than calling it from .xinitrc even in the background.  Glad to hear that you have a solution for this, just need to watch out for updates to xbmc now.  Pacman should just create a .pacnew file for /usr/bin/xbmc if that ever changes just make sure to merge them in manually when they are made.

Offline

#5 2011-08-30 19:09:42

adr3nal1n
Member
Registered: 2010-09-23
Posts: 60

Re: [SOLVED] How to start pulseaudio on boot without a DE or WM? (XBMC)

Yeah, for sure, I will, as you say, have to be aware of xbmc package upgrades in future and merge changes in the launch script.

Thanks again for all your help Vendion, XBMC is running nicely now with Pulseaudio providing simultaneous sound card output (analog stereo to hi-fi & hdmi out to TV), even crossfade of music tracks now works on both outputs. :-) (I tried to achieve this previously with ALSA, dmix and some funky pcm slave config but couldn't never get crossfade working on the Analog Stereo card output, it only ever worked on hdmi to TV)

Enjoying the Arch Linux scene...

Offline

#6 2011-09-25 03:03:52

kd0bpv
Member
Registered: 2010-11-23
Posts: 26

Re: [SOLVED] How to start pulseaudio on boot without a DE or WM? (XBMC)

Wouldn't it be better to start pulseaudio from the "DAEMONS" line in /etc/rc.conf or by adding it to /etc/inittab? If so, how can this be done? Personally, I use KDE, so PA will just start when I log in, but I'd rather have it running and ready by the time KDM starts. This way, I don't have to be logged in to pipe audio from my line in to my speakers.

I know that for the inittab method, it'd be along the lines of adding "pa:5:respawn:/usr/bin/pulseaudio" to /etc/inittab, but should there be any particular parameters passed to it aswell? Would starting PA in this way require any other configuration changes?

Last edited by kd0bpv (2011-09-25 03:23:33)

Offline

#7 2011-09-25 04:51:18

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,860

Re: [SOLVED] How to start pulseaudio on boot without a DE or WM? (XBMC)

kd0bpv wrote:

Wouldn't it be better to start pulseaudio from the "DAEMONS" line in /etc/rc.conf or by adding it to /etc/inittab? If so, how can this be done? ...
... Would starting PA in this way require any other configuration changes?

It is highly discouraged.  From the source: http://www.pulseaudio.org/wiki/WhatIsWr … SystemMode


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB