[PLUGIN] MPD OLED - installation & configuration plugin

log when the problem occurs.

http://logs.volumio.org/volumio/u6z5jad.html

that is mpd_oled program polling for mpd status. I cannot change this. It has always worked this way.

The issue of the spectrum not displaying could be that Volumio has recreated the FIFO that mpd_oled (cava) is listenning on.

Hi Adrian ,
Can I do something in this case ?
Thanks

The plugin creates the FIFO and doesn’t do anything else. I think you’re right and something might be happening to the FIFO by Volumio although other users don’t experience any issues. It’s a weird one :persevere:

Mase, does the mpd_oled Volumio plugin create the FIFO, or is it created by the volumiofifo ALSA plugin as part of the ALSA configuration for a program that plays audio? mpd_oled doesn’t run cava until audio is playing, and so the FIFO should already exist when cava opens it.

Florin, I don’t think there is anything you can do for a local fix, but maybe you could run the following command when the spectrum is working, and again when it is not, and see if the birth time changes, which might indicate that the FIFO has been recreated

sudo stat /tmp/mpdoledfifo

Adrian.

The plugin creates the FIFO on plugin startup like this

		execSync("/usr/bin/mkfifo -m 646 /tmp/mpdoledfifo", {
			uid: 1000, 
			gid: 1000 
		});

If the FIFO is not created then the plugin will not start. Once FIFO is created mpd_oled is started.

In that case, it seems less likely that the issue is that the FIFO has been recreated.

But who/what has recreated the FIFO if it’s not the plugin? :thinking::thinking:::thinking:

There are some forms of opening a file that will create it if it does not exist, but I originally wondered (before you replied) if the volumiofifo ALSA plugin was creating the fifo (or could create it). Anyway, if Florin checks with the stat command and the birth time of the FIFO doesn’t change hopefully that will confirm that this isn’t the issue.

As I recall there used to be something similar with MPD, when configured to write to a FIFO, where MPD could be restarted and there was a new FIFO with the same name but mpd_oled/cava still had the old one open (no longer accessible by name) and there was no spectrum. I can’t remember the exact details.

I will check in this evening , after I reach home .

I’m pretty sure there’s a way to run CAVA and pass in the FIFO created i.e. fifo,/tmp/mpdoledfifo) Do you know what this could be? @Lintbf could run this to double check the FIFO is working.

Spectrum is OK after disable and enable the plugin .
volumio@volumio:~$ sudo stat /tmp/mpdoledfifo
[sudo] password for volumio:
File: /tmp/mpdoledfifo
Size: 0 Blocks: 0 IO Block: 4096 fifo
Device: 28h/40d Inode: 472 Links: 1
Access: (0646/prw-r–rw-) Uid: ( 1000/ volumio) Gid: ( 1000/ volumio)
Access: 2022-11-07 16:10:41.990732282 +0000
Modify: 2022-11-07 16:11:44.200058460 +0000
Change: 2022-11-07 16:11:44.200058460 +0000

I will return after the spectrum is not working

1 Like

You have to write a small config file for cava, but it should only be reproducing what mpd_oled is doing, but if it seems like it will help I will post one.

Hi Florin

Did you cut the output short? If so, please post the last “Birth” line while the spectrum is still working (this line says the creation time). I am on Moode here, but my stat output looks like this

pi@moode210922:~ $ sudo stat /tmp/cava_fifo_6728
  File: /tmp/cava_fifo_6728
  Size: 0         	Blocks: 0          IO Block: 4096   fifo
Device: b302h/45826d	Inode: 24029       Links: 1
Access: (0644/prw-r--r--)  Uid: ( 1000/      pi)   Gid: ( 1000/      pi)
Access: 2022-11-07 14:32:12.936854469 +0100
Modify: 2022-11-07 14:32:30.886765733 +0100
Change: 2022-11-07 14:32:30.886765733 +0100
Birth: 2022-11-07 14:32:12.936854469 +0100

Adrian.

Hi Adrian ,

volumio@volumio:~$ sudo stat /tmp/mpdoledfifo
File: /tmp/mpdoledfifo
Size: 0 Blocks: 0 IO Block: 4096 fifo
Device: 28h/40d Inode: 472 Links: 1
Access: (0646/prw-r–rw-) Uid: ( 1000/ volumio) Gid: ( 1000/ volumio)
Access: 2022-11-07 16:10:41.990732282 +0000
Modify: 2022-11-07 16:35:13.934760673 +0000
Change: 2022-11-07 16:35:13.934760673 +0000
Birth: -
volumio@volumio:~$
Thanks

Thanks, but it looks like the Birth time might not be available for the /tmp filesystem on Volumio, in which case this method won’t say if the FIFO has changed.

Following up on Mase’s suggestion. If the spectrum is not working, see if audio data is being sent to the FIFO by playing some audio and running

cat /tmp/mpd_oled_fifo

Press CTRL-C when done. If you saw lots of weird character the FIFO is active, in which case, create a file called cava_config.txt with the following contents

[input]
method = fifo
source = /tmp/mpdoledfifo

Then run

mpd_oled_cava -p cava_config.txt

If you saw a spectrum then the FIFO is working correctly, but may have changed (that is not the only explanation, but other possibilities can be investigated within mpd_oled).

Adrian.

now spectrum is not displaying
volumio@volumio:~$ cat /tmp/mpd_oled_fifo
cat: /tmp/mpd_oled_fifo: No such file or directory
volumio@volumio:~$

Sorry, wrong file name (my FIFO here is called that), instead

cat /tmp/mpdoledfifo