Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Auto-Play radio stream (on weekday mornings) immediately after power on
#1
I’m running MoOde 7.0.1 on a pi that’s powered from USB charge outlet on my amp, which has the benefit of less clutter from wires which appeals to me.  The sang is however, I think this approach of effectively powering up the pi at the same time as switching on my amp precludes me from making use of MoOde’s radio alarm function.

I’ve attempted to make use of it, but nothing auto plays and instead an error message is displayed on the UI, reading: “MPD error JSON parse unexpected end of data at line 1 column 1 of the json data”.  I dug out the log file when this occurred and noticed two entries informing “moode.php: MPD connect failed: cmd=(playlist)” and it also features a succession of entries reading: “watchdog: Error: PHP session permissions (reapplied)”.

I know very little about programming but I sort of get it why these errors may have occurred – MoOde needs to run 24/7 for the radio function to work.  Typically, I need to slug a couple of coffees to get going in the morning, so this is bit of a hardship.  Please, I don’t want to impose on Tim - can anybody help me out so 1 can listen to a radio stream on weekday mornings?
Reply
#2
How is pi connected to Amp?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Hi Tim, The amp is a Tangent Ampster II, which on its rear features a USB charge 5VDC/1A socket - the pi is connected to that
Reply
#4
I'm not clear what your setup/requirements are here. Something needs to have power supplied to it all the time to know what the time is and "wake" the rest of the system at the appropriate time. If the Pi and the amp are powered on at the same time, what is providing the clock function?
----------------
Robert
Reply
#5
(03-08-2021, 04:04 PM)the_bertrum Wrote: I'm not clear what your setup/requirements are here.  Something needs to have power supplied to it all the time to know what the time is and "wake" the rest of the system at the appropriate time.  If the Pi and the amp are powered on at the same time, what is providing the clock function?

Thanks for the message @the_bertrum. I tried hard to be clear in my post. What I’d love some help with is getting MoOde to auto play a radio stream on w/day mornings. I thought this could be achieved by the radio alarm function, but since my pi isn’t powered on 24/7 that doesn’t work. I’ve definitely set MoOdes alarm to go off at 6.30am. I switch on the amp shortly after this, which in turn, after a tiny delay, power ups the pi and MoOde kicks into action - but nothing happens, no radio stream is played.

It would make a massive difference to my mornings if on my setup for powering the pi, MoOde could play a radio stream, without me needing to do anything. Can you help @the_bertrum?
Incidentally my pi is the 2b model, it’s got an iq–audio dac+ attached , and with the exception of the radio alarm function not working in manner I  would like, MoOde is fully operational.
Reply
#6
OK, so if there is no power to moOde then it can't run the script to play your radio station at 6:30.  If you are manually turning on the amp and waiting for that to boot the Pi you have two options that I can think of.

  1. In m/configure/audio set the "Autoplay after start" to ON, then you can turn the amp on, wait for moOde to boot at which point it will begin playing what ever was playing when it turned off.  Obviously that method will require you to select the correct station before you shut it down.
  2. Set your alarm clock function to about 5 minutes after you turn the amp on.  This way the amp supplies power and moOde has time to boot up, discover what time it is from the network, then run the alarm script at the right time after it has started properly.
I suspect however that the best thing to do really is simply power your moOde device from it's own supply and not turn it off.  If you are killing power to the amp to turn things off then moOde is effectively being shut down in an uncontrolled way every day, which won't be good for it.
----------------
Robert
Reply
#7
(03-09-2021, 08:54 AM)the_bertrum Wrote: OK, so if there is no power to moOde then it can't run the script to play your radio station at 6:30.  If you are manually turning on the amp and waiting for that to boot the Pi you have two options that I can think of.

  1. In m/configure/audio set the "Autoplay after start" to ON, then you can turn the amp on, wait for moOde to boot at which point it will begin playing what ever was playing when it turned off.  Obviously that method will require you to select the correct station before you shut it down.
  2. Set your alarm clock function to about 5 minutes after you turn the amp on.  This way the amp supplies power and moOde has time to boot up, discover what time it is from the network, then run the alarm script at the right time after it has started properly.
I suspect however that the best thing to do really is simply power your moOde device from it's own supply and not turn it off.  If you are killing power to the amp to turn things off then moOde is effectively being shut down in an uncontrolled way every day, which won't be good for it.

I really appreciate you get back to me.  I think you’re absolutely right in that the reason why the radio alarm didn’t work is that I’m purposely not powering up the pi until after the time I had set and it was wrong for me to have presumed that this could have some how triggered the alarm to have been activated and for the radio stream to have been played.  I now know that the radio alarm function sadly just doesn’t cater for that situation.

I’ve gotta say, I’ve been an avid follower and user of Moode Audio for many years now and have always switched my pi off at the mains, when I wasn’t using it then back again and I have never experienced any issue with MoOde or had a corrupted micro sd card, which I guess is probably the worst thing that could happen.  But there again, I've never stored any media content on a USB drive hanging off the pi, which I suspect is where many issues could occur, or be related to.
 
So, back to my ideal of Moode playing a radio stream on week day mornings. My Tangent Ampster II amp isn’t the only device out there which can provide power to a pi – take for instance the Kanto YU4 powered speakers, the Audio Pro Addon T3, or Ruark Audio’s MR1 Mkii – so there may well be other folk who would like to utilise that possibility.

Your suggestion of ‘auto-play after start’ is certainly a good idea, but at first in the morning I don’t necessarily want to listen again to some random track that I happened to play last the night before – indeed, in the early hours of day, I would much rather listen to a radio stream, with me needing to do very little.  It certainly would be welcomed if 'auto-play after start' could be modified to active a specific radio stream, if that could be easily implemented.

However, I’m still hoping some talented individual with some knowledge of coding would generously step forward and provide a better solution.  As I previously mentioned I’ve no experience in these ways, but I now gather a combination of Cron tab and Anacron potentially could be the ideal way to go…
Reply
#8
My personal experience is to use the 7.00 version of wonderful moode and active the autoplay as described above by the_bertrum. On 7.0.1 this function doesn't work very well.
I reinstalled the previous version (7.0.0) and everything works correctly every time I turn on my soundbar (Hifiberry optical DAC) or the other n.3 stereos where I have many different models of raspberry with many different models of DAC (Hifiberry, Boss, ecc.).
Another suggestion is to use a separate power supply (i.e. Meanwell IRM-15-5) for raspberry activated by a 5 V voltage derived from the amplifier (i.e. USB), thru 5V relay (i.e. for Arduino like).
With these suggestions, in my cases, I have overcome also the problem of the uncontrolled shut down.
Reply
#9
Whan you say "On 7.0.1 this function doesn't work very well. " what exactly do you mean?

The auto-play code hasn't changed in a long time but I can't rule out anything. If you can describe a specific case where it doesn't work I'll investigate.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#10
Nvm. There is a bug that causes Auto-play to receive an empty songid during startup.

Fixed in upcoming 7.1.0
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: