Moode Audio Player for Raspberry Pi

Hi Tim,

addtional information is found.
Playing source file is same mp3(14/44.1).

SoX Resampling setting
:disable Good(normal)
:32/384 NoGood(fast)
:32/354.2 NG
:16/44.1 Good
:16.* Good
:32.* Good
:24.* Good
:24.384 NG
:24.174.4 Good

Hi

I found some additional info of this from someone's blog.

if playlist isn't empty before rebooting of Pi, this happens.

MPD restart is the solution of fix this, if SoX Resampling isn't disabled.
 
Hi Tim,

addtional information is found.
Playing source file is same mp3(14/44.1).

SoX Resampling setting
:disable Good(normal)
:32/384 NoGood(fast)
:32/354.2 NG
:16/44.1 Good
:16.* Good
:32.* Good
:24.* Good
:24.384 NG
:24.174.4 Good

Hi

I found some additional info of this from someone's blog.

if playlist isn't empty before rebooting of Pi, this happens.

MPD restart is the solution of fix this, if SoX Resampling isn't disabled.

Hi,

Quick test with the sample files provided by @takoyaki on two of my systems: a PiZero W + IQaudIO DACZero and a Pi-3B + Kali + Piano 2.1 Dual-Mono and no issues at any sample rate after reboot.

This suggests that the files are OK.

-Tim
 
Hi, Remy.

You need additional subprocess calls. Something like:
Code:
...
      elif volup_switch == False:
         subprocess.call(['mpc', 'volume', '+2' ])
         subprocess.call(['/var/www/vol.sh','up','2'])
         print "volumeup"
      elif voldown_switch == False:
         subprocess.call(['mpc', 'volume', '-2' ])
         subprocess.call(['/var/www/vol.sh','dn','2'])
         print "volumedown"
...



I don't have the hardware to replicate your environment, but running the new subprocess calls in a Python script bumps my volume dial up and down.

Regards,
Kent

It worked. I spent more than 3 hours this saturday trying to figure this out. No way i could have found it myself. Thanks Kent.
I have about 15 hardware buttons on my moode player. I want to assign some of them to my favorite radio stations. Here is a series of commands i use to get to one of my favorite radio station (the jazz groove):

Code:
pi@moode:~ $ mpc stop
volume: 26%   repeat: off   random: off   single: off   consume: off
pi@moode:~ $ mpc clear
volume: 26%   repeat: off   random: off   single: off   consume: off
pi@moode:~ $ mpc load "Default Playlist"
loading: Default Playlist
pi@moode:~ $ mpc play 5
[url]http://aac-64.streamthejazzgroove.com:80/stream[/url]
[playing] #5/53   0:00/0:00 (0%)
volume: 26%   repeat: off   random: off   single: off   consume: off

By combining: mpc stop; mpc clear; mpc load "Default Playlist"; mpc play 5; i should be able to select my favorite radio station? or is it better to just write the http of the stream directly in the script? how do i do that and how do i integrate it in my hardware buttons script?

Remy
 

Attachments

  • mooderemy.jpg
    mooderemy.jpg
    88.9 KB · Views: 363
Moode and DDDAC 1794 connected by I2S

Yesterday I did make an I2S connection between a raspberry 3 hifiberry Digi+ pro combination running Moode 3.8.2 to my DDDAC 1794 blue motherboard with one deck.

It did play at the first run but with much "random" noise.

The random noise was gone as soon as I removed the USB power supply from the raspberry and used the 5 Volt supplied by the DDDAC to power the Digi+ pro (and by that supplying power to the raspberry pi)

I now have a very nice system to listen to my favorite music.

Thank you Tim for giving us Moode, and a really big compliment on how you supporting the people using your creation, outstanding!!!
 
It worked. I spent more than 3 hours this saturday trying to figure this out. No way i could have found it myself. Thanks Kent.
I have about 15 hardware buttons on my moode player. I want to assign some of them to my favorite radio stations. Here is a series of commands i use to get to one of my favorite radio station (the jazz groove):

