Moode Audio Player for Raspberry Pi

Hi,

Thanks for the nice compliment and feedback on cover art!

The Volume Knob Command Line Interface (CLI) is a small shell script for controlling volume that is located at "/var/www/knob.sh". It can be used by external IR or Rotary Encoder software to update volume and the Moode knob.

If the audio device has hardware volume controller and MPD volume control is set to "Hardware" then knob.sh will change volume of the audio device and also update the Moode knob 🙂

Example:

ssh root@moode (pwd = moode)
/var/www/knob.sh 35
/var/www/knob.sh 0

etc.

Regards,
Tim Curtis

Thanks for the explanation, Tim!
Much appreciated.

Cheers,
M.
 
DSD volume control issue

Hi,

Regarding the volume control doesn't work properly while playing DSD files, I've tested this on my DAC and found this issue as well:

XMOS based CY5100dsd DAC. Raspberry Pi 2, Moode V2.3.

'DSD support = yes', 'Resampling = disabled', MPD sends native DSD in DoP format to the DAC, volume control set to software. Result: volume control doesn't work properly, set to zero, no sound. Any other setting full sound.

'DSD support = no', 'Resampling = disabled', MPD sends PCM 352.8 kHz format to the DAC, volume control set to software. Result: volume control doesn't work properly, set to zero, no sound. Any other setting full sound.

'DSD support = no', 'Resampling = 24 bit / 176.4kHz', MPD sends PCM 176.4khz format to the DAC, volume control set to software. Result: volume control works as expected.

Seems MPD doesn't know how to do (software) volume control on native DSD?

For me not an issue as I use amplifier's volume control, but people that rely on software volume control get a nasty surprise when playing DSD.
 
Hi,

Regarding the volume control doesn't work properly while playing DSD files, I've tested this on my DAC and found this issue as well:

XMOS based CY5100dsd DAC. Raspberry Pi 2, Moode V2.3.

'DSD support = yes', 'Resampling = disabled', MPD sends native DSD in DoP format to the DAC, volume control set to software. Result: volume control doesn't work properly, set to zero, no sound. Any other setting full sound.

