Thank you for your donation!


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


Does the moode palyer have some kind of status page?
#1
Setup:
Moode is running on a RPI 3b+ and uses a USB connected DAC which outputs to a power amp. 

Problem:
The power amp consumes too much power even in standby.

Idea:
Use home automation (i.e. Home Assistant) to regularly check if moode is playing anything and if it is, turn on the smart plug which powers the power amp.

Alternative idea:
Can moode trigger a webhook as soon as it starts playing? The webhook would then power the smart plug.

Clarification:
When I say “starts playing” I am referring to any and all of moode's renderers.
Reply
#2
It would require custom programming to do something like that.

You could start by looking at the "Wake local display on play" section of /var/www/daemon/watchdog.sh
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Awesome, it looks like in this section:


Code:
       # Wake local display on play
       MULTIROOM_TX=$(sqlite3 $SQLDB "SELECT value FROM cfg_system WHERE param='multiroom_tx'")
       if [[ $MULTIROOM_TX = "On" ]]; then
               DUMMY_HW_PARAMS=$(cat /proc/asound/card2/pcm0p/sub0/hw_params)
               if [[ $DUMMY_HW_PARAMS = "closed" ]]; then
                       MSG="Info: Multiroom sender is not transmitting"
               else
                       MSG="Info: Multiroom sender is transmitting"
                       wake_display
               fi
       else
               LOCAL_CARD_NUM=$(sqlite3 $SQLDB "SELECT value FROM cfg_mpd WHERE param='device'")
               LOCAL_HW_PARAMS=$(cat /proc/asound/card$LOCAL_CARD_NUM/pcm0p/sub0/hw_params)
               if [[ $LOCAL_HW_PARAMS = "closed" || $LOCAL_HW_PARAMS = "" ]]; then
                       MSG="Info: Local audio output is closed or audio device is disconnected"
               else
                       MSG="Info: Local audio output is active"
                       wake_display                                                                                                        
               fi
       fi

I only need to add a trigger to my webhook via say curl to the else section right behind "wake_display"  
I'll report back here once I have tested it. Thanks for the pointer.
Listening with the latest moOde on a RPI zero w with a MiniBoss DAC PCM5122 32bit 384kHz and a Volt+ AMP on a pair of Monitor Audio Bronze 100 speakers.

pi@moody:~ $ moodeutl -m 
CPU: 1.0 GHz, LOAD: 35% 47C | MEM: 63% used | DISK: 39% used, 4.1G free | PHP: 7 workers
Reply
#4
Looks like a plain  

Code:
curl -X POST https://home-assistant/api/webhook/secreetwebhook 

will do the trick to turn on the AMP. Now I am wondering if there is a way to turn it off when playing stops? 
Also, is there any documentation on how this works? I assume I shouldn't just edit this file, is there a way to create my own file based on this template and have it run and survive an update of moode?
Listening with the latest moOde on a RPI zero w with a MiniBoss DAC PCM5122 32bit 384kHz and a Volt+ AMP on a pair of Monitor Audio Bronze 100 speakers.

pi@moody:~ $ moodeutl -m 
CPU: 1.0 GHz, LOAD: 35% 47C | MEM: 63% used | DISK: 39% used, 4.1G free | PHP: 7 workers
Reply
#5
@ovizii

I’m curious. Does your amp turn on fast enough to avoid pops or other annoying effects at the beginning of whatever you’re playing through moOde?

As for turning the amp off again, would a simple timeout do?

ISTR that mpd doesn’t keep the output device open between tracks so you might want to look into how long the timeout interval should be. (I could be totally wrong, of course).

Regards,
Kent
Reply
#6
(06-07-2024, 05:45 PM)TheOldPresbyope Wrote: @ovizii

I’m curious. Does your amp turn on fast enough to avoid pops or other annoying effects at the beginning of whatever you’re playing through moOde?

As for turning the amp off again, would a simple timeout do?

ISTR that mpd doesn’t keep the output device open between tracks so you might want to look into how long the timeout interval should be. (I could be totally wrong, of course).

Regards,
Kent

Happy to provide all the info I can, maybe there’s a better solution to my "problem". 


I replaced a RPI(moode)+dac+amp all-in-one solution which consumed 3W in standby and 7W at the loudest I was listening.

