balena-labs-projects / balena-sound

Build a single or multi-room streamer for an existing audio device using a Raspberry Pi! Supports Bluetooth, Airplay and Spotify Connect

Home Page:https://balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for IPS LCD on Pimoroni PirateAudio

barthex opened this issue · comments

commented

Pimoroni pHAT DAC has been replaced by the new Pirate Audio, which is equipped with a SPI LCD to display e.g. the images and name of played tracks. Pimoroni delivered their own software based on Mopidy https://github.com/pimoroni/pirate-audio

Hi thanks for reporting this @barthex. We definitely want to add support for the Pirate Audio lineup but we haven't had the chance to play with one yet. If you get it to work please do share a PR!

commented

Hi, I'm the owner of Pirate Audio. It sounds beautiful, but in addition to the LCD, I have a haze how to set the right volume - the default causes painful clipping of the attached amplifier. Reducing the volume level through the Spotify Connect interface to a minimum is helpful.
I was thinking about using the -onevent option in librespot in combination with MQTT - this would allow external LCD, based on the popular ESP8266 with ESPEasy software. The doubt I have is whether to use an additional MQTT container, external MQTT (e.g. http://dioty.co). Both have their advantages.

Hi, I also got a Pirate Audio board. On top of the LCD screen, I was hoping that the 4 buttons on the headphone HAT could also be integrated with BalenaSound to skip/play/pause music over bluetooth/airplay/spotify. I saw that there is already a PR on adding bluetooth remote control, maybe this is something that can work in parallel?

Hi @tmigone,
Could this project be compatible with balena sound?
https://github.com/pimoroni/pidi-spotify from dtcooper/raspotify#294

Is there anything I can do to help here?

@Fiqq90 In tinkering with Spotify and Raspotify/Librespot to build PiDi Spotify I found it's very much a one-way deal. Librespot's -onevent hooks can push information about play state and media into PiDi Spotify really easily, but the authentication procedure to exert control over a Spotify playlist (fully logging into the users account) is rather more complicated and I wasn't sure exactly where we stood in terms of a "commercial project".

Local volume control via alsa is possible, but may prove slightly contrived since if you turn the volume all the way down on the hardware you can't then turn it up from a remote client.

I think Bluetooth can support track information, is it possible to hook into this? It's a little outside the remit of PiDi-Spotify but the original PiDi - https://github.com/pimoroni/pidi (into which PiDi Spotify may ultimately be merged) - has both MusicBrainz album art lookup support, and the ability to - in theory - support client plugins to receive data from other sources.

I think ShairPort Sync can broadcast track metadata, too, which should be a shoo-in for PiDi.

Note: while Pirate Display is ostensibly for our products, it supports plugins that can - in theory - display album art on any display. I'm all ears for adding support for other LCD products if it better positions PiDi as the Get-Your-Track-Info-From-Whereever-Onto-An-LCD tool of choice.

Edit:

I dived headfirst into this last night, and I've added prototype support for Shairport Sync's Metadata Pipe to PiDi. A PR detailing how to experiment with it is available here- pimoroni/pidi#3

I don't think PiDi is necessarily the answer though. We have multiple different audio streaming solutions with multiple disparate track information formats, but PiDi only supports mapping ONE of those formats to ONE type of display.

Giving more thought to @barthex's MQTT idea, it would seem sensible to adapt all of these formats to push standardised track info into MQTT (or some similar pub/sub setup) and then any front-end can pull that MQTT data and display it on an LCD. I now have a pretty good understanding of Librespot's -onevent and Shairport Sync's metadata pipe formats, in addition to some experience writing plugins for Mopidy (mopidy-pidi, mopidy-raspberry-gpio) (though I don't think that's supported/included in Balena Sound yet?). I think if we focus on a core offering of Album Art, Song Title, Album Name, Artist Name, Playing/Paused we could get some project under way to unify these formats. All ears for suggestions, and eager to find some partners in crime for this project.

Hi,

Is there any chance for progress on this issue?

It's unlikely I'll ever find the time or headspace to look into support properly. I tend to be firefighting issues or working on new drivers most of the time and had completely forgotten about this.

I can potentially supply @tmigone with boards if they want a play, but otherwise I'm drowning in stuff to do.