Moode Audio Player for Raspberry Pi

Is there an API for Moode Audio that I can tap into locally? Planning on installing Python3 and displaying some output on a 4x20 display. Looking for currently playing song, track length, current position, stopped/started etc. I couldn't see anything in the docs. Any help appreciated!

Hi,

Moode 2.5+ (Jan 2016) will include an API guide. I'm working on a test release for end of Dec 🙂

The interface for external apps is as follows:

(1) Enhanced metadata that appears on the UI including the coverart url for song files and radio stations is written to /var/www/currentsong.txt. For example:

artist: Joe Sample
album: Old Places Old Faces
title: Miles Of Blues
coverurl: /coverart.php/NAS%2FMusic%2FJoe%20Sample%2FOld%20Places%20Old%20Faces%2F09%20Miles%20Of%20Blues.m4a

(2) Moode System config setting to enable an inotifywait script that runs a user created Python or other script when currentsong.txt changes. This is strictly for LCD panels. If touchscreen is being used and and input is being accepted then the Python script itself has to perform the event loop and currentsong.txt change detection, inotifywait cannot be used.

while inotifywait -e close_write /var/www/currentsong.txt;
do "run the Python script that updates the LCD"
done > /dev/null 2>&1 &

(3) SQLite interface to Moode for reading any of the settings. For example:

- get all settings:
sqlite3 /var/www/db/player.db "select param, value from cfg_engine;"

- get Airplay receiver on/off setting
sqlite3 /var/www/db/player.db "select value from cfg_engine where param='shairport';"

- get volume knob setting
sqlite3 /var/www/db/player.db "select value from cfg_engine where param='volknob';"

(5) Volume and mute can be controlled via /var/www/vol.sh locally or via Browser "http://moode/command?cmd=vol.sh <args>". Vol.sh is a complete interface to the volume mapping logic Moode uses to provide logarithmic volume curve, it handles configs with and without hardware volume controllers, and it updates the UI for example:

/var/www/vol.sh -get volume knob setting
/var/www/vol.sh 45 -set volume to 45
/var/www/vol.sh dn 5 -set volume down by 5
/var/www/vol.sh mute -toggle mute state

(6) MPD state can be obtained using MPC command for example:

root@rp4:~# mpc status
Joe Sample - Miles Of Blues
[playing] #1474/3483 0:24/6:05 (6%)
volume: 72% repeat: off random: off single: off consume: off

Enjoy the holidays !

Regards,
Tim
 
Just started using moOde the other day with a Pi2 and a Meridian Explorer 2 DAC after using Rune and Volumio and moOde seems to drag out a little more detail in the music

Plus works ok with 24bit audio also got myself a 7" touch screen the other day but after seeing all the code which has to be added i had to step away as stuff like that is way beyond me so fingers crossed the next update makes it easier to add for a noob like me 🙂
 
I really like Moode, especially the extended list of radio stations that include BBC--means I don't have to run minimserver and minimstreamer in order to listen to those. I've got it set up on a RPI with a Hifiberry and it sounds great. It's definitely my go-to setup, although the only other option I've tried is volumio.

I'm sure someone else has mentioned this, but the MiniDLNA package is out of date. It crashes when it's set to scan a disk containing more than a couple thousand files. I tried manually updating the package but this seems to break the library viewer function in the web interface. Any ideas about why this is?
 
I'm sure someone else has mentioned this, but the MiniDLNA package is out of date. It crashes when it's set to scan a disk containing more than a couple thousand files. I tried manually updating the package but this seems to break the library viewer function in the web interface. Any ideas about why this is?

I've over 11,000 file about 151GB of music sat on a network drive and not had a problem "touch wood"
 
Just started using moOde the other day with a Pi2 and a Meridian Explorer 2 DAC after using Rune and Volumio and moOde seems to drag out a little more detail in the music

Plus works ok with 24bit audio also got myself a 7" touch screen the other day but after seeing all the code which has to be added i had to step away as stuff like that is way beyond me so fingers crossed the next update makes it easier to add for a noob like me 🙂

Hi,

Just an FYI:

Moode UI is 4:3 aspect ratio like iPad. It will be cropped on the bottom on Raspberry Pi 7" touchscreen which is 16:10 a/r.

Since there is no USB-like standard interface for Pi LCD's and touchscreens, I'm not able to easily create a universal LCD/Touchscreen configuration feature.

What I'm planning to do for Moode 2.5+ is provide an API that allows external apps to easily get the enhanced song and radio station metadata, player settings and an event loop for updating non-touch LCD's.

Regards
Tim
 
I really like Moode, especially the extended list of radio stations that include BBC--means I don't have to run minimserver and minimstreamer in order to listen to those. I've got it set up on a RPI with a Hifiberry and it sounds great. It's definitely my go-to setup, although the only other option I've tried is volumio.

