[Pianod] Music doesn't start when launched at startup

Perette Barella perette at barella.org
Tue May 7 08:41:00 PDT 2013


I expect libao builds the driver list during initialize, so you probably need to shutdown/reinitialize in your loop:
> ao_initialize();
> x = ao_default_driver_id();
> while (x<0) {
>   print failure message
+ ao_shutdown()
>   sleep a bit
+ ao_initialize()
>   x = ao_default_driver_id();
> }


> I don't have a transcript handy for version 144, but with the changes discussed earlier I get similar output except there is a 500 error on playback. 
That would be the Player Error message, so it's definite the player thread is exiting with failure.

I'm in the Mac world, so I'm not sure about redirecting from init.d scripts... but that's a good idea, to see if anything else is getting logged from the player thread before it dies.  Anyone?

Perette



On May 7, 2013, at 7:17 AM, "pi.gonewest at xoxy.net" <pi.gonewest at xoxy.net> wrote:

> Hi Perette, actually I tried that change last night but it had no effect.  Pianod continues to start in some inconsistent state, giving me internal error 500 whenever I ask to play a station.  Stopping and starting the pianod service always fixes this.  
> 
> I tried adding an early ao_default_driver_id() test up in main().  In pseudo code what I added  was something like:
> 
> ao_initialize();
> x = ao_default_driver_id();
> while (x<0) {
>   print failure message
>   sleep a bit
>   x = ao_default_driver_id();
> }
> 
> On the theory that I could just wait until the default device was available. But this code didn't make any difference. 
> 
> I implemented a command "reset audio" with the idea that, if the audio is in some inconsistent state I could use this command to manually reset, eg
>   ao_shutdown();
>   ao_initialize(); 
> But this didn't work either. 
> 
> One thing I cannot figure out is how to redirect stderr and stdio to a file in that init.d script... A little help on that would be  much appreciated and probably help everyone involved. Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deviousfish.com/pipermail/pianod-deviousfish.com/attachments/20130507/9b3e6aaa/attachment-0003.htm>


More information about the Pianod mailing list