Moode Audio Player for Raspberry Pi

Hi,

Interesting. The result suggests:

1) updated HDMI driver that supports 24/192 is part of Jessie
2) ALSA not happy with 24 bit to your AVR
3) In my case ALSA only allows 16/48 to my AVR

It could be bug in ALSA when it queries the EDID from the HDMI device to see what capabilities it supports.

If I run cmd below it shows 24/192 PCM capability for my AVR, yet only 16/48 from ALSA. Very odd.

pi@rp5:~ $ tvservice -a
PCM supported: Max channels: 8, Max samplerate: 192kHz, Max samplesize 24 bits.
AC3 supported: Max channels: 6, Max samplerate: 48kHz, Max rate 640 kb/s.
DTS supported: Max channels: 7, Max samplerate: 96kHz, Max rate 1536 kb/s.

-Tim
With Marantz:

Code:
pi@moode:~ $ tvservice -a
     PCM supported: Max channels: 8, Max samplerate: 192kHz, Max samplesize 24 bits.
     AC3 supported: Max channels: 6, Max samplerate:  48kHz, Max rate  640 kb/s.
     DTS supported: Max channels: 6, Max samplerate:  96kHz, Max rate 1536 kb/s.
    EAC3 supported: Max channels: 8, Max samplerate:  48kHz, Max rate    8 kb/s.
  DTS_HD supported: Max channels: 8, Max samplerate: 192kHz, Max rate    8 kb/s.
     MLP supported: Max channels: 8, Max samplerate: 192kHz, Max rate    8 kb/s.

With Onkyo:

Code:
pi@moode:~ $ tvservice -a
     PCM supported: Max channels: 8, Max samplerate: 192kHz, Max samplesize 24 bits.
     AC3 supported: Max channels: 8, Max samplerate:  48kHz, Max rate  640 kb/s.
     DTS supported: Max channels: 8, Max samplerate:  48kHz, Max rate 1536 kb/s.
  DTS_HD supported: Max channels: 8, Max samplerate: 192kHz, Max rate    8 kb/s.

Sample rate seems to be fixed now (both avr show 16/192kHz with 24/192 flac), bit depth problem is still there. Very strange why this restriction is put there.

Copy/paste from rpi forum:

by tghewett » Mon Mar 25, 2013 8:24 pm

I have 192kHz/32bit HDMI audio working with kernel 3.2.27+. I tried 24bit but no go, decided 32bit was good enough, just zero the least significant byte and get 24bits.

Receipt of 192kHz sample rate confirmed by display on AV receiver, can't confirm more than 16 bits are being sent as have no equipment which can record the HDMI signal, but since it plays fine at the 32bit setting it would seem reasonable to conclude that all the bits are being sent.

To get this you need to know how to build a linux kernel, though I attach a replacement snd-bcm2835.ko loadable BCM2835 module in case you want to try it out (copy it into the appropriate place in /lib/modules, saving the old file just in case) [EDIT: tried to upload the file but no go]. The file to change is in the kernel sources in sound/arm/bcm2835-pcm.c. Change these lines:

Code:
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 2,

to:

Code:
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_192000,
.rate_min = 8000,
.rate_max = 192000,
.channels_min = 1,
.channels_max = 2,

and then build your kernel and modules. Raspberry Pi Kernel Compile - MitchTech | MitchTech has a good guide for cross-compiling the kernel on a PC, my 2GHZ dual core builds it in under 20 minutes compared to over 6 hours on the Pi.

Also tried changing channels_max to 8 so see if it was possible to get 8 PCM channels working, no go for my AV receiver, it thought it was getting 3 channels and the sound was garbled.

