Moode Audio Player for Raspberry Pi

I did a search before posting, but knew, deep down, I was setting myself up by posting that 🙁

On a semi-related note, just how many DAC's do you have and was your recent move to a warehouse space? 🙂

Hi Mike,

No to warehouse move and I test with just a handfull of devices, enough to cover the basics for USB and I2Ss, PCM5122, ES9023 and TAS chips. This approach has worked ok so far 🙂

-Tim
 
Has anyone played with two i2s DACs to get multichannel FLACs playing? When playing multichannel FLAC, it sounds like my single DAC is possibly getting both front and back. Is it possible that there is a pin from Pi that toggles between the two telling which DAC to get front or back? Ive done some searching in the forums and dont see much.. A next step would be to know if a SPDIF converter will have the right bit depth and # of channels..?? I really want to marry this up to a miniDSP and run crossovers, room correction etc..
 
Definitely. This is much worse than the big Northeast/Midwest grid blackout that occurred in August 2003 because of the freezing temps. No power as of this AM. Outside temp is 18 deg F and inside house is 44 deg F. Yup, you can see you own breath.

-Tim

I won't moan that Wellington has got me wearing thermal pants and a down gilet 🙂 it's about 15C, which is way too cold for my liking...

I've been to Michigan - it was cold and windy as heck. Minnesota was worse!

Keep warm, hug a battery-powered, overclocked Pi2 🙂
 
Has anyone played with two i2s DACs to get multichannel FLACs playing? When playing multichannel FLAC, it sounds like my single DAC is possibly getting both front and back. Is it possible that there is a pin from Pi that toggles between the two telling which DAC to get front or back? Ive done some searching in the forums and dont see much.. A next step would be to know if a SPDIF converter will have the right bit depth and # of channels..?? I really want to marry this up to a miniDSP and run crossovers, room correction etc..

Are u physically connecting 2 I2S DAC's to a single Pi?
 
Spotify connect installation problem

Hello friends!

So, as offered, I have made a simple set of instructions in how to get Spotify Connect working inside Moode. You can find them on a GitHub repo I created in the hopes to get feedback in the issues section, and also to be able to expand on it accordingly:

https://github.com/RafaPolit/moode-spotify-connect-web

These are very rudimentary and a first attemp, so be gentle and report any issues, we will build it together! I'm also attaching a Spotify authorization key (@franz159 maybe this can help you a bit?) that is distributed openly in other GitHub projects (disclamer: it is not mine).

The interesting part is that these instructions set up a multiuser environment, so no need to 'bind' the service to one account. It works with multiple accounts. I have tested it with mine and my wife's, and it works perfectly. It takes perhaps just 5 seconds to 'switch' from one account to the other, but it works if you are patient. If not, just switch to playing back from the device and then back to "moOde Connect" and it should work!

Hope this helps others.

@Tim, there are a couple of pointers in there of what I think could be useful info to integrate into moOde, the great advantage now is that it requires absolutely no prior configuration other than saying 'enable'? Let me know if this is somewhat useful or if there needs to be a lot more research and some development on my side to integrate this into moOde (if there is even interest in this or the time to do it!) Thanks as always for this incredible piece of software you have given us.

Best regards,
Rafa.

Hi Rafa

Thank you very much for your repo. I have a problem with the installation. At the point of running spotify connect with the command

/home/pi/spotify/spotify-connect-web/spotify-connect-web --playback_device CARD=ALSA -m PCM --mixer_device_index 1 --bitrate 320 --name "moOde Connect" --key /home/pi/spotify/spotify-connect-web/spotify_appkey.key

I receive

alsaaudio.ALSAAudioError: No such file or directory [hw:1]
Failed to execute script loader

The problem is to define the index of mixer device. Giving amixer controls command, it returns

numid=3,iface=MIXER,name='PCM Playback Route'
numid=2,iface=MIXER,name='PCM Playback Switch'
numid=1,iface=MIXER,name='PCM Playback Volume'
numid=5,iface=PCM,name='IEC958 Playback Con Mask'
numid=4,iface=PCM,name='IEC958 Playback Default'

So i tried all the numids and the name but always the same problem.

Do you have any idea

Best Regards
Kostas
 
Strangely, I've just sent a member a PM with this....

Code:
pi@pi3moodeylounge:~ $ amixer contents
numid=16,iface=MIXER,name='PCM Capture Source'
  ; type=ENUMERATED,access=rw------,values=1,items=4
  ; Item #0 'Mic'
  ; Item #1 'Line'
  ; Item #2 'IEC958 In'
  ; Item #3 'Mixer'
  : values=1
You can select the input device to be active using....

Code:
amixer -c [B][I]n[/I][/B] cset numid=[B][I]n n[/I][/B]

Replace "n" with the appropriate numerics for card id, control number and value.
 
Thank you Jerms

well,

Code:
sudo amixer contents
numid=3,iface=MIXER,name='PCM Playback Route'
  ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
  : values=0
numid=2,iface=MIXER,name='PCM Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=1,iface=MIXER,name='PCM Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=400
  | dBscale-min=-102.39dB,step=0.01dB,mute=1
numid=5,iface=PCM,name='IEC958 Playback Con Mask'
  ; type=IEC958,access=r-------,values=1
  : values=[AES0=0x02 AES1=0x00 AES2=0x00 AES3=0x00]
numid=4,iface=PCM,name='IEC958 Playback Default'
  ; type=IEC958,access=rw------,values=1
  : values=[AES0=0x00 AES1=0x00 AES2=0x00 AES3=0x00]

I want to select PCM Playback Volume so...
Code:
pi@moode:~ $ amixer -c 1 cset numid=1 1
Invalid card number.
Usage: amixer <options> [command]

Available options:
  -h,--help       this help
  -c,--card N     select the card
  -D,--device N   select the device, default 'default'
  -d,--debug      debug mode
  -n,--nocheck    do not perform range checking
  -v,--version    print version of this program
  -q,--quiet      be quiet
  -i,--inactive   show also inactive controls
  -a,--abstract L select abstraction level (none or basic)
  -s,--stdin      Read and execute commands from stdin sequentially
  -R,--raw-volume Use the raw value (default)
  -M,--mapped-volume Use the mapped volume

Available commands:
  scontrols       show all mixer simple controls
  scontents	  show contents of all mixer simple controls (default command)
  sset sID P      set contents for one mixer simple control
  sget sID        get contents for one mixer simple control
  controls        show all controls for given card
  contents        show contents of all controls for given card
  cset cID P      set control contents for one control
  cget cID        get control contents for one control

So it didn't work out.

Best Regards
Kostas
 
The error messages indicate that card 1 doesn't exist in your system.

Try running
Code:
aplay -l

Identify the output you want to use from the results.

Here's mine....
Code:
pi@pi3moodeylounge:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I have a card 1 as I have a USB sound card plugged in.

Also, the example I used in my previous post was, perhaps misleading. I'd had a problem with selecting the "MIC or LINE IN" inputs from a 3.5mm stereo jack. If I read your intention, you want to stream output to the sound device through the PI whilst identifying the mixer device allowing volume control.

J.
 
Are u physically connecting 2 I2S DAC's to a single Pi?

Id like to. Im not sure its possible. What does Moode do when its trying to play multichannel flac? With my current settings I hear a lot of static, but a hint of the song itself. Im assuming its trying to dither multichannel audio into a 2 channel i2s device.. If so, is there a way to hook up two i2s dacs and get it right? If not what about with a USB multichannel DAC? Any models out there that others have found to work with Moode?

Im a hardware design guy, so I dont mind making a board with a 4 channel DAC and putting the boards up on OSHPark or similar for others to order and build.. The really simple answer Id love to hear; is there is a PI output pin that toggles between front and rear for addressing. If thats the case, I could prototype one today. Googling shows hints with PI but nothing definitive I can find.
 
Hey Tim,

How to debug the last.fm scrobbler? Ive confirmed/changed my last.fm password, but still can't seem to contact the server. This is a fresh burn - the last task was to get the scrobbler working but no luck.

I put my Pi in dmz, just in case it was the firewall , but still nada.

Checked logs, but can't find anything about last.fm

Hi Mike,

I don't use last.fm regularly but I just tested and its working ok for me.
https://www.last.fm/user/MoodeAudio

Just in case though, I fixed what might be a small bug in the worker job that launches mpdas. Email me and I'll send you the fix. In the meantime here is some troubleshooting info.

First check to see whether the mpdas process is running after turning it on in the UI. You can also turn on debug logging in the mpdas config file, then run it in the foreground. Be sure to Killall existing mpdas process before launching a new one with debug enabled.

# dump the sql values
sqlite3 /var/www/db/player.db "select id,param,value from cfg_system where param='mpdaspwd' or param='mpdasuser' or param='mpdassvc'"

# mpdas conf file
cat /usr/local/etc/mpdasrc

# process
pgrep mpdas

# launch strings
# foreground
/usr/local/bin/mpdas
# background
/usr/local/bin/mpdas > /dev/null 2>&1 &

-Tim
 
Jerms thank you again

to configure audio output i typed the command
Code:
pi@moode:~ $ sudo amixer cset numid=1 0
numid=1,iface=MIXER,name='PCM Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=0
  | dBscale-min=-102.39dB,step=0.01dB,mute=1

and then

Code:
pi@moode:~ $ /home/pi/spotify/spotify-connect-web/spotify-connect-web --playback_device hw:CARD=UAC2 -m PCM --mixer_device_index 0  --bitrate 320 --name "moOde Connect" --key /home/pi/spotify/spotify-connect-web/spotify_appkey.key

so spotify connect worked

Thank you again
and Thank you RafaPolit

Tim you must definitely incorporate this feature (spotify connect) in the next version of moode.
 
Id like to. Im not sure its possible. What does Moode do when its trying to play multichannel flac? With my current settings I hear a lot of static, but a hint of the song itself. Im assuming its trying to dither multichannel audio into a 2 channel i2s device.. If so, is there a way to hook up two i2s dacs and get it right? If not what about with a USB multichannel DAC? Any models out there that others have found to work with Moode?

Im a hardware design guy, so I dont mind making a board with a 4 channel DAC and putting the boards up on OSHPark or similar for others to order and build.. The really simple answer Id love to hear; is there is a PI output pin that toggles between front and rear for addressing. If thats the case, I could prototype one today. Googling shows hints with PI but nothing definitive I can find.

Simple answer - yes, ALSA can handle up to eight channels and they can be a mix of anything also recognises - 2x i2s + 2x USB, for example.

MPD (and Moode) just goes along for the ride.

The issues are all going to be configuration-based. Identifying the device, assigning it a channel and any dsp or filters (for SW, etc). Not much different than the guys using Pi for active crossovers - lots of good info on that diyaudio thread!

I2S can handle 127 devices per master, so the number of channels are not going to be an issue. Stacking i2s hats off the gpio connector works.

I have a handful of cheap i2s dacs. If I can finish my massive led soldering job, I will have a look at nutting out the specifics.
 
Hi Mike,

I don't use last.fm regularly but I just tested and its working ok for me.
https://www.last.fm/user/MoodeAudio

Just in case though, I fixed what might be a small bug in the worker job that launches mpdas. Email me and I'll send you the fix. In the meantime here is some troubleshooting info.

First check to see whether the mpdas process is running after turning it on in the UI. You can also turn on debug logging in the mpdas config file, then run it in the foreground. Be sure to Killall existing mpdas process before launching a new one with debug enabled.

# dump the sql values
sqlite3 /var/www/db/player.db "select id,param,value from cfg_system where param='mpdaspwd' or param='mpdasuser' or param='mpdassvc'"

# mpdas conf file
cat /usr/local/etc/mpdasrc

# process
pgrep mpdas

# launch strings
# foreground
/usr/local/bin/mpdas
# background
/usr/local/bin/mpdas > /dev/null 2>&1 &

-Tim

Thanks.

I gave up and this morning it was working.... not enough Cuervo!
 
Jerms thank you again

to configure audio output i typed the command
Code:
pi@moode:~ $ sudo amixer cset numid=1 0
numid=1,iface=MIXER,name='PCM Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=0
  | dBscale-min=-102.39dB,step=0.01dB,mute=1

and then

Code:
pi@moode:~ $ /home/pi/spotify/spotify-connect-web/spotify-connect-web --playback_device hw:CARD=UAC2 -m PCM --mixer_device_index 0  --bitrate 320 --name "moOde Connect" --key /home/pi/spotify/spotify-connect-web/spotify_appkey.key

so spotify connect worked

Thank you again
and Thank you RafaPolit

Tim you must definitely incorporate this feature (spotify connect) in the next version of moode.

Sorry I wasn't around to answer, but I'm really glad Jerms came to the rescue. Glad you got things working.

Since configuring Spotify Connect I am no longer downloading hi-fi music, moving the files to the USB drive and loading to the library, but just playing Moode through Spotify!

The small loss in quality is, for me, offset by the simplicity.

Glad it was useful! Best regards,
Rafa.
 
Simple answer - yes, ALSA can handle up to eight channels and they can be a mix of anything also recognises - 2x i2s + 2x USB, for example.

MPD (and Moode) just goes along for the ride.

The issues are all going to be configuration-based. Identifying the device, assigning it a channel and any dsp or filters (for SW, etc). Not much different than the guys using Pi for active crossovers - lots of good info on that diyaudio thread!

I2S can handle 127 devices per master, so the number of channels are not going to be an issue. Stacking i2s hats off the gpio connector works.

I have a handful of cheap i2s dacs. If I can finish my massive led soldering job, I will have a look at nutting out the specifics.

Edit:

*and they can be a mix of anything ALSA recognises