galactic-bluetooth-audio
galactic-bluetooth-audio copied to clipboard
Galactic/Cosmic Bluetooth Audio Roadmap
Near Term
- [x] Delete unused files and refactor the project to look less like a mess of cobbled together demo code
- [x] Support Cosmic Unicorn!
- [ ] Support other boards, or self builds?
- [x] Decouple display code so we can make it pluggable?
- [x] Add false colour to the FFT, perhaps a choice of styles from classic to rainbow
- [ ] Waterfall FFT mode possible? (Basically amplitude becomes the colour, and each FFT frame scrolls the view like a radio scanner)
- [ ] Add volume display
- [ ] Suggestions...
Long Term
- [ ] Find a catchy name for this project that suits both Galactic and Cosmic. I guess we have all of space nomenclature to pick from, but it's not super my bag.
- [ ] Investigate supporting mp3 or other audio file playback from microSD
- [ ] Investigate supporting grabbing and decoding internet radio streams- how feasible is it? Does it need PSRAM?
- [ ] Investigate more complex visualisations- polar FFT, winamp style visualisations? Run on Core1?
- [ ] Beat detection could be fun...
- [ ] Cosmic Unicorn Polar coordinate, circular FFT somehow... Jon keeps trying to make it a thing
- [ ] Album art display (potentially coming to BTStack by Summer)
Refactor progress: https://github.com/Gadgetoid/galactic-bluetooth-audio/pull/6
It needs tidying but I have some spectrogram code. Can be seen on https://www.youtube.com/watch?v=f-Ev-HK9qIc
I had a few general questions about this project:
- Are you aware of any documentation for the bluetooth audio library in pico-extras? https://github.com/raspberrypi/pico-extras/issues/28 implies there isn't much beyond the limited API docs.
- Does Pimoroni have a style guide for C++ code and APIs?
- I'm not getting certain compiler warnings that would be useful. I haven't looked at how this is all set but is it regarded as optimal at the moment?
- Why does this have its own copy of a
Displayclass and what's the relationship between it and https://github.com/pimoroni/pimoroni-pico/tree/main/libraries/galactic_unicorn / https://github.com/pimoroni/pimoroni-pico/tree/main/libraries/cosmic_unicorn ? - Any recommendations on how to debug or profile code on this Pi Pico W?
- What's (unit?) testing approach for this?
And some more specific ones:
- The code to use the second core is
#ifdefed. I haven't tried this so far, does it work well? - What's the best way to put text on the screen? I wanted to do this for some button presses?
- Why is there not a parent class for the display code that's common to unicorns?
- Does the DMA used to write to the RGB LEDs continuously run? If so, why was that chosen over triggering it when the screen needs updating?
I've got some DMA code reading the ADC. A lot of the time it fails to start-up, there's some bad interaction perhaps with Bluetooth stack or comms to the Infineon CYW43439.
https://www.youtube.com/watch?v=8Lfekls_NrU
Update: for the failure I started this discussion, Raspberry Pi Forums: DMA ADC vs Bluetooth/Wi-Fi on Pico W?.
I'm hearing a lot of audio glitching on my Cosmic Unicorn when using this program. Any ideas why this would be happening? It's very glitchy when streaming through bluetooth.
@ophello Is your 2.4GHz super busy? Perhaps try in a location where there's less Wi-Fi and Bluetooth. I've been testing with an Android tablet + mainly YouTube in browser at a range of about 60cm with no other active Bluetooth devices in the room but plenty outside.
I did some research on performance as I was curious why there was so much use of traditional C arrays. It looks like for Release builds (which are -O3) std::array and std::vector are both fine from a performance point of view. Detail in [Instructables: Benchmarking C++ Arrays on the Pi Pico.
I've covered a fair bit of the stuff in this issue in Instructables: Making a Guitar Tuner and Audio Spectrum Analyser Using the Pimoroni Galactic Unicorn. Code is in https://github.com/kevinjwalters/galactic-bluetooth-audio/tree/spectrogram-tuner-dmaadc
I don't think Cosmic will work properly at the moment (v1.4.0) but I'm sure code is easy to fix. I don't have one to test on.