I'm sure someone else has mentioned this, but the MiniDLNA package is out of date. It crashes when it's set to scan a disk containing more than a couple thousand files. I tried manually updating the package but this seems to break the library viewer function in the web interface. Any ideas about why this is?

Hi,

Crash is probably due to "no free space" condition.

In the original code, the miniDLNA database is created in /run dir (tmpfs) which is not very big.

Here is post that explains a workaround. The user has 46K files successfully indexed after changing the location of the db: Moode Audio Player for Raspberry Pi - Page 15

I have a TODO to move the db to /root 🙂

Regards,
Tim
 
Hello, new member and new moode user here. English is not my native language. First of all, thank you for this great software. I'm amazed by the value you created. With this toy-like device I have a complete multimedia solution (I use a dual boot system with moode and osmc). I have some feature requests or ideas here since I see the developer is listening. I don't know if any of these are viable though. 1. In library view if an artist is selected but a corresponding album is not, all tracks of that artist could be shown. 2. There could be a song info somewhere, probably in all view, that shows file name, location, format. Some of the info could be inline, others/complete on the actions menu. 3. Reboot to a different partition. I have two OSes installed parallel without any boot manager: moode is in the first partition, osmc is in the second. This way moode loads default, and if I want to load osmc, then I run a shell script via ssh which is basically: echo 2 > /sys/module/bcm2709/parameters/reboot_part and the reboot. It would be a convenient solution to have a similar command in the reboot command popup (probably hidden by default no to confuse other users). I saw that many people sought for a similar solution to have a multi boot environment. Probably it could be implemented in a more general way to let the user choose to run a script via the web interface. 4. As I know there is a directive in EU that electronic devices should implement auto-standby function. My NAD stereo amplifier has a sleep timer too that kicks in if there is no signal for 30 min. Therefore the clock radio cannot be used for wake up (if that was the goal). So there could be a keep-alive solution probably playing a non-audible signal periodically if the clock radio is set and no other sound is played. And for waking up, the volume could turn up to a selected level gradually (this could be selected even if volume control is disabled) 5. Option to hide the volume control knob if volume control is disabled. 6. Lyrics support in playback view would be great. I have many song with lyrics embedded as tags. 7. Selectable tag types in Library view to filter, and probably in Playback view to show detailed information. I tagged my flacs with Musicbrainz Picard extensively, using many type of tags (like release date, catalog number). That would be great if moode could show them or use for searhing/filtering. Also my music files have a tag called "grouping" which is the main general genre (like rock, metal) and I use multiple genre tags to list many applicable (sub)genres (for example a song could be tagged with metal, heavy metal, thrash metal genres). I will experiment which format of the multi-tags mpd will accept, but if anybody have a working system for that I'm listening. Currently I listed the multiple genres in a single genre tag separated by a semicolon. Foobar sees them as multiple genre values but mpd seems to treat them as a single huge genre.
 
Tim,

sorry to ask due my poor understanding :

Is there a possible way with basic stuff like a Pi to generate upsampling option on the file from your distro ?

A way to add a FIR filter file to play it on the file (already generated by an other soft or with this last as RePhase freeware for instance) ? (I mean with a Pi device)
 
Hello, new member and new moode user here. English is not my native language. First of all, thank you for this great software. I'm amazed by the value you created. With this toy-like device I have a complete multimedia solution (I use a dual boot system with moode and osmc). I have some feature requests or ideas here since I see the developer is listening. I don't know if any of these are viable though. 1. In library view if an artist is selected but a corresponding album is not, all tracks of that artist could be shown. 2. There could be a song info somewhere, probably in all view, that shows file name, location, format. Some of the info could be inline, others/complete on the actions menu. 3. Reboot to a different partition. I have two OSes installed parallel without any boot manager: moode is in the first partition, osmc is in the second. This way moode loads default, and if I want to load osmc, then I run a shell script via ssh which is basically: echo 2 > /sys/module/bcm2709/parameters/reboot_part and the reboot. It would be a convenient solution to have a similar command in the reboot command popup (probably hidden by default no to confuse other users). I saw that many people sought for a similar solution to have a multi boot environment. Probably it could be implemented in a more general way to let the user choose to run a script via the web interface. 4. As I know there is a directive in EU that electronic devices should implement auto-standby function. My NAD stereo amplifier has a sleep timer too that kicks in if there is no signal for 30 min. Therefore the clock radio cannot be used for wake up (if that was the goal). So there could be a keep-alive solution probably playing a non-audible signal periodically if the clock radio is set and no other sound is played. And for waking up, the volume could turn up to a selected level gradually (this could be selected even if volume control is disabled) 5. Option to hide the volume control knob if volume control is disabled. 6. Lyrics support in playback view would be great. I have many song with lyrics embedded as tags. 7. Selectable tag types in Library view to filter, and probably in Playback view to show detailed information. I tagged my flacs with Musicbrainz Picard extensively, using many type of tags (like release date, catalog number). That would be great if moode could show them or use for searhing/filtering. Also my music files have a tag called "grouping" which is the main general genre (like rock, metal) and I use multiple genre tags to list many applicable (sub)genres (for example a song could be tagged with metal, heavy metal, thrash metal genres). I will experiment which format of the multi-tags mpd will accept, but if anybody have a working system for that I'm listening. Currently I listed the multiple genres in a single genre tag separated by a semicolon. Foobar sees them as multiple genre values but mpd seems to treat them as a single huge genre.