'DSD support = no', 'Resampling = disabled', (#1) MPD sends PCM 352.8 kHz format to the DAC, volume control set to software. Result: volume control doesn't work properly, set to zero, no sound. Any other setting full sound.

'DSD support = no', 'Resampling = 24 bit / 176.4kHz', MPD sends PCM 176.4khz format to the DAC, volume control set to software. Result: volume control works as expected.

(#2) Seems MPD doesn't know how to do (software) volume control on native DSD?

For me not an issue as I use amplifier's volume control, but people that rely on software volume control get a nasty surprise when playing DSD.

Hi,

Regarding #2 (bolded) that was my first thought since MPD software volume control is designed for PCM. I think its confirmed by MaxK in the conversation near the end of the following MPD development thread. Its three years old but probably applies to current MPD release. This would need to be confirmed.

Music Player Daemon (mpd) development list ()

"...we don't have a software volume
implementation for DSD."

In #1 (bolded) since resampling disabled, then is it MPD's DSF decoder thats performing DSF --> PCM 352.8 kHz? Is bit depth 32bit?

I think in this case even though output is PCM, MPD must internally be bypassing software volume control for some reason.

Regards,
Tim
 
Hi,

Airfoil + shairport-sync = SUB.FM throughout the house in perfect sync 🙂

Regards,
Tim
 

Attachments

  • airfoil-demo1.jpg
    airfoil-demo1.jpg
    145.3 KB · Views: 249
First I would lige to say thanks for a great software ! I'm using it on a RPi2 with a Digi+ to my Hegel H80 with digital RCA. The sound is great !

I just updatede from 2.1 to 2.3 and had looked very much forward to new funktion "Album art", which is one the things I am missing VERY much. Should it funktion when browsing albums ? I have a picture named folder.jpg in each of my folders (albums) with flac-files, and the same picture is embedded in each flach-file, but the only place I see the picture is in the player.
I would very much like something like Plex or others, where it's covers You browse thrue and not the small text-line as now (see attached file). Maybe abillity to shift ?
An other thing that would be great is the possibility just to play a number by pressing a buttom, instead of now, where it is always add and "something" else. I like zapping around in my music-collection without making a playlist 🙂

Thanks for reading
 

Attachments

  • album-art.jpg
    album-art.jpg
    43.2 KB · Views: 235
First I would lige to say thanks for a great software ! I'm using it on a RPi2 with a Digi+ to my Hegel H80 with digital RCA. The sound is great !

I just updatede from 2.1 to 2.3 and had looked very much forward to new funktion "Album art", which is one the things I am missing VERY much. Should it funktion when browsing albums ? I have a picture named folder.jpg in each of my folders (albums) with flac-files, and the same picture is embedded in each flach-file, but the only place I see the picture is in the player.
I would very much like something like Plex or others, where it's covers You browse thrue and not the small text-line as now (see attached file). Maybe abillity to shift ?
An other thing that would be great is the possibility just to play a number by pressing a buttom, instead of now, where it is always add and "something" else. I like zapping around in my music-collection without making a playlist 🙂

Thanks for reading

Hi Jorgen,

Thanks for the nice compliment! The Digi+ is a really nice board 🙂

Great suggestions and similar to other requests I've received regarding making use of covers in the UI and single click to play. All on my to-do list.

Regards,
Tim Curtis
 
Hi,

I'd suggest 600x600px or something with decent resolution so it will look good if displayed on a large panel.

I have a feature in the works that provides an album art view. The usage scenario is where a big tablet or locally attached display is placed on top of the speaker or somewhere in the front so the nice album art can be seen from the listening spot. It's the digital version of placing the LP jacket on a stand next to the TT. You analog guys know what i'm talking about 🙂

Regards,
Tim

That would be super cool. I have a couple of old tablets I was going to dot about the place to act as Moode interfaces. Being able to mirror the current play would be great - especially for multi-room or retail installations.

Just d/l'd R23 - just about to kick it in the guts 😉
 
Can USB Wifi dongle act as Wifi Access Point on Moode ?

Yes and no. It can, but there isn't any configuration in Moode to support this.

I played around with making an Access Point for taking Moode on the road and it worked just fine.

There are only a few USB wifi adapters that can support an AP - luckily they are the only ones I buy.

I detailed the process in a previous post: AP for stand-alone Moode
 
Last edited:
The Volume Knob Command Line Interface (CLI) is a small shell script for controlling volume that is located at "/var/www/knob.sh". It can be used by external IR or Rotary Encoder software to update volume and the Moode knob.

If the audio device has hardware volume controller and MPD volume control is set to "Hardware" then knob.sh will change volume of the audio device and also update the Moode knob 🙂

Example:

ssh root@moode (pwd = moode)
/var/www/knob.sh 35
/var/www/knob.sh 0

etc.

Regards,
Tim Curtis

I was thinking about a motorised knob (No! Not that kind!) for a custom enclosure using the HifiBerry Amp+. I guess I need to work out the PWM on the Pi for that... more reading to do!
 
Last edited:
I was thinking about a motorised knob (No! Not that kind!) for a custom enclosure using the HifiBerry Amp+. I guess I need to work out the PWM on the Pi for that... more reading to do!

Moode includes the WiringPi GPIO interface and IQ_rot Rotary Encoder driver written by the guys at IQaudIO. Might try contacting them for advice but I don't know if it will work for HifiBerry devices.

Regards,
Tim
 
Yes and no. It can, but there isn't any configuration in Moode to support this.

I played around with making an Access Point for taking Moode on the road and it worked just fine.

There are only a few USB wifi adapters that can support an AP - luckily they are the only ones I buy.

I detailed the process in a previous post: AP for stand-alone Moode

My usb wifi Realtek 8188eu and i must copy rtl8188eufw firmware to moode. I use this tutorial for AP mode
https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/install-software
 
KNOB.SH AND LIRC "INTEGRATION"

About the knob.sh script and remotes (lirc)...
I remember the UI updated in realtime time ago, now I've just read it's handled by the knob.sh script.

Well.. long story short: the webUI volume wasn't updating with remote presses... it adjusted the alsa volume but not the ui. (because I was using mpc commands)

Also using alsa commands or using alsamixer doesn't update the webUI. But I don't care about that now.

Premise: I'm not a coder nor programmer, first time with bash done with 10 mins of googling and some trial and error, so don't trust this if you don't know what you're doing.
Your raspberry, your ears or your window glasses could explode 😀

I wanted that hitting volume buttons in the remote would update the webUI too in realtime, not only the alsa volume.

I tried the usual way (binding mpc or alsa commands) but the webUi wasn't updating in real time... a manual refresh was needed.

So I had to add a bit of code to knob.sh.
This allows me to bind easy commands in lircrc AND the knob updates in realtime.
The original script worked by feeding it a volume number to set e.g.: "./knob.sh 35"
I modded it to have also "./knob.sh volup" (or voldown / mute).

To give you an idea (using steps of 3 in this example):
Code:
if [ "$1" = "volup" ]; then 
        actual=$(sed -n -e 's/^.*volume_knob_setting: //p' /var/www/tcmods.conf)
        newvol=$(echo $((actual+3)))

        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '$newvol /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M $newvol% > /dev/null
        else
                amixer set Digital $newvol% > /dev/null
        fi

        exit
fi

if [ "$1" = "voldown" ]; then 
        actual=$(sed -n -e 's/^.*volume_knob_setting: //p' /var/www/tcmods.conf)
        newvol=$(echo $((actual-3)))

        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '$newvol /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M $newvol% > /dev/null
        else
                amixer set Digital $newvol% > /dev/null
        fi

        exit
fi

if [ "$1" = "mute" ]; then 
        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '0 /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M 0% > /dev/null
        else
                amixer set Digital 0% > /dev/null
        fi

        exit
fi

e.g. in lircrc now I just use the new commands:
Code:
begin
    prog = irexec
    button = KEY_VOLUMEUP
    config = /var/www/knob.sh volup
    repeat = 4
end
begin
    prog = irexec
    button = KEY_VOLUMEDOWN
    config = /var/www/knob.sh voldown
    repeat = 4
end
begin
    prog = irexec
    button = KEY_MUTE
    config = /var/www/knob.sh mute
    repeat = 4
end

It works. I'll have to fix the mute to effectively mute and unmute instead of setting the volume to 0, but I was in a hurry and tired when I did this.

Now the problem is...
Is this the best way to do it?
Or it's already implemented (to update the volume knob in realtime when using IR remotes) and I didn't notice it?




setup is raspy B+, IQaudio pidac+, moode r2.2, set to hw audio etc.

PS: also having fun with text to speech, hit a button on remote and a sweet lady voice tells me which station I'm listening to, or the song/album/artist or the volume level (dirty fix until I get a LCD 😀 )
 
@ challenge
This allows me to bind easy commands in lircrc

Hey, you got lircrc working for Moode..🙂
As another non-coder non-programmer I have tried and failed to get lircrc running using the Raspberry Pi and Volumio tutorials.
I gave up and use keyboard and mpc commands. (and am still struggling to configure with x-key bindings )

Could you point to the info you used to get lircrc working ?
 
About the knob.sh script and remotes (lirc)...
I remember the UI updated in realtime time ago, now I've just read it's handled by the knob.sh script.

Well.. long story short: the webUI volume wasn't updating with remote presses... it adjusted the alsa volume but not the ui. (because I was using mpc commands)

Also using alsa commands or using alsamixer doesn't update the webUI. But I don't care about that now.

Premise: I'm not a coder nor programmer, first time with bash done with 10 mins of googling and some trial and error, so don't trust this if you don't know what you're doing.
Your raspberry, your ears or your window glasses could explode 😀

I wanted that hitting volume buttons in the remote would update the webUI too in realtime, not only the alsa volume.

I tried the usual way (binding mpc or alsa commands) but the webUi wasn't updating in real time... a manual refresh was needed.

So I had to add a bit of code to knob.sh.
This allows me to bind easy commands in lircrc AND the knob updates in realtime.
The original script worked by feeding it a volume number to set e.g.: "./knob.sh 35"
I modded it to have also "./knob.sh volup" (or voldown / mute).

To give you an idea (using steps of 3 in this example):
Code:
if [ "$1" = "volup" ]; then 
        actual=$(sed -n -e 's/^.*volume_knob_setting: //p' /var/www/tcmods.conf)
        newvol=$(echo $((actual+3)))

        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '$newvol /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M $newvol% > /dev/null
        else
                amixer set Digital $newvol% > /dev/null
        fi

        exit
fi

if [ "$1" = "voldown" ]; then 
        actual=$(sed -n -e 's/^.*volume_knob_setting: //p' /var/www/tcmods.conf)
        newvol=$(echo $((actual-3)))

        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '$newvol /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M $newvol% > /dev/null
        else
                amixer set Digital $newvol% > /dev/null
        fi

        exit
fi

if [ "$1" = "mute" ]; then 
        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '0 /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M 0% > /dev/null
        else
                amixer set Digital 0% > /dev/null
        fi

        exit
fi

e.g. in lircrc now I just use the new commands:
Code:
begin
    prog = irexec
    button = KEY_VOLUMEUP
    config = /var/www/knob.sh volup
    repeat = 4
end
begin
    prog = irexec
    button = KEY_VOLUMEDOWN
    config = /var/www/knob.sh voldown
    repeat = 4
end
begin
    prog = irexec
    button = KEY_MUTE
    config = /var/www/knob.sh mute
    repeat = 4
end

It works. I'll have to fix the mute to effectively mute and unmute instead of setting the volume to 0, but I was in a hurry and tired when I did this.

Now the problem is...
Is this the best way to do it?
Or it's already implemented (to update the volume knob in realtime when using IR remotes) and I didn't notice it?




setup is raspy B+, IQaudio pidac+, moode r2.2, set to hw audio etc.

PS: also having fun with text to speech, hit a button on remote and a sweet lady voice tells me which station I'm listening to, or the song/album/artist or the volume level (dirty fix until I get a LCD 😀 )

Hi,

This is very nice 🙂 There is nothing in Moode right now for IR support so this is best way to do it with knob.sh

No interface yet for the Moode mute button so I'd suggest staying with vol=0 for now. I'll look into it 🙂

Regards,
Tim C