Moode Audio Player for Raspberry Pi

Hi,

Just a few quick iPhone pics of MoodeCase.

The finish is industrial strength, matte black power coat with a zero-fingerprint texture. The rear panels are machined with double-D, no-twist through holes for the DC barrel connectors and Neutrik RCA jacks. A custom speaker terminal block provides easy and secure wire connections. The front panel is shown with a really nice ALPS rotary encoder and vintage Fender Telecaster knurled volume knob :)

Regards,
Tim
MoodeCase... Where? When? Pricing? Options?

Tell us more...

Joe L.
 
Booting RPi3s

Three days ago, I mentioned the new booting capabilities in RPi3s.

Development is still in flux, but as of this morning, thanks to the latest experimental bootcode.bin pushed just 3 hours ago to the 'next' branch of the Raspberry Pi repository on github, I am now able to boot my RPi3B into MoodePlayer from a Lexar Flash Drive with no uSD card in the RPi.

Can't wait for the developments to be merged into Raspbian 'master'.

Regards,
Kent
 
First things first :) so thanks very much Aboe!!

So about why sometimes I expect that the RPI won't be correctly shutdown, is because of the way I am going to use it, and maybe the design :rolleyes::rolleyes:.. So basically as I said in my previous post I am planing to put the RPI+DAC inside the same enclosure I have the GainClone; so the power supply for the RPI come from one free secondary from the trafo (the other two are going to the GainClone) , after basic Graetz bridge + big boy capacitor and a DC-DC Buck converter, so here is the thing if I or someone presses the power button of the Amplifier, so immediately the RPI would be cut too...

So, maybe the solution of putting a push button, in the panel for doing a proper shutdown won't be bad, basically I am planing to use my phone/tablet to control the music to play and so, so maybe there is some android application for the MPD which can send the shutdown... I will have to investigate this too... But the button, I did not think on that before and it's good idea I think :)

You definately need a Pi supply switch:). Either you should get one from the link earlier or you can build one yourself. If you can wait a little while, I'll be posting a dual channel powersupply with a standby and amplifier relay + code, schematics etc. But please never ask for ETA;)
 
Alternative python Amplifier standby script

Hi. After posting an Amplifier Standby Script last week, I got an email from J. Alexander Treuman (Author of python-mpd) who suggested an alternative approach to the script, and since I thought that his suggestion was more elegant than my concoction, I have made a script using his suggestion.

Code:
# Import the libraries to use time delays, send os commands and access GPIO pins
import RPi.GPIO as GPIO 
import time 
import os 
import mpd 

# Setup Variables
RedLedPin = 13 # Set pin number for "Standby" LED
GreenLedPin = 15 # Set pin number for "ON" LED
MainRelayPin = 11 # Set pin number for relay output
counter = 0 # counter for determining the time that has passed since MoOde player has stopped
SleepTime = 60 # The delay between each Status check, set to 60 = 1 minute to save CPU 
StandbyTime = 4 # The amount of time before "Standby" defined in multiples of SleepTime: StandbyTime*SleepTime (60*4 = 240sec = 4 minutes)

# Setup GPIO pins
GPIO.setmode(GPIO.BOARD) # Set pin numbering to board numbering 
GPIO.setup(MainRelayPin, GPIO.OUT) # Setup pin MainRelayPin as an output 
GPIO.setup(RedLedPin, GPIO.OUT) # Setup pin RedLedPin as an output 
GPIO.setup(GreenLedPin, GPIO.OUT) # Setup pin GreenLedPin as an output 

# Amplifier state control procedure
def AmpControl_ON(state):
    if state == True:
        GPIO.output(MainRelayPin, GPIO.HIGH)
        GPIO.output(RedLedPin, GPIO.LOW)
        GPIO.output(GreenLedPin, GPIO.HIGH)
    else:
        GPIO.output(MainRelayPin, GPIO.LOW)
        GPIO.output(RedLedPin, GPIO.HIGH)
        GPIO.output(GreenLedPin, GPIO.LOW)

# Setup MDPClient and connect to MPD on localhost
Client = mpd.MPDClient() # create client object 
Client.timeout = None
Client.idletimeout = None

while True:
    try:
        Client.connect("localhost", 6600) # connect to localhost:6600 
    except:
        continue
    break


# Set GPIO pins to their initial ON state
AmpControl_ON(True)

