Mopidy Discourse

Getting information about the current song

Hi!
I would like to hook up a I2C LCD display to the Rasperry 4 which is running Mopidy.
But that’s not the topic of this question.
My problem is, how do I get the information to be shown on the display?

This is what I would like to have access to, either through Mopidy or maybe some lower level component (alsa? driver status?):

  1. current sample frequency
  2. current bit depth
  3. current song title
  4. current artist
  5. current play time and song length
  6. current album title

Thank you for your help

The first two we don’t expose through Mopidy but you should be able to interrogate /proc/sound (or something) to get that info.

The others you can grab the data through one of our frontends. There’s a list at mopidy.com/ext and I think there are even some display-centric ones there that already do something like you want.

awesome! thank you for the reply and for pointing me in the right direction.
I found the first 2 data points in /proc/asound/card0/pcm0p/sub0/hw_params

I think I’ll look into the MPD frontend next. (The Pidi frontend seems to be too focused on that kind of RGB display. I don’t care for controlling each pixel of the screen. I’m just gonna use the RPLCD library to display some text on a monochromatic display :slight_smile: )

Alright, here’s my script! hopefully it’ll be of some use to someone :slight_smile:
It has scrolling text, and can be safely used as a cron job.
It can manage all sizes of display but you’ll have to re-arrange some stuff, mostly in the GetInfo() function.
It requires minimal setup: LCD configuration, log file path, MPD host.
Sorry about the ital-english!! :sweat_smile:

The working parameters of the audio adapter seem to only be dependent on the drivers and not on the current audio stream being played, which is too bad. But it’s still quite cool to have those IMO
Maybe I’ll figure something out some other time
Cheers