The new solution is an RPI + USB DAC + 2x Fosi v3 monoblock. 

The monoblocks can be set via a toggle to ON, OFF, AUTO. 

OFF consumes about 0.x W 
ON consumes about 9 W in idle and 10 W at my max listening volume
AUTO consumes 3.5 W while on standby. After 10 minutes of not receiving audio, the monoblock switches from idle to standby. 

These values need to be doubled as there are 2 monoblocks. 

YES, there are audible pops when they switch on and off. Fortunately, when switching on, the pop is immediately followed by the music making not annoying at all.

The “issue” I am trying to solve is that I want to start playing music whenever I like without having to physically interact with the amps. Being because I am too lazy to get off the couch or because I am running late and want to play some music for my dog... 

A timeout to turning off the AMP would be perfect too.

Any suggestions?
Listening with the latest moOde on a RPI zero w with a MiniBoss DAC PCM5122 32bit 384kHz and a Volt+ AMP on a pair of Monitor Audio Bronze 100 speakers.

pi@moody:~ $ moodeutl -m 
CPU: 1.0 GHz, LOAD: 35% 47C | MEM: 63% used | DISK: 39% used, 4.1G free | PHP: 7 workers
Reply
#7
Those "pops" drive me nuts, but that's just me. I see from the picture in their product description that there is a soft-start thermistor in the power circuitry; I can only imagine how bad the pop would be otherwise.

Working from memory here...the watchdog script is invoked somewhere in moOde's startup sequence. It executes once, puts itself to sleep, and repeats every time it gets waked up. You can see it in the Linux process list...

Example from one of my players


Code:
xxx@m901:~ $ ps aux|grep watchdog
root          46  0.0  0.0      0     0 ?        S    Jun07   0:00 [watchdogd]
root        1581  0.1  0.2   6552  2228 ?        S    Jun07   1:44 /bin/bash /var/www/daemon/watchdog.sh 6


I expect your curl messaging scheme will fire every n seconds (it appears n=6) as long as moOde and the local audio device are active.

It seems to me it's up to your Home Assistant setup to have a similar helper script which checks periodically that moOde is still sending messages. After a suitable interval of no messages, it should turn off your monoblocks however that might be sensibly done.

I'm tempted to say leave well enough alone and let the monoblocks put themselves into standby mode, but again, that's just me.

Regards,
Kent
Reply
#8
Thanks for having a look and the good ideas. It is perfectly feasible to have the webhook flip a binary switch in HA and a HA automation flip it back after a certain timeout.

I was going to apply this until I read your last sentence:

Quote:I'm tempted to say leave well enough alone and let the monoblocks put themselves into standby mode, but again, that's just me.


and then I asked ChatGPT to calculate my savings, giving it 18W which I could save if I turned both monoblocks off for 16h a day and the price I pay per kWh and gave up on this whole idea. Its not worth the effort for saving 14.72 euros per year. Undecided

Still, nice to know how all of this works, I could still fool around with other automations based on the fact that music is playing or not :-)
Listening with the latest moOde on a RPI zero w with a MiniBoss DAC PCM5122 32bit 384kHz and a Volt+ AMP on a pair of Monitor Audio Bronze 100 speakers.

pi@moody:~ $ moodeutl -m 
CPU: 1.0 GHz, LOAD: 35% 47C | MEM: 63% used | DISK: 39% used, 4.1G free | PHP: 7 workers
Reply
#9
I have anthropoautomation 1.0 running on my system.


I walk over and turn the amp off when I'm finished listening.
----------------
Robert
Reply
#10
Wink 
(06-09-2024, 05:07 PM)the_bertrum Wrote: I have anthropoautomation 1.0 running on my system.


I walk over and turn the amp off when I'm finished listening.

It is great if that is enough, but my Home Assistant also uses this amp + moode combo to use Spotify Connect and wake me with music, raising the volume in 3 steps until there is no chance to keep sleeping ;-)
Listening with the latest moOde on a RPI zero w with a MiniBoss DAC PCM5122 32bit 384kHz and a Volt+ AMP on a pair of Monitor Audio Bronze 100 speakers.

pi@moody:~ $ moodeutl -m 
CPU: 1.0 GHz, LOAD: 35% 47C | MEM: 63% used | DISK: 39% used, 4.1G free | PHP: 7 workers
Reply


Forum Jump: