[PLUGIN] MPD OLED - installation & configuration plugin

The spectrum is shown :slight_smile: after I run the mpd_oled_cava -p command

Just to confirm… mpd_oled is running and displaying the play screen on the OLED and there are no spectrum bars, and at exactly the same time you can view the spectrum in a terminal with the command above?

exactly :slight_smile:

1 Like

Thanks. From the home directory, could you post the output of stat for a FIFO created there, to see if includes a creation time

cd
mkfifo tmpfifo
stat tmpfifo
rm tmpfifo

Birth is not included : Birth : -

1 Like

Ok. I’ll look into whether there are other ways to get the file creation time on Volumio.

Does this point to FIFO being good then? :thinking: :thinking: I could talking out of my arse because I don’t have a clue…

My 2 cents… Fifo is created when the plugin is enabled or when Volumio boots and load the plugin.
It is persistent.
But I see a cava_fifo_1409 in /tmp with updated date. Where this one comes from?
Edit: I met the problem for the first time!
Saving settings makes it work again

No, FIFO is created on plugin start/enable? @balbuze

// Plugin has started
MpdOled.prototype.onStart = function() {
	const self = this;
	var defer = libQ.defer();

	self.createMpdOledFifo();
	self.commandRouter.executeOnPlugin('audio_interface', 'alsa_controller', 'updateALSAConfigFile');
	
	// Start service
	self.startService();

	defer.resolve();

	return defer.promise;
};

Not sure what cava_fifo_XXX is?

mpd_oled configures cava to write the spectrum data to a FIFO, the output section of the config file looks like

[output]
method = raw
data_format = binary
channels = mono
raw_target = /tmp/cava_fifo_6728
bit_format = 8bit

Ah, maybe the output from CAVA cava_fifo_? has stopped working?

I also had the same issue as @Lintbf a few times.

Unfortunately I’m not at home now, I can’t try to reproduce to send logs

It is possible, but I haven’t seen it before (but the change of audio FIFO I have). I just tried killing mpd_oled_cava, which would also stop the spectrum data being received, but it also killed mpd_oled.

Maybe the mpd_oled_plugin status might say something about the cava status.

Florin, can you run the following command when the spectrum is working, and again after it has stopped working, and post the output from both times

sudo systemctl status mpd_oled_plugin.service

@Adrii

Spectrum bar working :

volumio@volumio:~$ sudo systemctl status mpd_oled_plugin.service
● mpd_oled_plugin.service - MPD OLED Plugin
   Loaded: loaded (/etc/systemd/system/mpd_oled_plugin.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-11-07 18:35:43 UTC; 57s ago
 Main PID: 11433 (mpd_oled_plugin)
    Tasks: 6 (limit: 4410)
   CGroup: /system.slice/mpd_oled_plugin.service
           ├─11433 /bin/bash /tmp/mpd_oled_plugin.sh
           ├─11434 /usr/bin/mpd_oled -o 6 -b 16 -g 1 -f 50 -s 8 5 -C 0 -P s -c fifo,/tmp/mpdoledfifo -B 1 -r 25 -D 24 -S
           ├─11490 sh -c mpd_oled_cava -p /tmp/cava_config_LlH27T
           └─11491 mpd_oled_cava -p /tmp/cava_config_LlH27T

Nov 07 18:35:43 volumio systemd[1]: Started MPD OLED Plugin.

Spectrum bar not displayed:

tvolumio@volumio:~$ sudo systemctl status mpd_oled_plugin.service
● mpd_oled_plugin.service - MPD OLED Plugin
   Loaded: loaded (/etc/systemd/system/mpd_oled_plugin.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-11-07 18:35:43 UTC; 13min ago
 Main PID: 11433 (mpd_oled_plugin)
    Tasks: 6 (limit: 4410)
   CGroup: /system.slice/mpd_oled_plugin.service
           ├─11433 /bin/bash /tmp/mpd_oled_plugin.sh
           ├─11434 /usr/bin/mpd_oled -o 6 -b 16 -g 1 -f 50 -s 8 5 -C 0 -P s -c fifo,/tmp/mpdoledfifo -B 1 -r 25 -D 24 -S
           ├─11490 sh -c mpd_oled_cava -p /tmp/cava_config_LlH27T
           └─11491 mpd_oled_cava -p /tmp/cava_config_LlH27T

Nov 07 18:35:43 volumio systemd[1]: Started MPD OLED Plugin.

Thanks for the output. I don’t see anything unusual there.

I’ll set up a Volumio machine (probably at the weekend) and see if I can reproduce the issue, which would make it easier to troubleshoot.

2 Likes

I just checked mpd_oled_dev on Ubuntu with MPD, and I could remove the FIFO and restart MPD and the spectrum would work again. Checking the cava source I can see that if no audio data is coming in for a short while then cava will reopen the FIFO. This means that the issue isn’t caused by the FIFO beimg recreated.

1 Like

Interesting! Many thanks for your help so far Adrian! :sunglasses: and also everyone else who has chipped int!

Hopefully, I’ll be able to get my hands on another Pi so I can have a proper look myself (currently all my pis are in use at the mo) :persevere:

1 Like

Hello all…
about always on display I’ve added an usefull option to turn off after some configurable time the display when player is stopped… Plus some nice customization…
You can see here…

And here my source…

master branch work fine on Volumio2 and moode branch work fine on last MoodeAudio

I know that the script to change configuration is not much elegant, I don’t know how do in better way, but I can easily lunch it with irexec and can change visualization with IR

@Adrii can be possible to add ALSA loopback on Volumio 3?
fifo method give random unsync spectrum
The plugin version of mpd_oled don’t work well, music becom stuttering as hell when activated

@davidevinavil I would guess that the only reasonable way to provide a copy of the audio on the ALSA loopback device is through a Volumio plugin. I believe that balbuze created a version of the mpd_oled plugin for Volumio 3 that used the loopback device, so maybe you could track that down and try it.

Also, if the current plugin is not working well for you, if you provide details on your hardware and configuration and the steps that lead to the stuttering (if not always) then maybe someone might have some suggestions, or review the operation of the plugin.

Adrian.

1 Like