# main loop
while True:

    amp_on = GPIO.input(MainRelayPin)# Get status from Relay GPIO pin

        if Client.status()['state'] == "play":
            if not amp_on:
                    # Set GPIO pins to initial ON state
            #print "MPD state = play! Entering ON state"
            AmpControl_ON(True)
               #print ("Amp is on = {0}".format(GPIO.input(MainRelayPin))) 

        else: # Either stopped or paused
            if amp_on:
            counter = 0 
            while counter < StandbyTime:
                time.sleep(SleepTime)
                counter = counter + 1
                #print ("Checking MPD status! {0} seconds have passed since last MPD was last playing.".format((counter)*SleepTime))
                if Client.status()['state'] == "play":
                    break
                
            if Client.status()['state'] != "play": # Still stopped/paused after StandbyTime*SleepTime
                #print ("MPD has not been playing for {0} seconds! Entering standby!".format((counter)*SleepTime))
                        # Set GPIO pins to standby state
                AmpControl_ON(False)
                #print ("Amp is on = {0}".format(GPIO.input(MainRelayPin)))

         #print "Waiting for change in MPD state......."
    Client.idle('player')
    #print "Change in MPD-player subsystem detected! continuing"

# Close connection to MPD (not used since the main loop never exits)
#Client.close() # send the close command
#Client.disconnect() # disconnect from the server
I think this script is also more robust, since it always pauses at the idle command, which elliminates timeout errors.

I have had some timeout errors in other parts of the script, and for some reason setting timeout values in the client have no effect. I have solved this by adding connection_timeout "3600" to /etc/mpd.conf
 

Attachments

  • ampcontroller2.zip
    1.3 KB · Views: 68
MoodeCase... Where? When? Pricing? Options?

Tell us more...

Joe L.

Hi Joe,

I'll be selling the enclosure system online from moodeaudio.org after product photography and web site mods are complete, and after I finalize which boards I can optionally offer in the kit.

The enclosure system consists of the main chassis top cover and bottom plate, choice of rear panels with premium connectors for DAC or AMP applications, clear Acrylic front panel with or w/o ALPS rotary encoder and vintage Fender Telecaster knurled volume knob.

The bottom plate has integrated standoffs for Raspberry Pi 2/3 boards and stick-on rubber feet. All enclosure and board mounting screws are included plus a set of hex stainless steel standoffs and screws for attaching a HAT board.

Pricing is not finalized yet but would be based on the particular combination of panels and options in an order. For example MoodeCase with DAC rear panel and plain Acrylic front panel would be less than MoodeCase with AMP rear panel and Acrylic front panel plus rotary encoder and volume knob.

Some nice options in the works include selected DAC and AMP boards with wiring harnesses for power, audio out and rotary encoder, smoked Acrylic front panels and a custom rotary encoder driver that updates Moode volume knob.

Other possible options include custom colors for volume knob and Soma FM vinyl case wraps :)

-Tim
 

Attachments

  • MoodeCase-1-FP.png
    MoodeCase-1-FP.png
    738.8 KB · Views: 500
  • MoodeCase-2-AMP.png
    MoodeCase-2-AMP.png
    741.5 KB · Views: 438
  • MoodeCase-3-DAC.png
    MoodeCase-3-DAC.png
    777.1 KB · Views: 414
  • MoodeCase-4-PNLS.png
    MoodeCase-4-PNLS.png
    801.5 KB · Views: 398
Hi Joe,

The enclosure system consists of the main chassis top cover and bottom plate, choice of rear panels with premium connectors for DAC or AMP applications, clear Acrylic front panel with or w/o ALPS rotary encoder and vintage Fender Telecaster knurled volume knob.
Tim, this looks very tidy! Will the enclosure have enough height for two hat boards, in particular, I'm wondering whether the IQaudio Pi-DAC+ and Pi-AMP+ combination will fit?

Other possible options include custom colors for volume knob and Soma FM vinyl case wraps :)
Good idea!
 
Hi. After posting an Amplifier Standby Script last week, I got an email from J. Alexander Treuman (Author of python-mpd) who suggested an alternative approach to the script, and since I thought that his suggestion was more elegant than my concoction, I have made a script using his suggestion.

Code:
...deleted for brevity...
I think this script is also more robust, since it always pauses at the idle command, which elliminates timeout errors.

I have had some timeout errors in other parts of the script, and for some reason setting timeout values in the client have no effect. I have solved this by adding connection_timeout "3600" to /etc/mpd.conf

Hi, Max (not Klaus!)

This forum software is just plain bizarre. Once again, presentation of your code block is corrupted...look at the client.idle() line. What's even more bizarre, if I quote your entire message in my reply, the presentation of the quoted code block is correct, which means the underlying code in the block is correct!

Regarding the code itself, did Treuman offer any idea why the client.idle method behaves the way it does in your original code? Inquiring minds want to know ;)

Nicely formed Python code, by the way.

Regards,
Kent
 
Hi, Max (not Klaus!)

This forum software is just plain bizarre. Once again, presentation of your code block is corrupted...look at the client.idle() line. What's even more bizarre, if I quote your entire message in my reply, the presentation of the quoted code block is correct, which means the underlying code in the block is correct!

Regarding the code itself, did Treuman offer any idea why the client.idle method behaves the way it does in your original code? Inquiring minds want to know ;)

Nicely formed Python code, by the way.

Regards,
Kent

Hi Kent

Seriously weird about the code corruption. Again just copy paste, but at least the attachment is working. It almost seems like it is the idle. statement that the forum software doesn't like, since it specifically corrupts that both times.

Treuman didn't offer an explanation on why the idle statement might return immediately, but something tells me that something might be happening and that the idle statement is working correctly. If you run the second script and uncomment all the print lines, then you can see every time an idle statement receives a return. While it seems that you get a return every time you change song or station or play/pause, you can sometimes observe what seems like a "phantom" return, that is not initiated by anything user UI related, so I think more is going on, than we expect.

I think Treumas suggestion, is very nicely formed also, but there still is a little tick, when the counter counts up, when sometimes it looses the connection and I get: mpd.connectionerror: Connection lost while reading line. Despite the fact, that I set the client timeouts to "none". I think I've solved it by adding connection_timeout "3600" to /etc/mpd.conf and increase max_output_buffer_size <size in KiB> by a factor 10.

Both seem unnecessary, but I seem to get rid of the exceptions that way. When searching for the exception, I get both connection timeout and malformed idle return results as a cause, which is the reason for the two changes in mpd.conf
 
First things first :) so thanks very much Aboe!!

So about why sometimes I expect that the RPI won't be correctly shutdown, is because of the way I am going to use it, and maybe the design :rolleyes::rolleyes:.. So basically as I said in my previous post I am planing to put the RPI+DAC inside the same enclosure I have the GainClone; so the power supply for the RPI come from one free secondary from the trafo (the other two are going to the GainClone) , after basic Graetz bridge + big boy capacitor and a DC-DC Buck converter, so here is the thing if I or someone presses the power button of the Amplifier, so immediately the RPI would be cut too...

So, maybe the solution of putting a push button, in the panel for doing a proper shutdown won't be bad, basically I am planing to use my phone/tablet to control the music to play and so, so maybe there is some android application for the MPD which can send the shutdown... I will have to investigate this too... But the button, I did not think on that before and it's good idea I think :)

Have you seen this circuit for safe shutdown, it looks very simple ;-)
Raspi EDLC UPS ? Hackerspace Ffm
 
Hi all. I've seen a few posts on experiences with DACs so thought I'd add a few comments, and post a link to a new one I've just ordered.. I've been using I2S and have no experience of USB Dacs, but the Chinese clone versions using the PCM5122 (both with and without the digital amp as per Suptronics X400), and the ESS9023 (HAT version and wires to solder yourself version) both work and sound very good with Moode. If anything (and to my ears) the 9023 might be a little more "natural and real" sounding on female vocals, and the 5122 a bit "brighter and etched sounding" - but I've not finished playing with the 5122 filter options that Tim has enabled for us - thanks Tim!
The new one I've ordered is a low cost version based on the ES9018K2M (as per this ebay link ES9018K2M ES9018 I2S input DAC decoder board Support IIS-32bit 384K / DSD64 | eBay). For 10 UK pounds it seems to be worth trying. I'll update when it arrives - and if I can get it working.....
 
Last edited:
Hi there,

I'm having some problem using my USB stick with music on it, to show up in moOde. It worked in 2.5, but not in 2.6 anymore.

It seems that it is being detected by the system:

Code:
[69125.649624] usb 1-1.2: new high-speed USB device number 12 using dwc_otg
[69125.755258] usb 1-1.2: New USB device found, idVendor=8564, idProduct=1000
[69125.755288] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[69125.755305] usb 1-1.2: Product: Mass Storage Device
[69125.755321] usb 1-1.2: Manufacturer: JetFlash
[69125.755337] usb 1-1.2: SerialNumber: 6576WR7CMA4ACCPW
[69125.757346] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[69125.758113] scsi host6: usb-storage 1-1.2:1.0
[69127.142924] scsi 6:0:0:0: Direct-Access     JetFlash Transcend 32GB   1100 PQ: 0 ANSI: 6
[69127.145078] sd 6:0:0:0: [sda] 61702144 512-byte logical blocks: (31.6 GB/29.4 GiB)
[69127.145374] sd 6:0:0:0: Attached scsi generic sg0 type 0
[69127.145850] sd 6:0:0:0: [sda] Write Protect is off
[69127.145880] sd 6:0:0:0: [sda] Mode Sense: 43 00 00 00
[69127.146628] sd 6:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[69127.153613]  sda: sda1
[69127.159215] sd 6:0:0:0: [sda] Attached SCSI removable disk
Also fdisk shows it:
Code:
Disk /dev/sda: 29.4 GiB, 31591497728 bytes, 61702144 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc3072e18

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1          96 61702143 61702048 29.4G 83 Linux
But it looks like it is not being mounted. I've tried the 'update mpd db' button in the GUI, but the stick doesn't show. Another USB HDD does work tho, so it's something specific going wrong for the stick? What could be the problem here?
 
hi Tim, I was wondering if the Digi+ is going to be an option for the incoming moode device, since I already have external amp & dac.

Hi,

I'd love to support S/PDIF boards but I'm not able to find a panel mount TOSLink jack that is small enough. Ideally it would fit the same double-D through-hole thats used for the RCA jacks otherwise a new rear panel would need to be designed and fabricated.

-Tim
 
Tim, this looks very tidy! Will the enclosure have enough height for two hat boards, in particular, I'm wondering whether the IQaudio Pi-DAC+ and Pi-AMP+ combination will fit?


Good idea!

Hi,

Only room for single HAT board. Here are some quick pics of an IQaudIO Pi-DigiAMP+ wired into MoodeCase. The 7/8" (21mm) space above the HAT allows the wiring harnesses to float unrestricted.

Regards,
Tim
 

Attachments

  • MoodeCase-5-DigiAMP.png
    MoodeCase-5-DigiAMP.png
    798.4 KB · Views: 343
  • MoodeCase-6-DigiAMP.png
    MoodeCase-6-DigiAMP.png
    794.7 KB · Views: 313
  • MoodeCase-7-DigiAMP.png
    MoodeCase-7-DigiAMP.png
    734.8 KB · Views: 308
Three days ago, I mentioned the new booting capabilities in RPi3s.

Development is still in flux, but as of this morning, thanks to the latest experimental bootcode.bin pushed just 3 hours ago to the 'next' branch of the Raspberry Pi repository on github, I am now able to boot my RPi3B into MoodePlayer from a Lexar Flash Drive with no uSD card in the RPi.

Can't wait for the developments to be merged into Raspbian 'master'.

Regards,
Kent

I look forward to this. SD is so fragile, it's time Pi found a better way.
 
Hi all. I've seen a few posts on experiences with DACs so thought I'd add a few comments, and post a link to a new one I've just ordered.. I've been using I2S and have no experience of USB Dacs, but the Chinese clone versions using the PCM5122 (both with and without the digital amp as per Suptronics X400), and the ESS9023 (HAT version and wires to solder yourself version) both work and sound very good with Moode. If anything (and to my ears) the 9023 might be a little more "natural and real" sounding on female vocals, and the 5122 a bit "brighter and etched sounding" - but I've not finished playing with the 5122 filter options that Tim has enabled for us - thanks Tim!
The new one I've ordered is a low cost version based on the ES9018K2M (as per this ebay link ES9018K2M ES9018 I2S input DAC decoder board Support IIS-32bit 384K / DSD64 | eBay). For 10 UK pounds it seems to be worth trying. I'll update when it arrives - and if I can get it working.....

I'm very interested in whether it has hardware volume control. I need to build about 80 units with amps and DACs and given the cost of the other HATs, if it has hardware volume, it could be my go-to.

I don't need 'audiophile' quality, it's for an art installation with spoken word, transducers, etc.

For my hifi stuff I will stick with IQAudio, they're the bomb!
 
Hi,

I'd love to support S/PDIF boards but I'm not able to find a panel mount TOSLink jack that is small enough. Ideally it would fit the same double-D through-hole thats used for the RCA jacks otherwise a new rear panel would need to be designed and fabricated.

-Tim

Something like this?

toslink audio fiber keystone jack-in Electrical Plugs & Sockets from Home Improvement on Aliexpress.com | Alibaba Group

Or this? http://www.ebay.com/itm/Optical-TOS...Socket-to-socket-Adapter-005745-/261369306593

Or this? http://media.digikey.com/pdf/Data Sheets/Paladin PDFs/T10TB.pdf
 
Last edited:
Hi,

I'd love to support S/PDIF boards but I'm not able to find a panel mount TOSLink jack that is small enough. Ideally it would fit the same double-D through-hole thats used for the RCA jacks otherwise a new rear panel would need to be designed and fabricated.

-Tim

I'm using the HiFiBerry Digi+ board in one of HiFiBerry's own cases. Their original plastic case is functional, but a bit naff, so I recently bought one of their new black metal cases:

https://www.hifiberry.com/product/steel-case-for-hifiberry-digi-black/

Elegant and solid.