Moode Forum
[How to do instruction] 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: FAQ and Guides (https://moodeaudio.org/forum/forumdisplay.php?fid=9)
+--- Thread: [How to do instruction] 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi (/showthread.php?tid=155)



RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - JohnnyBravo - 03-26-2020

If I move /etc/asound.conf and restart mpd, then all works fine, also the files that previously gave me the error.
If i put /etc/asound.conf back and restart mpd, then the issues as described start.
I'm not sure if that means it's related to the bug you mention though...

JB


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - adrii - 03-26-2020

Hi JB

The configuration file is clearly involved, but I am not sure what is causing the issue. I know very little about configuring ALSA, but I notice that the lookback device is described as "Loopback PCM", and the file is DSF, with your DAC able to handle native DSD. Could it be that you are sending DSD to the DAC and the Loopback device can't handle it and so the hw:1,0 device, which has the loopback device as a slave, can't be opened?

Adrian.


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - JohnnyBravo - 03-27-2020

(03-26-2020, 08:08 PM)adrii Wrote: Could it be that you are sending DSD to the DAC and the Loopback device can't handle it and so the hw:1,0 device, which has the loopback device as a slave, can't be opened?

Maybe that's what the problem is, but unfortunately I also know very little about ALSA.
For now I've reverted to the standard installation method, applying the patch to Moode, etc.

Thanks,
JB


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - Baisey - 03-31-2020

Hello
I've had this setup with moode under both i2c and spi. Both worked perfectly.
I think my SD card corrupted so had to re-install. I did make a backup but thats on a work computer and i'm at home for the foreseeable (UK).
I have an Adafruit SSD1306 128x64 connected via SPI. When I come to test the screen (sudo ./mpd_oled -o 1 -b 10 -g 1 -f 20) I get  - 'mpd_oled: error: could not initialise OLED'.

Code:
ls -l /dev/spi*
crw-rw---- 1 root spi 153, 0 Mar 31 18:02 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Mar 31 18:02 /dev/spidev0.1

The pi is seeing the screen because I can run demo files from Adafruit and luma.OLED but not from ArduiPi.
I used this as a guide on how to wire the screen to the pi - http://hallard.me/adafruit-oled-display-driver-for-pi/. I think the the mpd_oled default settings will work with this wiring.
Any help would be much appreciated.
Raspberry Pi 3B - Moode 6.4.2

Thank you
Paul


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - adrii - 04-01-2020

Hi Paul

If you can run other projects then it sounds like your display is connected correctly, and the mpd_oled command you are running should be using default values that are correct for your display.

The issue could well be with mpd_oled. I only recently added command line support for SPI, and it has not been widely tested. I am not sure if there is a report of an SPI SSD1306 display working with mpd_oled, although there is a report for the compatible SPI SSD1309 working with the SSD1306 code. 

However, there is a specific potential for there being issues with the SPI support. The communications library that mpd_oled uses appears to talk the the RPi hardware directly, rather than using the Linux devices. I updated this library to be compatible with the RPi4 recently and this led to issues with I2C devices that were sharing a bus. It turned out that the original library I was using had been customised to use the Linux /dev/i2c* devices, and when I added this code back in to the updated library this fixed the issue. However, the same is also true of SPI, as the library does not use the /dev/spidev* devices, but the original library was never customised to use these devices and so there is no code I can add back in to use them instead.

If you are running any other SPI devices it may be there is some kind of conflict that is making the mpd_oled initialisation fail. Otherwise, if you are able to add print statements to the mpd_oled code you could try to track down the innermost function that is failing during the initialisation, and it might suggest where the issue lies.

Adrian.


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - Baisey - 04-01-2020

Hello Adrian

Thank you for the reply.
I had my SPI SSD1306 display working with mpd_oled a few weeks back. It looked really good. This was before the rpi4 code update.
I am not using any other SPI devices. Just 1 OLED screen.
Looks like im going to have to learn a bit of python. I'm afraid don't know how to add print statments to code.
Always the way. Just as soon as i get something working. It stops working.

Thanks again

Paul


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - adrii - 04-01-2020

Hi Paul

In that case, you could just build an older version of mpd_oled. The following commands build the last version before I updated the communications library
Code:
git clone https://github.com/antiprism/mpd_oled.git mpd_oled_oled
cd mpd_oled_oled
git checkout 410fcba
PLAYER=MOODE make

You can see the numbers that reference the older versions of mpd_oled on the right hand side here: https://github.com/antiprism/mpd_oled/commits/master
If you want to build a different earlier version of mpd_oled, just put that number in the 'git checkout' command (and run 'make clean' if you change versions after previously running 'make').

Adrian.


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - Baisey - 04-02-2020

Hello Adrian

I'll definitely give that a go. Its just not the same without the little graphic equaliser bouncing around.
By going down this route does that mean when you update mpd_oled I wouldn't be able to go beyond the above version (unless the SPI lib is fixed)? Say when Moode has been updated.


Thank you
Paul


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - adrii - 04-02-2020

Hi Paul

The updates to mpd_oled in response to updates to Moode have generally just been changes to the instructions for setting up the copy of the audio, with a new patch for Moode if necessary. So you could just build and install the older version of mpd_oled, and refer to the latest version of mpd_oled for the instructions to make the audio copy and to grab the current patch for Moode.

I would be interested to hear if your display still works with the older version of mpd_oled.

Adrian.


RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - Baisey - 04-02-2020

Hi Adrian

Unfortunately it didn't work.
From a clean install of Moode, I followed the guide then ran the additional code you posted.
I now have 2 directories - mpd_oled and mpd_oled_oled
mpd_oled shows the same 'could not initialise' error.
mpd_oled_oled shows no errors in terminal but nothing on the screen.
Have I done this correctly? Should I have substituted in your new code into the guide rather than doing one then the other?

Thank you
Paul