Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi
Thanks for taking the time to look into this Adrian!

P.S. Changing the i2c baudrate to 800000 fixed my lagging screen, it works beautifully now :-)
Reply
(09-02-2019, 04:56 PM)adrii Wrote: Hi JB and Tim

Thanks for the information on the Moode current song file. I wonder if you could help me with a couple of questions.

Does this file ever provide detailed information on the current song when the song isn't being played by MPD? I.e. are there some cases when I will find detailed song information in the file when it isn't available by querying MPD?

The file doesn't seem to include information about the track length and track progress, is that right? And so, I would need to query MPD for these as I do now, and they would only be available when MPD was the player?

JB, I will look at whether I can write the non-MPD player/renderer name into the song title area. If the spectrum analiser is reading a duplicated ALSA stream then it would continue to function.

Adrian.

Hi Adrian,

It either contains information from MPD or it contains the two lines indicating which renderer is active and what the output rate is.

In addition to MPD information the file also contains the URL to the cover image or radio logo. This comes from moOde code.

Currently I'm not carrying track length or progress but certainly could consider it. Track progress would have a 3 second granularity because the file gets updated in moOde's worker.php job loop which polls every 3 secs.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
Hi Tim

Thanks for the extra information on the current song file, and also for the offer to include track length and progress. In the end, I won't be using the file for detailed song information, and will continue to query MPD as I do now.

Adrian.
Reply
(09-06-2019, 07:11 AM)adrii Wrote: ...
In the end, I won't be using the file for detailed song information, and will continue to query MPD as I do now.

Adrian.

Does this mean it won't be possible to display "Spotify Active" or "Airplay Active" or can that still be done?

Thanks,
JB
Reply
Hi JB

I will read the current song file to extract the alternative renderer name and display it, I just won't be using the file for detailed song information. I imagine the logic will be:

Query MPD:
If "play"/"pause"
   MPD being used, state is "play"/"pause", display detailled song information
else
   read current song file
   if file opened and renderer name is read
      state is "play", display renderer name
   else
      state is "stop"

I also need to make sure that the curent song file isn't opened too frequently.

I can't give a time for adding it in, but it seems like a smallish change.

Adrian.
Reply
I see, thanks very much for the update.
I really appreciate your efforts Adrian, huge thanks for that :-)

JB
Reply
Hi JB

I have pushed an update to show the alternative renderer name.

The final decision logic is:

Query MPD:
If "play"/"pause"
   MPD being used, state is "play"/"pause", display detailled song information
else
   read current song file
   if file opened, and renderer name is read, and state value is not present or is not read as "stop"
      state is "play", display renderer name
   else
      state is "stop"

I have only tested using the Bluetooth renderer.

mpd_oled MUST be built with 'PLAYER=MOODE make' for the new code to be triggered. In other words, it works when built on Moode 6.

For Moode 5 it should still be possible to build with 'PLAYER=MOODE make' if you edit the mpd_oled Makefile and change 
Code:
else ifeq ($(PLAYER),MOODE)
        PLAYERLIBS=-li2c
to 
Code:
else ifeq ($(PLAYER),MOODE)
        PLAYERLIBS=
(although I have not tested this).

Please let me know if you come across any issues!

Adrian.
Reply
Hi Adrian,

I've tested on Moode 6.2.1 and it works perfectly!
I have tested both Spotify and Airplay and both are ok.

Many thanks!
JB
Reply
Hi JB

Great! Thanks for letting me know,

Adrian.
Reply
pi@moode:~/mpd_oled $ PLAYER=MOODE make
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o main.o main.cpp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o timer.o timer.cpp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o status.o status.c pp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o status_msg.o stat us_msg.cpp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o utils.o utils.cpp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o display.o display .cpp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o programopts.o pro gramopts.cpp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o ultragetopt.o ult ragetopt.cpp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o ArduiPi_OLED.o Ar duiPi_OLED.cpp
g++ -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o Adafruit_GFX.o Ad afruit_GFX.cpp
cc -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-strict-aliasing -Ofast -DMOODE -c -o bcm2835.o bcm2835. c
g++ -o mpd_oled main.o timer.o status.o status_msg.o utils.o display.o programopts.o ultragetopt.o ArduiPi_OLED.o Ad afruit_GFX.o bcm2835.o -lmpdclient -lpthread -li2c
/usr/bin/ld: cannot find -li2c
collect2: error: ld returned 1 exit status
Makefile:30: recipe for target 'mpd_oled' failed
make: *** [mpd_oled] Error 1
I used MoOde 4.3, when i command "PLAYER=MOODE make"
IT's show this error as above.
Please help me to fixed this error.
Reply


Forum Jump: