Moode Audio Player for Raspberry Pi

@Tim

Re.: LibreSpot

I tried all three Kernels, with or without up-sampling but couldn't get Librespot to connect (see attachment, it says "connecting" then reverts back to its initial state). Not a big deal for me, .. just wanted to report my findings.

All the best

Configuration: Pi3, MoodeAudio 3.6, Piano2.1, Kali
Computers: Mac, iphone


@r100

I had a similar thing. Even though it said 'Connecting' I tried returning to the menu and clicking 'MoodeLibre' again. Eventually it connects (Android tablet).
(I don't think this is an issue for Tim btw, since he has not yet integrated Spotify into Moode because of the volume problem.)

I have a working librespot, I encounter this issue when my network connection is bad. All I do is reset my network connection (wifi access point), and reset Pi. Also make sure you are not actively playing music in Moode. Here's how I use librespot:

1.) Pause Moode (stop playing)
2.) Pause spotify
3.) Connect Spotify to librespot
4.) When connected, adjust volume in spotify if necessary
5.) Start playing in spotify

Steps 2 and 4 are just my precautions so that I wont damage my speakers/headphones 😀 While happily playing, you can adjust the volume in moode for fine adjustment since Spotify only has 10 volume levels.
 
Last edited:
...

I am trying to port Moode to a bootable USB SSD. I've got it to work on Jessie reliably, but haven't been able to replicate using MoodeOS, yet. When my large list of tasks is less large, I will give booting off flash and ssd a good go.

Interesting. I followed closely when the Foundation started rolling out new booting modes as experimental features. My goal was to netboot an RPi from the same NFS/TFTP/DHCP server I was using to boot Beaglebones and other ARM boards on my bench. With appropriate fiddles, the various modes worked for me with stock Raspbian as it is for you. I can't remember if I tried booting MoOde Player or not because that wasn't the project I was dealing with. The project ended and I moved boot modes to the back burner (funny how real life can disrupt digital life).

I see that the current documentation (https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md) is greatly simplified because 2017-04-10-raspbian-jessie has the alternative boot modes baked in. As I understand it, MoOde Player is based on an earlier earlier release so I assume you are working with earlier, more detailed documentation (for example, https://github.com/raspberrypi/docu...246645/hardware/raspberrypi/bootmodes/msd.md).

With the capacities and prices of flash and SSD ever falling, I may have to give this another try for a self-contained, portable player but I'd be just as happy to slipstream behind you (echoing Alphonse and Gaston)!

Regards,
Kent
 
I test using a Mac utility I downloaded from the Flash association - there's a similar app for Windows: H2Testw and the other apps should help diagnose https://www.raymond.cc/blog/test-an...b-flash-drives-bought-from-ebay-with-h2testw/

'Tricks' such as freezing your SD can result in being able to access a faulty disk, but it's just as much to do with luck as science.

For looking at files on your Pi, a couple of other executables, other than nano, are useful:

'cat filename' lists the contents of a file. Pipe 'more' to get it to pause at each screenful: 'cat filename |more'
or pipe grep to look for a specific string: 'cat filename|grep searchtext (pipe char is a solid-looking vertical bar on your keyboard)

'tail filename' keeps a 'live' screen display of the last screenful (20 lines?) of data in a file - fantastic for watching a log file for an event, for example.

As to whether or not to store music files on an SD, I haven't investigated it enough to have an opinion, but I don't store anything on my card and have had few problems that couldn't be attributed to cheap card or useless power supply 🙂.

I am trying to port Moode to a bootable USB SSD. I've got it to work on Jessie reliably, but haven't been able to replicate using MoodeOS, yet. When my large list of tasks is less large, I will give booting off flash and ssd a good go.

Thanks very much for these pointers.

I got everything working very well now.

On my install, if there's a corrupted file or a file with a bad header on the storage device, the Update MPD DB command hangs with the Browse panel showing Updating with the spinning arrows, and the update often fails to complete (artists, albums, tracks don't appear in Moode).

Another problem I found is that if a folder name contains the characters "[" or "]" the album cover JPEG won't display. Changing "[ ]" to "( )" fixes that.

After fixing those two problems, it now takes only a couple seconds for an Update MPD DB command to complete, and the Browse panel only displays Updating for a little bit, then returns to displaying Browse, as it should.

Everything has been working well for several hours now. I added some artists and albums late last night, they were all recognized, and are all playing today with no issues. Therefore, I think the problems I was having were due to MPD crashing while trying to read mangled FLAC files.

I'll run those command strings you suggested and see what comes out. I'll also test the sdcard using something like H2Testw and see if problems show up.

Thanks again for the help. Much appreciated!

Oh, and thanks Tim for creating Moode. Now that I have it running again, I find it to be excellent, sounds great, has the features I need, and is enjoyable to use. Hopefully I'll get less scared of Linux along the way...
--
 
I've managed to implement a relay switch using mqtt with RPi.Gpio and paho mqtt but it only works intermittently and causes moode to crash most of the time. I was hoping that someone with more linux experience than me could offer an explanation of what is wrong. I'm running moode and script on Model B Revision 2.0 (512MB) pi. Could my pi be too slow for this? Have copied the python code below:

import paho.mqtt.client as paho
import RPi.GPIO as GPIO
mqttc = paho.Client()

relayPin = 22

GPIO.setmode(GPIO.BOARD) # use P1 header pin numbering convention
GPIO.cleanup() # clean up resources
GPIO.setup(relayPin, GPIO.OUT) # led pin setup

# Settings for connection
host = "192.168.0.16"
topic= "switch1"
port = 1883

# Callbacks
def on_connect(mosq, obj, rc):
print("connect rc: "+str(rc))
mqttc.publish("mbed-sample","Python Script Test Message.");

def on_message(mosq, obj, msg):
print( "Received on topic: " + msg.topic + " Message: "+str(msg.payload) + "\n");
received_message = str(msg.payload)
if "0" in received_message:#the published value is ON
print "Device Off"
GPI😵utput(relayPin, GPIO.HIGH)
elif "1" in received_message:#the published value is OFF
print "Device On"
GPI😵utput(relayPin, GPIO.LOW)

def on_subscribe(mosq, obj, mid, granted_qos):
print("Subscribed OK")

# Set callbacks
mqttc.on_message = on_message
mqttc.on_connect = on_connect
mqttc.on_subscribe = on_subscribe

# Connect and subscribe
print("Connecting to " +host +"/" +topic)
mqttc.connect(host, port, 60)
mqttc.subscribe(topic, 0)

# Wait forever, receiving messages
rc = 0
while rc == 0:
rc = mqttc.loop()

print("rc: "+str(rc))
 
@r100

I had a similar thing. Even though it said 'Connecting' I tried returning to the menu and clicking 'MoodeLibre' again. Eventually it connects (Android tablet).
(I don't think this is an issue for Tim btw, since he has not yet integrated Spotify into Moode because of the volume problem.)

@Tim

Re.: LibreSpot

I tried all three Kernels, with or without up-sampling but couldn't get Librespot to connect (see attachment, it says "connecting" then reverts back to its initial state). Not a big deal for me, .. just wanted to report my findings.

All the best

Configuration: Pi3, MoodeAudio 3.6, Piano2.1, Kali
Computers: Mac, iphone
Over at the ROON forum there are 2 possible workarrounds for this.
  1. disable IPv6
  2. read a bit in the ROON forum from here: https://community.roonlabs.com/t/sp...-roonbridged-pi-the-quick-n-easy-way/17896/39
All I can say is that it is working for me. Even the alternative service described here, works.

(I'm using the Advanced-LL kernel in Moode 3.6 in combination with the IQaudio DAC PRO).
 
Hi,

If I get a bunch of reports that these settings are doing good things then I can investigate, but even then there is a limit to how many tweek features I can include because each one creates potential unintended side-effects and a support vector for me.

You can always just add your own script to rc.local.

-Tim

Hi Tim,

I truly understand this is not a priority feature request for you, I appreciate your work very much, like I do your caption
Enjoy the Music!
as I try to get the most out of the software which will benefit the quality of the sound.

Hopefully more sound tweaking will be integrated (when more people ask you to develop) in the nearby future.

:cheers:
 
OK, I think I've proven this...

I had several folders with "[" and "]" in their names. For instance:

/Miles Davis and John Coltrane [Remaster]/
/Mahler Symphony No. 2 [Tennstedt, LPO Live]/
/Live at the Regal [MFSL Ultradisc I]/
/Song for My Father [RVG RM 1999]/

All of these folders contained proper FLAC files with a proper JPEG file for the cover art.

If I leave the open/close brackets in the folder name, the cover art will not display in Moode 3.1.

If I change the folder name to use open/close parentheses instead of brackets, the cover art displays as expected.

The funny thing is that it doesn't matter if the open/close brackets are left unchanged in the ID3 tags. The only place where brackets in the name will cause problems is in the album folder name.

This would be easy to test. Does this happen on anyone else's Moode 3.1 installation? How about in Moode 3.6?
--

I just copied over a Music folder to a USB thumb drive from my server, hand-edited several album-folder and FLAC file names to introduce square brackets. Plugged the drive into a virgin Moode 3.6 install on an RPi3B and updated the DB. All the folders and files show up in the Library panel as does the album art.

On the other hand, the bracketed part of the names shows only when I drill down in the Browse panel and not in the Library panel.

example-

Browse shows: ../Music/NewAge/[1980]Enigma/MCMXD.ad [a-d]/...

but Library ALBUMS panel shows: MCMXD.ad

while an individual file in that album I renamed "04 Enigma - Mea Culpa[a].flac" shows as "Mea Culpa" in the Browse panel and "4-Mea Culpa" in the Library TRACKS panel.

Obviously, your mileage varies.

There are several websites which discuss aspects of diagnosing mpd issues. One topic I've seen mentioned is characterset encodings in directory/file names and the need to make sure the encodings are consistent in mpd and referenced filesystems. I don't have any insight here.

Regards,
Kent
 
Last edited:
I just copied over a Music folder to a USB thumb drive from my server, hand-edited several album-folder and FLAC file names to introduce square brackets. Plugged the drive into a virgin Moode 3.6 install on an RPi3B and updated the DB. All the folders and files show up in the Library panel as does the album art.

On the other hand, the bracketed part of the names shows only when I drill down in the Browse panel and not in the Library panel.

example-

Browse shows: ../Music/NewAge/[1980]Enigma/MCMXD.ad [a-d]/...

but Library ALBUMS panel shows: MCMXD.ad

while an individual file in that album I renamed "04 Enigma - Mea Culpa[a].flac" shows as "Mea Culpa" in the Browse panel and "4-Mea Culpa" in the Library TRACKS panel.

Obviously, your mileage varies.

There are several websites which discuss aspects of diagnosing mpd issues. One topic I've seen mentioned is characterset encodings in directory/file names and the need to make sure the encodings are consistent in mpd and referenced filesystems. I don't have any insight here.

Regards,
Kent

Hey Kent, very interesting.

In my setup, where MoodeOS and the music files are all stored on a single 128GB microSDXC card, bracketed text displays normally and fully if the brackets are in a filename or in the track's tags. But if there is bracketed text in a folder name (only), then the album art will not display in the Library panel. But all the text displays, in all cases.

I was reading some stuff about MPD problems and saw references to making sure charsets match up. Unfortunately, my lack of expertise makes it so I can't check those things.

I'm thinking that the charset assigned to the sdcard filesystem might be different from the charset assigned to external storage devices (USB sticks, hard drives, NAS, etc.).

I guess the lesson learned is that with tracks to be played by Moode, change any [bracketed text] to (text in parentheses) and all should be good.

I wonder, if you were to add a couple of messed-up FLAC files along with a few good ones, and ran Update MPD DB, would your setup refuse to update completely like mine does? Or would it update fine (and just skip the bad files) because your music files are on an external drive, not on your boot media?
--
 
Last edited:
Hey Kent, very interesting.

In my setup, where MoodeOS and the music files are all stored on a single 128GB microSDXC card, bracketed text displays normally and fully if the brackets are in a filename or in the track's tags. But if there is bracketed text in a folder name (only), then the album art will not display in the Library panel. But all the text displays, in all cases.

I was reading some stuff about MPD problems and saw references to making sure charsets match up. Unfortunately, my lack of expertise makes it so I can't check those things.

I'm thinking that the charset assigned to the sdcard filesystem might be different from the charset assigned to external storage devices (USB sticks, hard drives, NAS, etc.).

I guess the lesson learned is that with tracks to be played by Moode, change any [bracketed text] to (text in parentheses) and all should be good.

I wonder, if you were to add a couple of messed-up FLAC files along with a few good ones, and ran Update MPD DB, would your setup refuse to update completely like mine does? Or would it update fine (and just skip the bad files) because your music files are on an external drive, not on your boot media?
--

I don't think the distinction between the sdcard filesystem and an outboard USB-stick filesystem matters here (nor that the music files are FLAC encoded rather than, say, MP3). Frankly, although I mentioned the charset issue as a matter of due diligence, I find it difficult to believe you have a conflict since you have everything in a single linux filesystem.

Corrupt files are a common problem with mpd. If you search through this or other forums, you'll see this issue comes up again and again. Seems like we music-heads need a utility outside of mpd which pre-checks music folders and files, similar to the programmers' "lint" programs used to check code before submitting it to a compiler.

Meanwhile, enjoy the music!

Regards,
Kent

PS - It's not surprising that the ID3 tags are treated differently since they are handled by different sections of the code.

PPS - it turns out my USB stick is formatted as a FAT32 filesystem so, yes, there is the possibility of charset issues.
 
Last edited:
Corrupt files are a common problem with mpd. If you search through this or other forums, you'll see this issue comes up again and again...

PPS - it turns out my USB stick is formatted as a FAT32 filesystem so, yes, there is the possibility of charset issues.

Re: corrupt files -- I didn't know some of the files were corrupted until Tim and Zootalaws helped me get a look into the log files (I'm a complete newbie on Linux). Funny that files that MPD rejects as corrupted display and play fine in Windows. Oh well. I'm finding that MPD likes CD tracks ripped by foobar2000 better than tracks ripped by Exact Audio Copy.

Re: charsets -- I was reading that microSDXC cards have a slightly different filesystem than microSDHC cards (like the 16GB one I was using before). microSDXC uses eFAT, while microSDHC uses FAT32. I wonder if that could be why things that were working on the old card no longer work on the new card?
--
https://kb.sandisk.com/app/answers/detail/a_id/2520/~/sd/sdhc/sdxc-specifications-and-compatibility
 
Last edited:
Re: corrupt files -- I didn't know some of the files were corrupted until Tim and Zootalaws helped me get a look into the log files (I'm a complete newbie on Linux). Funny that files that MPD rejects as corrupted display and play fine in Windows. Oh well. I'm finding that MPD likes CD tracks ripped by foobar2000 better than tracks ripped by Exact Audio Copy.

Re: charsets -- I was reading that microSDXC cards have a slightly different filesystem than microSDHC cards (like the 16GB one I was using before). microSDXC uses eFAT, while microSDHC uses FAT32. I wonder if that could be why things that were working on the old card no longer work on the new card?
--

I haven't had the problem (knock on wood) so I haven't delved into any of the reasons mpd, in particular, might think a file is corrupt.

Yes, the sdcards come from the factory with a single partition containing a default, Windows-friendly filesystem, but if you ssh to your player and run

pi@moode: $ ssh fdisk -l

you'll find it's been overwritten in the install process with two partitions, the first, smaller one formatted FAT32 (a Windows filesystem type, required by the bootcode in the RPi firmware) and the second, big one formatted as a Linux filesystem.

I had a brain fart earlier when I mentioned the track "Mea Culpa" showed up without any square brackets. I forgot MoOde Player pulls the track name from the metadata in the file and not from the filename itself, and I hadn't edited the metadata in this test.

I also got in one more quick test. Running from the command line, I copied over the "[1980] Enigma" folder from the USB stick to my sdcard (e.g., as /mnt/SDCARD/Music/NewAge/[1980] Enigma)and discovered neither it nor its contents show up in either the Browse or Library panels. Turns out that the copy operation created directories and files with very restrictive permissions attached. Once I added back "group" and "other" permissions for read and execute (mimicking the permissions on Tim's Stereo Test directory and file), everything showed up as I described before.

Isn't this fun?

Now I really need to run errands before another storm front moves in on us.

Regards,
Kent
 
Hi Tim,

Or anyone else who may be able to help me....

Can you think of any reason why the Paho Mqtt python package might disrupt the standard moode installation on a 512mb Pi Model B?

Have tried many methods. Moode works fine (thank you) as standard.

It then ceases up even before I have run my Python script but AFTER I install the Paho Mqtt package. I have tried installing using PIP, then I tried a different installation that only required 'setup tools' for python.

Anyone else had trouble using third party packages with Moode?

regards

STuart
 
Wrt apt upgrade/update/dist-upgrade, I should mention that moodeOS + Moode Audio Player are an integrated system with a specific OS and application configuration including specific versions of all the component pieces, all designed to work well together.

moodeOS is based on the 2016-03-18 Raspbian Jessie-Lite release and generally, apt-get update/upgrade will work fine. I've done it myself on Moode 3.5 just to see if there would be any issues.

I haven't performed a dist-upgrade because in practice, moving moodeOS to a newer release of Raspbian requires starting with the new release and then building moodeOS up from that using a build recipe. Then integration test everything!

A dist-upgrade will probably cause breakage.

-Tim

Hi Tim,

Just an FYI:

On Moode 3.6, apt-get update fails to upgrade nginx, complaining about a read-only filesystem.

Everything else updates ok without breaking Moode.

Cheers,

Phil
 
Hi Tim,

Or anyone else who may be able to help me....

Can you think of any reason why the Paho Mqtt python package might disrupt the standard moode installation on a 512mb Pi Model B?

Have tried many methods. Moode works fine (thank you) as standard.

It then ceases up even before I have run my Python script but AFTER I install the Paho Mqtt package. I have tried installing using PIP, then I tried a different installation that only required 'setup tools' for python.

Anyone else had trouble using third party packages with Moode?

regards

STuart

Hi Stuart,

What is Paho Mqtt? moodeOS already has Python.

pi@rp3:~ $ python -V
Python 2.7.9
pi@rp3:~ $

After installing, are there any suspicious messages in syslog?

-Tim
 
Hi Tim,

Just an FYI:

On Moode 3.6, apt-get update fails to upgrade nginx, complaining about a read-only filesystem.

Everything else updates ok without breaking Moode.

Cheers,

Phil

Hi Phil,

I think NGINX installer might try to write to /var/www which is actually a mounted squashfs in Moode release >= 3.5. If u want the unsquash/resquash procedure just send me an email. The risk is that if u forget to resquash and then at a later time install a Moode in-place update, your system will probably be bricked.

-Tim