Code:
pi@moode:~ $ mpc stop
volume: 26%   repeat: off   random: off   single: off   consume: off
pi@moode:~ $ mpc clear
volume: 26%   repeat: off   random: off   single: off   consume: off
pi@moode:~ $ mpc load "Default Playlist"
loading: Default Playlist
pi@moode:~ $ mpc play 5
[url]http://aac-64.streamthejazzgroove.com:80/stream[/url]
[playing] #5/53   0:00/0:00 (0%)
volume: 26%   repeat: off   random: off   single: off   consume: off

By combining: mpc stop; mpc clear; mpc load "Default Playlist"; mpc play 5; i should be able to select my favorite radio station? or is it better to just write the http of the stream directly in the script? how do i do that and how do i integrate it in my hardware buttons script?

Remy

Hi, Remy.

First, let me apologize for my half answer. As Tim immediately pointed out, I overlooked the obvious. At least I got the syntax right.

Second, let me take a moment to admire your project. I love seeing vintage HiFi gear being re-purposed.

Third, to your question, I have only a superficial understanding of mpd/mpc but it looks like you are on the right track attacking your problem by creating a multi-entry playlist consisting of all your favorite radio stations. [ed: deleted my restatement of what you've already done.]

I'm not in range of my moOde Player at the moment, but I can write and test a Python segment to implement this play selection later today if you want.

Regards,
Kent
 
Last edited:
Hi, Remy.

First, let me apologize for my half answer. As Tim immediately pointed out, I overlooked the obvious. At least I got the syntax right.

Second, let me take a moment to admire your project. I love seeing vintage HiFi gear being re-purposed.

Third, to your question, I have only a superficial understanding of mpd/mpc but it looks like you are on the right track attacking your problem by creating a multi-entry playlist consisting of all your favorite radio stations. [ed: deleted my restatement of what you've already done.]

I'm not in range of my moOde Player at the moment, but I can write and test a Python segment to implement this play selection later today if you want.

Regards,
Kent

Hi Kent,

I am patiently waiting... you already helped put my project on the right track twice. Sort of i am now addicted to your help.

Remy
 
16x2 lcd help

Anyone have a working config and setup steps for a 16x2 lcd display for moode 3.8.3 ?

I'm re-purposing a VFD "Type: Samsung 2x16 Characters VFD, Parallel Cable" display that came with an htpc case.
I've run the case through the bandsaw :)D) to make it more suited for a Pi, Dac, and supplies. Would really like to get the display working for it.

Vesalia Online - Ahanix MCE601 HTPC Case
 
Last edited:
Anyone have a working config and setup steps for a 16x2 lcd display for moode 3.8.3 ?

I'm re-purposing a VFD "Type: Samsung 2x16 Characters VFD, Parallel Cable" display that came with an htpc case.
I've run the case through the bandsaw :)D) to make it more suited for a Pi, Dac, and supplies. Would really like to get the display working for it.

Vesalia Online - Ahanix MCE601 HTPC Case

Unless you can source an i2c to parallel converter, you're probably S.O.O.L.

Cheaper and easier to source a compatible display.

Of course you may be able to bypass the parallel interface and talk directly to the display, but you will need the display data sheet.

This may help: I/O Ports Uncensored Part 2 - Controlling LCDs (Liquid Crystal Displays) and VFDs (Vacuum Fluorescent Displays) with Parallel Port - CodeProject
 
Last edited:
Anyone have a working config and setup steps for a 16x2 lcd display for moode 3.8.3 ?

I'm re-purposing a VFD "Type: Samsung 2x16 Characters VFD, Parallel Cable" display that came with an htpc case.
I've run the case through the bandsaw :)D) to make it more suited for a Pi, Dac, and supplies. Would really like to get the display working for it.

Vesalia Online - Ahanix MCE601 HTPC Case

1. replace new hd44780.so (compile from lcdproc 0.5.9).
2. or remove old lcdproc and install lcdproc 0.5.9.

Guide for hd44780 lcd:
GitHub - fengalin/raspdac-on-osmc: Audiophonics' RaspDAC installation on OSMC

ssh in to rpi.

cd /
sudo mkdir mylcd
cd mylcd
git clone GitHub - lcdproc/lcdproc: Client/server suite for controlling a wide variety of LCD devices
cd lcdproc
sh ./autogen.sh
./configure --enable-drivers=hd44780 --disable-libusb --disable-libusb-1-0 --disable-libftdi --disable-libX11 --disable-libhid --disable-libpng --disable-freetype --disable-ethlcd
make
sudo make install
cd /
sudo rm -rf mylcd

put LCDd.service to /lib/systemd/system/

Example :
raspdac-on-osmc/LCDd.service at master * fengalin/raspdac-on-osmc * GitHub

put LCDd.conf to /usr/local/etc/LCDd.conf
(and change your lcd setting)

Example :
raspdac-on-osmc/LCDd.conf at master * fengalin/raspdac-on-osmc * GitHub

sudo systemctl enable LCDd
sudo systemctl start LCDd

If everthing went fine it should show the beginnig text.
 
Might be a moot point anyway Mike, I can't find the darned thing !

So, if I am to get a suitable display what am I looking for that will work with Moode...? anyone have one working and can recommend ? links to 'how to' ?

@ joe0097 ... Thanks ! if I can find the vfd I will try that out today... otherwise I will await a replacement and try then.
Hmmm.. your links all 404...
 
Last edited:
Found the display, seems it is hd44780 compatible.
14 pins instead of 16 but being vfd it doesn't need a backlight control so 15&16 not used.
Other pins appear to be standard as per the hd44780 and the parallel cable is only plugged. I will remove that and use dupont cables to the Pi.

So off to find the pin configuration to use then back to finding a setup and config. Keep the suggestions coming :)
 
1. replace new hd44780.so (compile from lcdproc 0.5.9).
2. or remove old lcdproc and install lcdproc 0.5.9.

Guide for hd44780 lcd:
GitHub - fengalin/raspdac-on-osmc: Audiophonics' RaspDAC installation on OSMC

ssh in to rpi.

cd /
sudo mkdir mylcd
cd mylcd
git clone GitHub - lcdproc/lcdproc: Client/server suite for controlling a wide variety of LCD devices
cd lcdproc
sh ./autogen.sh
./configure --enable-drivers=hd44780 --disable-libusb --disable-libusb-1-0 --disable-libftdi --disable-libX11 --disable-libhid --disable-libpng --disable-freetype --disable-ethlcd
make
sudo make install
cd /
sudo rm -rf mylcd

put LCDd.service to /lib/systemd/system/

Example :
raspdac-on-osmc/LCDd.service at master * fengalin/raspdac-on-osmc * GitHub

put LCDd.conf to /usr/local/etc/LCDd.conf
(and change your lcd setting)

Example :
raspdac-on-osmc/LCDd.conf at master * fengalin/raspdac-on-osmc * GitHub


sudo systemctl enable LCDd
sudo systemctl start LCDd

If everthing went fine it should show the beginnig text.
 
If an RPi3b, you can do boot directly from USB. If an RPi2b, there is an indirect method which bootstraps from a file on the uSD card to get to the USB drive. The RPi3B method has been discussed previously in this thread. Both it and the RPi2B method are discussed on the RaspberryPi.org site.

Regards,
Kent


Kent, thanks for this information.

I decided to try this with my RPi 2B - I used a 1Gb SD Card from an old mobile phone and copied the "bootcode.bin" file to it. Then I imaged my Moode 3.8.3 SD Card to a file, then burned that file to a cheap Emtec 8G USB Flash drive. And it worked!

However my impression was that SQ suffered. I am not surprised by this, as I understand that in the RPi, the USB buss and the Ethernet buss are shared.
So I will continue to boot from the SD Card. I would rather enjoy better SQ, and replace the SD Card if it ever fails.

Rob
 
Well I think I have the pinouts for the display as per this page..
http://www.rototron.info/wp-content/uploads/Lcdproc04.jpg
Only omitting connection to anode and cathode as it is a vfd display.
Any comments on that ?

@joe0097 Not too sure on your instructions...mostly good but a couple of questions...
1. replace new hd44780.so (compile from lcdproc 0.5.9).
2. or remove old lcdproc and install lcdproc 0.5.9.
Is that covered by the code following it or is it something else entirely ?

put LCDd.service to /lib/systemd/system/ and put LCDd.conf to /usr/local/etc/LCDd.conf

put = create the files as per the examples verbatim and move to those places ?


If everthing went fine it should show the begining text.
What is 'beginning text' or do you mean the display will start showing the now playing info and then update as songs change ?
 
As flesh install you should do as instruction above ignore no.1.

The file LCDd.conf and LCDd.service can download from

https://github.com/fengalin/raspdac-on-osmc/zipball/master/

Then copy LCDd.service to /lib/systemd/system/
And copy LCDd.conf to /usr/local/etc/

Finally edit LCDd.conf file for your lcd type.

sudo nano /usr/local/etc/LCDd.conf

Change this line :

# GPIO pins
pin_D4=25
pin_D5=24
pin_D6=23
pin_D7=18
pin_EN=8
pin_RS=7

And be careful about this line, uncomment if it doesn't work.

# Device of the serial, I2C, or SPI interface [default: /dev/lcd]
#Device=/dev/ttyS0

The welcome message will appear when everything correct in your LCDd.conf

Change to anything you like.
# Hello message: each entry represents a display line; default: builtin
Hello="Moodeaudio 3.83\n"
Hello="GOT S07E07 Final"
 
Found the display, seems it is hd44780 compatible.
14 pins instead of 16 but being vfd it doesn't need a backlight control so 15&16 not used.
Other pins appear to be standard as per the hd44780 and the parallel cable is only plugged. I will remove that and use dupont cables to the Pi.

So off to find the pin configuration to use then back to finding a setup and config. Keep the suggestions coming :)

That link I posted has the pinout down the page.
 
Unless you can source an i2c to parallel converter, you're probably S.O.O.L.

Cheaper and easier to source a compatible display.

Of course you may be able to bypass the parallel interface and talk directly to the display, but you will need the display data sheet.

This may help: I/O Ports Uncensored Part 2 - Controlling LCDs (Liquid Crystal Displays) and VFDs (Vacuum Fluorescent Displays) with Parallel Port - CodeProject

Or offload the task to an Arduino, perhaps? Arduino - HelloWorld

Regards,
Kent
 
Hi Kent,

I am patiently waiting... you already helped put my project on the right track twice. Sort of i am now addicted to your help.

Remy

Hi, Remy.

I see there are 10 channel selector buttons. For this exercise I assume you aren't using the additional "P1-10/P11-20" button (I'll call it the range selector button) as it was originally intended.

The most straight-forward solution is to continue the if/elif pattern you have already used.

Here, I assume you have mapped the 10 buttons to ten variables of the same name (P1-P10), that you have already saved a playlist named FavoriteStations, and that it has at least 10 entries:

Code:
if P1==False:
	subprocess.call(['mpc','clear'])
	subprocess.call(['mpc','load','FavoriteStations'])
	subprocess.call(['mpc','play','1'])
elif P2==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','2'])
elif P3==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','3'])
elif P4==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','4'])
elif P5==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','5'])
elif P6==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','6'])
elif P7==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','7'])
elif P8==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','8'])
elif P9==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','9'])
elif P10==False:
        subprocess.call(['mpc','clear'])
        subprocess.call(['mpc','load','FavoriteStations'])
        subprocess.call(['mpc','play','10'])

Note that telling mpc to clear the playlist implies 'stop'.

This "brute force" solution works but it is not defensive coding. There's no check that FavoriteStations exists, that it contains valid entries, and that the number of entries equals or exceeds the number of buttons. Also, the constant repetition of code suggests using a function to deal with the subprocess calls. As an aside, some folks hate that Python doesn't have a case statement and hate the explicit chaining of if/elif statements. The interweb (tm) is rife with suggested alternatives using Python dictionaries, etc. I chose it keep it simple for you.

As for the mapping of buttons, I don't know whether you are using one GPIO line per button (10 buttons = 10 pins) or multiplexing/Charlieplexing the inputs (10 buttons = 4 pins). The former is easy; the latter takes some diodes to prevent ghosting/masking and requires more complicated code to detect button presses. Google is your friend.

As for the P1-10/P11-20 button, using it requires some thought and more code. Would you go with simultaneous presses of it and a channel selector button or would you replicate the way my receiver works---first press the range selector button and then press the channel selector button. The latter gets complicated. Does the range selection revert to P1-10 after a few seconds or does it flip-flop each time the button is pressed?

Regards,
Kent