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

pi.gonewest at xoxy.net pi.gonewest at xoxy.net
Tue May 7 08:32:29 PDT 2013


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. 

On May 7, 2013, at 8:26 AM, Neil Okamoto <pi.gonewest at xoxy.net> wrote:

> With version 137.  
> 
> $ nc 10.0.0.18 4445
> 200 Connected
> 100 pianod 137. Welcome!
> 141 Volume: 0
> 108 No station selected
> 103 Stopped
> user admin admin
> 132 admin signed in
> 200 Success
> 136 Privileges: admin owner service influence tuner
> select station madonna
> 132 admin selected the station: Madonna
> 109 SelectedStation: station Madonna
> 200 Success
> play
> 200 Success
> 132 admin resumed playback
> 105 Track playback complete
> 108 No station selected
> 103 Stopped
> 503 Service shutting down
> 
> On May 7, 2013, at 8:18 AM, "Jimmy Pop - jimmypopali96 at gmail.com" <pi.gonewest.8996a436fa.jimmypopali96#gmail.com at ob.0sg.net> wrote:
> 
>> After it boots, can you connect on 4445 at all? What is the output?
>> I found this a while ago, but in my pianod init.d I simply made it sleep for a bit first. 
>> 
>> 
>> 
>> 
>> James Wynhoff
>> Fuzion3
>> CA/NV Control4 Platinum Dealer
>> Web: www.Fuzion3lv.com
>> Cell: 702-587-4916
>> 
>> 
>> 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!
>>> 
>>> On May 7, 2013, at 5:19 AM, "Perette Barella - perette at barella.org" wrote:
>>> 
>>>> Hi guys,
>>>> 
>>>> You're right about the ao_default_driver_id.
>>>> 	if (audioOutDriver < 0) {
>>>> 		audioOutDriver = ao_default_driver_id();
>>>> +		if (audioOutDriver < 0) {
>>>> +			BarUiMsg (player->settings, MSG_ERR, "No audio driver available\n");
>>>> +			return NULL;
>>>> +		}
>>>> 	}
>>>> 
>>>> 
>>>> But if taking the play out of the startscript didn't work for GoneWest, there must be something more.  Is it dropping a core?  If you ./configure --enable-debug, it compiles with -g and you should get core dumps suitable for loading into GDB to find out exactly where it's dying.
>>>> 
>>>> Perette
>>>> 
>>>> 
>>>> On 2013年05月07日, at 1:00, pi.gonewest at xoxy.net wrote:
>>>> 
>>>>> 
>>>>> Chinasaur and I have been discussing this same issue on the Raspberry Pi forums. (http://www.raspberrypi.org/phpBB3/viewtopic.php?f=35&t=37494&p=344130#p344130)
>>>>> 
>>>>> In my case if I setup pianod to play immediately upon launching it fails, but if I immediately restart the service without changing anything else playback works fine.  My thought is the daemon is trying to play before the audio driver is completely ready.
>>>>> 
>>>>> So I'm going to try two things:
>>>>> 
>>>>> (1) remove the "play" command from my startscript.  Looks to me like pianod doesn't try opening a playback channel until it needs to play a song, so if I boot with pianod in an idle state then I can choose how long to wait before selecting a station.
>>>>> 
>>>>> (2) change the player logic.  BarPlayerOpenAudioOut(). The function calls
>>>>> 
>>>>> if (audioOutDriver < 0) {
>>>>>       audioOutDriver = ao_default_driver_id();
>>>>> }
>>>>> 
>>>>> but according to the libao documentation, ao_default_driver_id() can return -1 if there is no usable audio output device. There's some logic that assumes it's possible to fall back to a "default" device but in my case I'm already using the default.   I want to see if there's some way to detect this case and fail more gracefully, e.g. pause and retry or something along those lines.
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Pianod mailing list
>>>>> Pianod at lists.deviousfish.com
>>>>> http://lists.deviousfish.com/listinfo.cgi/pianod-deviousfish.com
>>>> 
>>>> _______________________________________________
>>>> Pianod mailing list
>>>> Pianod at lists.deviousfish.com
>>>> http://lists.deviousfish.com/listinfo.cgi/pianod-deviousfish.com
>>> _______________________________________________
>>> Pianod mailing list
>>> Pianod at lists.deviousfish.com
>>> http://lists.deviousfish.com/listinfo.cgi/pianod-deviousfish.com
>> _______________________________________________
>> Pianod mailing list
>> Pianod at lists.deviousfish.com
>> http://lists.deviousfish.com/listinfo.cgi/pianod-deviousfish.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deviousfish.com/pipermail/pianod-deviousfish.com/attachments/20130507/30d63081/attachment-0003.htm>


More information about the Pianod mailing list