Hi,

Firstly, thanks for taking time to put together this feature request list 🙂

Here are my answers:

1. In library view if an artist is selected but a corresponding album is not, all tracks of that artist could be shown.

This is mostly the way the Library feature originally worked. Same for Genre. You could click a genre and all the artists, albums and tracks tagged with that genre would be listed and could be added to playlist. Problem was that even for moderately sized collections, the performance was very slow generating and then loading the lists and when the track list became very large, the overall performance of Browser was affected.

Maybe I revisit this in Moode 3 project.

2. There could be a song info somewhere, probably in all view, that shows file name, location, format. Some of the info could be inline, others/complete on the actions menu.

The Audio information popup has this information but I realize that it would helpful to have it always displayed. Its already on my TODO list.

3. Reboot to a different partition. I have two OSes installed parallel without any boot manager: moode is in the first partition, osmc is in the second. This way moode loads default, and if I want to load osmc, then I run a shell script via ssh which is basically: echo 2 > /sys/module/bcm2709/parameters/reboot_part and the reboot. It would be a convenient solution to have a similar command in the reboot command popup (probably hidden by default no to confuse other users). I saw that many people sought for a similar solution to have a multi boot environment. Probably it could be implemented in a more general way to let the user choose to run a script via the web interface.

Interesting. It could be feature coded as "Run script at reboot/poweroff" in System config. I'll add to TODO list.

4. As I know there is a directive in EU that electronic devices should implement auto-standby function. My NAD stereo amplifier has a sleep timer too that kicks in if there is no signal for 30 min. Therefore the clock radio cannot be used for wake up (if that was the goal). So there could be a keep-alive solution probably playing a non-audible signal periodically if the clock radio is set and no other sound is played. And for waking up, the volume could turn up to a selected level gradually (this could be selected even if volume control is disabled)

Could just set volume to 0 and play a radio station. The clock radio will set the desired volume when it starts playback. Gradual volume ramping for clock radio is already on my TOD list just have not gotten to it yet.

5. Option to hide the volume control knob if volume control is disabled.

Why would this be preferrable to current implimentation where the knob and volup/dn buttons are grayed out and disabled?

6. Lyrics support in playback view would be great. I have many song with lyrics embedded as tags.

Where and how do you envision the lyrics would be displayed on the UI and would they be displayed on iPhone5 sized small screens?

7. Selectable tag types in Library view to filter, and probably in Playback view to show detailed information. I tagged my flacs with Musicbrainz Picard extensively, using many type of tags (like release date, catalog number). That would be great if moode could show them or use for searhing/filtering.

If the tags are picked by by MPD then its possible to code for them in Moode. Most of the collection management feature requests I've received have been deferred to Moode 3 project because they involve the Library loader and panel which, as part of Moode 3 are going to be rewritten.

Regards,
Tim
 
Tim,

sorry to ask due my poor understanding :

Is there a possible way with basic stuff like a Pi to generate upsampling option on the file from your distro ?

A way to add a FIR filter file to play it on the file (already generated by an other soft or with this last as RePhase freeware for instance) ? (I mean with a Pi device)

Hi,

You can select SoX resampler and your desired bit depth / sample rate from the MPD config screen. This performs on-the fly resampling.

No support yet for FIR filtering although I have it on my TODO list 🙂

Regards,
Tim
 
4. As I know there is a directive in EU that electronic devices should implement auto-standby function. My NAD stereo amplifier has a sleep timer too that kicks in if there is no signal for 30 min. Therefore the clock radio cannot be used for wake up (if that was the goal). So there could be a keep-alive solution probably playing a non-audible signal periodically if the clock radio is set and no other sound is played. And for waking up, the volume could turn up to a selected level gradually (this could be selected even if volume control is disabled)

Could just set volume to 0 and play a radio station. The clock radio will set the desired volume when it starts playback. Gradual volume ramping for clock radio is already on my TOD list just have not gotten to it yet.

5. Option to hide the volume control knob if volume control is disabled.

Why would this be preferrable to current implimentation where the knob and volup/dn buttons are grayed out and disabled?

6. Lyrics support in playback view would be great. I have many song with lyrics embedded as tags.

Where and how do you envision the lyrics would be displayed on the UI and would they be displayed on iPhone5 sized small screens?

Regards,
Tim

Thanks Tim.

4. That's a quick and simple solution I would have think of it myself. I disabled the volume control because my DAC has no hardware volume control but re-enabling before setting clock radio is a viable option. Setting volume to 0% is not enough so probably I will create a special file that plays a non-audible sound at low volume at every x minutes.
By the way, setting volume control to software mode and setting it to 100% is the same as disabling it altogether?

5. Just for space considerations

6. It could be below the playlist or below album art.

Dan
 
Here are my observations regarding multiple genre tags after a quick test.

I used mp3tag under Windows 7 to tag a flac file. Originally I had a single genre tag listing multiple genres separated by a semicolon (ie. "Metal; Melodic Death Metal; Viking Metal; Death Metal"). This worked in foobar2000, it listed as-is, and search found all the genre tags separately (searching for Viking Metal found the file). Unfortunately this does not work in moode (mpd to be precise) which is expected as the format I'm using is not standard. Therefore I converted the separator. For this, I created an action in mp3tag which replaces semicolons to "\" (double blackslash) which is the indicator for mp3tag to separate the values to multiple tags. After running this action mp3tag indeed separated the one big tag to real multiple tags. This still looks good in foobar2000 and mpd accepted it as multiple genre tags in its database (checked with the 'mpc list genre artist "Amon Amarth"' command via ssh, it listed all my genre tags in a separate line). It seems though that the web interface of moode lists only one genre for a song (probably the first one in alphabetical order). Is this the expected behaviour? For my use it would be better to list all the tags separately.
 
Last edited:
Thanks Tim.

4. That's a quick and simple solution I would have think of it myself. I disabled the volume control because my DAC has no hardware volume control but re-enabling before setting clock radio is a viable option. Setting volume to 0% is not enough so probably I will create a special file that plays a non-audible sound at low volume at every x minutes.
By the way, setting volume control to software mode and setting it to 100% is the same as disabling it altogether?

5. Just for space considerations

6. It could be below the playlist or below album art.

Dan

Hi Dan,

The "disabled" setting for MPD volume control will cause MPD to output 100% (0dB) volume. Its only applicable when you are using an external volume control.

If audio device does not have an on-board hardware volume controller, set MPD volume control to "Software".

If audio device has on-board hardware volume controller then there are two options:

(1) MPD volume control = "Software", then set ALSA volume = 100% in System config.
(2) MPD volume control = "Hardware", this couples MPD volume control to the on-board volume controller (ALSA volume).

Regards,
Tim
 
Here are my observations regarding multiple genre tags after a quick test.

I used mp3tag under Windows 7 to tag a flac file. Originally I had a single genre tag listing multiple genres separated by a semicolon (ie. "Metal; Melodic Death Metal; Viking Metal; Death Metal"). This worked in foobar2000, it listed as-is, and search found all the genre tags separately (searching for Viking Metal found the file). Unfortunately this does not work in moode (mpd to be precise) which is expected as the format I'm using is not standard. Therefore I converted the separator. For this, I created an action in mp3tag which replaces semicolons to "" (double blackslash) which is the indicator for mp3tag to separate the values to multiple tags. After running this action mp3tag indeed separated the one big tag to real multiple tags. This still looks good in foobar2000 and mpd accepted it as multiple genre tags in its database (checked with the 'mpc list genre artist "Amon Amarth"' command via ssh, it listed all my genre tags in a separate line). It seems though that the web interface of moode lists only one genre for a song (probably the first one in alphabetical order). Is this the expected behaviour? For my use it would be better to list all the tags separately.

Hi Dan,

Prior to Moode 2.4 as I recall, if an artist belonged to multiple genres it would cause duplicate artist names to be listed in the Artists column, one for each genre the artist belonged to. This was fixed so only a single occurrence of the artist name appeared.

Basically though, the Library is limited by its original design. The loader component of the Library has been rewritten for the Moode 3 project (no time frame) but the panel, controls and actual internal structure of Library array has not been looked at yet.

Regards,
Tim
 
Hi,

You can select SoX resampler and your desired bit depth / sample rate from the MPD config screen. This performs on-the fly resampling.

No support yet for FIR filtering although I have it on my TODO list 🙂

Regards,
Tim

Thanks Tim for your answer,

I don't know if the little devices as Pi2 are enough powerfull to manage a FIR filter (or any correction in the digital domain) in plus of the local mpd, but yes it could be very usefull for Digital room Correction tests and even phase correction of speaker passive filters allowed by freeware like RePhase.

Super for the upsampling setups, with the I2S output selection on the Pi + the little uf-l pcb made by IanCanada for it, I have to test it !(Odroid C1+ has to fly individualy from Korea if you want to test it in France : a no go for me, a pity has it has an individual I2S output very close to the chip).
 
Last edited: