[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Tune started from rc.local plays to completion, before bootup continues



On Sunday 22 February 2009 16:22, Craig White wrote:
> On Sun, 2009-02-22 at 16:13 +0100, Nigel Henry wrote:
> > Experimenting a bit, I set up a one liner in rc.local, which uses aplay
> > to play a tune which I put in /usr/local. See below.
> >
> > aplay /usr/local/Summer-in-the-city.wav
> >
> > I had to disable pulseaudio, by removing alsa-plugins-pulseaudio,
> > otherwise the tune wouldn't play, but perhaps further aplay options are
> > needed to get the tune to play with pulseaudio enabled.
> >
> > The question is though. When the tune is playing the bootup sequence
> > stops, until the tune has finished playing, then procedes.
> >
> > Is there a way for the tune, which is fired off from rc.local, to play
> > without interrupting the boot process?
> >
> > Thanks in advance for any incantations that may resolve the problem.
>
> ----
> add an & to the end of the line so it forks its own process and allows
> rc.local to complete...
>
> aplay /usr/local/Summer-in-the-city.wav &
>
> and I would think that the problem you had with pulseaudio playing this
> music is that rc.local is executed as root but root wouldn't have
> pulseaudio running unless root had already logged in.
>
> Craig

Hi Craig. Thanks to you and Andras for the suggestion to add the & to the end 
of the line, which has done the job. Now the tune plays, and the bootup 
continues to GDM loginscreen, and post login, when logged into KDE, or Gnome. 
When the tune finishes, there are no problems with running sound apps in user 
space. Bear in mind, that is with pulseaudio disabled, by my having removed 
alsa-plugins-pulseaudio, which also removes kde-settings-pulseaudio.

Going back to the problem, where aplay would not play the tune on bootup, when 
pulseaudio was enabled, I played around with aplay options in /etc/rc.local 
to see if the tune would play with pulseaudio enabled. Originally, it had 
been as below with pulseaudio enabled, and the tune would not play.

aplay /usr/local/Summer-in-the-city.wav

Now I change the line above in /etc/rc.local, to the one below, and now the 
tune plays with pulseaudio enabled.

aplay -D hw:0 /usr/local/Summer-in-the-city.wav

The problem now, is that the tune is playing when I login to either Gnome, or 
KDE, and continues to completion when logged in, but after the tune finishes, 
I have no sounds in either Gnome or KDE, depending on which desktop I'd 
logged into.

If for example I'd logged into KDE, I have no sounds. If I logout, and back in 
to Gnome, the sounds come back. If I then logout of Gnome, and back in to 
KDE, I also have sounds again. This has to be some pulseaudio related 
problem, as when pulseaudio is disabled, playing the tune above, which is 
started from /etc/rc.local, and continues post login until completion, there 
are no problems with playing sound apps on either KDE, or Gnome.

Perhaps I'll ask on the alsa developers list, as Lennart (author of 
pulseaudio) hangs out there. Maybe he will have an answer.

Thanks guys for your replies though. At least one problem is resolved.

Nigel.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]