So far no problems at all. I haven't tried setting the playback route to analogue to see what the D-A thinks about 192kHz but it probably won't like it very much. [EDIT don't send more than 48kHz to the analogue device, the OS will crash].

Also tried to see if passthrough was possible to allow AC3/DTS over HDMI - in the device driver I changed the ALSA volume control to directly set the chip without going through the "(vol * 100) / 256" conversion (see macro in bcm2835.h - this loses possibly vital increments) and tried a range of volume settings to see if one did nothing more than multiply the samples by 1.0 to provide true passthrough, no go again. My receiver will definitely decodes AC3/DTS sent over HDMI in this way but anything sent from the Pi comes out as noise no matter what.

I find that kernel 3.6.11+ panics when using the BCM2835 audio device so haven't bothered trying that, but the same changes should work just as well.
 
Hi Tim

Just upgraded to REL 2.6 and I can't get Moode to work. The "generic I2S device" in System settings isn't available anymore. My card is a generic CM6631A board from Aliexpress that used to work with the earlier versions just fine. I'm attaching screenshots of the "System settings" and "Customization" screens. What am I doing wrong?

BDJiSEu.jpg


AFs7God.jpg
 
Sorry, I've been preoccupied with a local volunteer effort. Just getting back to fun and games with audio players.

I'm afraid I may have misdirected you a bit with my discussion of the usb.ids file. It is consulted only after a USB device is enumerated by the system (I called it "detected" but "enumerated" is the USB term).

Based on the output from your Windows app, I would expect that, when you plug your "XMOS USB Audio" device into your RPi, you see a new line in the lsusb output resembling

Bus 001 Device 004: ID 20b1:3086

As I understand your earlier post, you don't. This means the device hasn't been enumerated. If it had been, then a core routine in lsusb would have looked up the VendorID/ProductID in usb.ids and added the text description it found, if any.

I don't have any devices at hand that I can use to test the following hypothesis but it seems to be the prevailing wisdom on the RPi forums:



This advice was written almost three years ago, so details may vary with more recent versions of the RPi (for the B+, 2B, and 3B models I believe the total draw from the four USB ports is limited to 1.2A), but the general wisdom still is that the RPi's USB ports don't deal with high-current USB devices as well as most PC's USB ports do.

Have you tried using a "good-quality powered hub" between your RPi and your USB DAC as recommended in the above quote?

Regards,
Kent

Hi Kent
Thanks for your effort - and it works with a powered usb hub. Succes......!
Fantastic......

I did already try with different separate well regulated 5v powersupplies with up to 2A. But either there is still some kind of communication between data and power - or these powersupplies are not good enough ;-)
And I had no internet for several days, so that reasoning my late answer.

Still - thx so much :) :) :) :)

The best
Baek47
 
Hi Siegbert,

Nice to hear WiFi is working now :)

I've been running with 4.4.13 kernel and no issues. The newer 4.4.15 kernel has some important bug fixes and should work well.

-Tim



Dear Tim,

following findings using Moodeaudio 2.6 (+ update 2016-07-10) with WiFi Rasp 3:

- using as AP for Airplay is running well (WLAN0 in Master Mode - 172.24.1.1)).

- using WLAN0 in normal WiFi-Mode run very unstable. (iwconfig and iwlist wlan0 scan are ok). Problem: cannot connect with correct set SSID and PSK to external AP (1 try from 20 ar connected ok)

- on the equal hardware (PI 3 + HifiBerry DAC+ Pro) with the newest Rasp-Jessie Image, all WLAN Funktions (use as AP Hostmode or normal) are ok.

Same result wit the latest kernel Update to 4.4.13.

Think, something is not ok with the MoodeAudio kernel in use with WLAN0 and external AP.

Regards
Siegbert
 
With Marantz:

Code:
pi@moode:~ $ tvservice -a
     PCM supported: Max channels: 8, Max samplerate: 192kHz, Max samplesize 24 bits.
     AC3 supported: Max channels: 6, Max samplerate:  48kHz, Max rate  640 kb/s.
     DTS supported: Max channels: 6, Max samplerate:  96kHz, Max rate 1536 kb/s.
    EAC3 supported: Max channels: 8, Max samplerate:  48kHz, Max rate    8 kb/s.
  DTS_HD supported: Max channels: 8, Max samplerate: 192kHz, Max rate    8 kb/s.
     MLP supported: Max channels: 8, Max samplerate: 192kHz, Max rate    8 kb/s.

With Onkyo:

Code:
pi@moode:~ $ tvservice -a
     PCM supported: Max channels: 8, Max samplerate: 192kHz, Max samplesize 24 bits.
     AC3 supported: Max channels: 8, Max samplerate:  48kHz, Max rate  640 kb/s.
     DTS supported: Max channels: 8, Max samplerate:  48kHz, Max rate 1536 kb/s.
  DTS_HD supported: Max channels: 8, Max samplerate: 192kHz, Max rate    8 kb/s.

Sample rate seems to be fixed now (both avr show 16/192kHz with 24/192 flac), bit depth problem is still there. Very strange why this restriction is put there.

Copy/paste from rpi forum:

Hi,

Since you are seeing 192 kHz sample rate, the symptom "ALSA outputting 16 bit instead of 24 bit" suggests bug in ALSA rather than the old 16/48 limit unless the ALSA devs changed from 16/48 to 16/192 maintaining the 16 bit limit, but that makes no sense.

Wrt, the forum post you included, some of the devs for other players build and support their own custom Linux kernels and can patch (alter) the source code for some of the kernel drivers for example the HDMI driver, before making the new kernel.

-Tim
 
Hi Tim

Just upgraded to REL 2.6 and I can't get Moode to work. The "generic I2S device" in System settings isn't available anymore. My card is a generic CM6631A board from Aliexpress that used to work with the earlier versions just fine. I'm attaching screenshots of the "System settings" and "Customization" screens. What am I doing wrong?

BDJiSEu.jpg


AFs7God.jpg

Hi,

Try either Hifiberry DAC or RPi-DAC I2S drivers. These are the "generic" drivers.

-TIm
 
Dear Tim,

following findings using Moodeaudio 2.6 (+ update 2016-07-10) with WiFi Rasp 3:

- using as AP for Airplay is running well (WLAN0 in Master Mode - 172.24.1.1)).

- using WLAN0 in normal WiFi-Mode run very unstable. (iwconfig and iwlist wlan0 scan are ok). Problem: cannot connect with correct set SSID and PSK to external AP (1 try from 20 ar connected ok)

- on the equal hardware (PI 3 + HifiBerry DAC+ Pro) with the newest Rasp-Jessie Image, all WLAN Funktions (use as AP Hostmode or normal) are ok.

Same result wit the latest kernel Update to 4.4.13.

Think, something is not ok with the MoodeAudio kernel in use with WLAN0 and external AP.

Regards
Siegbert

Hi Siegnert,

Moode uses stock Linux kernels so same as what is used in Raspbian.

Usually if the symptom is "unable to connect to WiFi Router" then its one of the following:

1) odd characters in SSID or password that Moode's WiFi connection function can't handle
2) misspelled or wrong case in SSID or password
3) Raspberry Pi WiFi adapter not compatible with Router.

-Tim
 
Hi Kent,

Those are nice features and maybe I'll add to the TODO list but for now I think Moode Source and Network configs are working ok and can be left alone for a while. This frees up time for working on other things :)

Btw, cross-platform development (and integration of streaming Music services) are two areas I'm going to leave in the hands of the other fine Players.

-Tim

Very sensible, Tim. I was born in in SE Kansas. I grew up hearing "if it ain't broke, don't fix it!" I certainly don't consider Moode Player broke. I listen to it constantly: an RPi2B with HiFiBerry DAC+ running in the living room and an RPi3B with USB DAC running in my multipurpose office/den/workshop. Sweet.

Regards,
Kent

PS - I have had no trouble with the RPi3B and HiFiBerry DAC+ combo itself, but I had WiFi signal issues in my living room because of the characteristics of its on-board transceiver and antenna, distance to Access Point, intervening walls, etc., so reverted to the HiFiBerry DAC+ on an RPi2B + WiFi dongle as a matter of convenience.
 
Hi Kent
Thanks for your effort - and it works with a powered usb hub. Succes......!
Fantastic......

I did already try with different separate well regulated 5v powersupplies with up to 2A. But either there is still some kind of communication between data and power - or these powersupplies are not good enough ;-)
And I had no internet for several days, so that reasoning my late answer.

Still - thx so much :) :) :) :)

The best
Baek47

I'm pleased to hear you succeeded, Baek47. Enjoy the music!

Regards,
Kent
 
Library limitations

Hi all

I've recently been trying several web based players and so far prefer Mood. As a Linux user I have less options, I liked the "Gnome Music Player Client", it was the only client that sported album cover browsing (via a plugin) but the author has ceased its development. Mood was the closest to incorporating good meta data filtering in its Library however it doesn't appear to work with larger collections, once I included 5000 albums via NFS the Library no longer loads.
Any suggestions or tips?
 
Hi all

I've recently been trying several web based players and so far prefer Mood. As a Linux user I have less options, I liked the "Gnome Music Player Client", it was the only client that sported album cover browsing (via a plugin) but the author has ceased its development. Mood was the closest to incorporating good meta data filtering in its Library however it doesn't appear to work with larger collections, once I included 5000 albums via NFS the Library no longer loads.
Any suggestions or tips?

Hi,

Depends on what u mean by "large" collection and whether you know with certainty that its the sheer number of tracks that is causing the issue. There are Moode users with 40K+ track collections and no issues, and there are Moode users with 5K track collections and issues.

In my experience troubleshooting user issues, when MPD fails to index all or part a collection its due to one of the following:

1) bad permissions on song files or folder containing files
2) no_root_squash flag not set on NFS server export
3) corrupt song files

-Tim
 
Hi,

Depends on what u mean by "large" collection and whether you know with certainty that its the sheer number of tracks that is causing the issue. There are Moode users with 40K+ track collections and no issues, and there are Moode users with 5K track collections and issues.

In my experience troubleshooting user issues, when MPD fails to index all or part a collection its due to one of the following:

1) bad permissions on song files or folder containing files
2) no_root_squash flag not set on NFS server export
3) corrupt song files

-Tim
I have this issue too.
On the 3rd point isn't it strange Tim that the library does not load on the Moode UI while it works with tablets or phones MPD clients eg with mPad or mPdroid ?

Also on the Volumio forum https://volumio.org/forum/library-continuously-loading-t3452.html they mention a kind of Bug, which maybe reason 4) FWIW. I have same problem with Volumio, maybe library loader is the same or close code, but I have not tried the suggested fix

Best
Jean-Louis
 
Last edited:
SOMA FM?

Tim:

I had a curious incident here. I've been auditioning a bunch of radio stations for the last day or so but this afternoon decided to go back to the SomaFM stations already defined in r2.6.

For a period of time, none would play on my Moode Player nor would it display a logo or useful info. Concomitantly, the SomaFM stations would play in my desktop browser when I copied the URLs out of Moode Player's "edit station" popup.

Fortunately, in the last few minutes my Moode Player resumed playing SomaFM stations and displaying all the usual goodness. Still, I'm curious about the cause. Other stations continued to play during this period. I'm wondering if my temporary problem with SomaFM might be related to your code which fetches the SomaFM logos from their website. Could it be blocking when the logos aren't available? Just a thought.

I owe you some stations and logos.

Regards,
Kent
 
I have this issue too.
On the 3rd point isn't it strange Tim that the library does not load on the Moode UI while it works with tablets or phones MPD clients eg with mPad or mPdroid ?
Best
Jean-Louis

Hi Jean-Louis,

Not really. AFAIK, the other MPD clients you mentioned use a Browse method to drill into the MPD database similar to Moode Browse panel. The Library panel in Moode loads the entire MPD database into the Browser.

I see you added additional info below to your post.

"Also on the Volumio forum https://volumio.org/forum/library-co...ing-t3452.html they mention a kind of Bug, which maybe reason 4) FWIW. I have same problem with Volumio, maybe library loader is the same or close code, but I have not tried the suggested fix"


Moode Library loader is complete rewrite, as is most of Moode code base starting with release 2.5. At release 2.6 Moode runs on completely new OS (moodeOS) which is based on Raspbian Jessie-Lite.

At this point there are few similarities in code base or OS between Moode and other players based on the original code written by Andrea Coiutti and Simone De Gregori back in 2013.

-Tim
 
Last edited:
Hi,
Depends on what u mean by "large" collection

Currently at 83,281 but still quite a bit more ripping to be done.

Hi,
1) bad permissions on song files or folder containing files
2) no_root_squash flag not set on NFS server export
3) corrupt song files
-Tim

As I had it working earlier with part of my collection on the same NFS export I think its not 2. So possibly 1, 3 or a bit of both.

In the log files I see lots of "PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/inc/playerlib.php on line x" (occurs over various lines)

And in the mood log it doesn't appear to get past loadLibrary(): Generating tag cache...

Perhaps I just need to increase the time out period?

Also, is it safe or advisable to do apt-get upgrade or dist-upgrade or should these be avoided?
 
Currently at 83,281 but still quite a bit more ripping to be done.



As I had it working earlier with part of my collection on the same NFS export I think its not 2. So possibly 1, 3 or a bit of both.

In the log files I see lots of "PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/inc/playerlib.php on line x" (occurs over various lines)

And in the mood log it doesn't appear to get past loadLibrary(): Generating tag cache...

Perhaps I just need to increase the time out period?

Also, is it safe or advisable to do apt-get upgrade or dist-upgrade or should these be avoided?

Hi,

Interesting. What line number(s) in playerlib.php?

There is always risk that apt-get dist-upgrade will cause breakage. I don't use it to hoist one Raspbian release to the next. Instead I use a build recipe to take a complete Raspbian release and make new moodeOS. I've only done this twice. The first time was taking Jessie-Lite 2016-03-18 release and making moodeOS 1.0 which is current. The second time was taking J-Lite 2016-05-10 which I ended up scrapping after test feedback that indicated bugs in Samba and RPi-DAC I2S overlay.

-Tim
 
Okay, so I increased the php-fpm timeout to 180s and the library is now loading. I'm very pleased as it was my favourite part of Mood. Will we see more enhancements to the library in coming editions?

Also what is the preferred channel to place feature requests?

Thanks Tim :)

Hi,

How long does it take to load your collection (>80K tracks) into Library panel?

The first time its loaded will be longest then subsequent loads should be much faster since no processing is done, only a cache file returned.

Post feature requests here or Moode Twitter feed or send me email, all are ok channels :)

-Tim