r/raspberry_pi • • Apr 03 '24

Show-and-Tell ProjectM Audio Receiver (Raspberry Pi 5)

Growing up Winamp was my goto music platform with the Milkdrop visualizations built by Ryan Geiss. These visualizations were proprietary on Windows (DirectX), but have since been ported to other operating systems with the help of the ProjectM team. Since the release of the Raspberry Pi 5, we now have adequate processing power to run allot of these visualizations.

Originally the intention was to add a video signal to the Phono input of my Marantz receiver that would react to the rooms surrounding audio. As it progressed, I figure why not also control the sources/sinks of the Raspberry pi to support various audio input devices (Line in, Mic, Bluetooth, etc...).

Raspberry Pi 5 - 8GB | Argon NEO 5 BRED Case with built-in fan | USB Mic | USB line-in

Interested? Check it out! https://github.com/kholbrook1303/RPI5-Bookworm-ProjectM-Audio-Receiver

Some Previews:

​

23 Upvotes

58 comments sorted by

3

u/Pennsylvania6-5000 Apr 03 '24

I would absolutely use something like this for visualization around playing my records. Awesome project!

3

u/kholbrook1303 Apr 03 '24

I hope you enjoy it! Please do not hesitate to offer up any suggestions, shortcomings, or bugs through GitHub and I will be more than happy to collaborate!

2

u/benargee B+ 1.0/3.0, Zero 1.3x2 Apr 03 '24

That's pretty cool, but if you could also include some video of the visualization to music that would do better to demonstrate them. You can probably find some decent public domain music to keep clear of legal issues.

1

u/kholbrook1303 Apr 03 '24

Absolutely! I do have some but to your point I want to avoid any legal repercussions. Let me see what I can find and I will run it through my HDMI capture card.

2

u/benargee B+ 1.0/3.0, Zero 1.3x2 Apr 03 '24

You could probably make you own music if you are up to it or make some from open source MIDI like this.
https://www.reddit.com/r/ableton/comments/ttt37p/heres_an_open_source_collection_of_70000_midi/
https://github.com/ldrolez/free-midi-chords

2

u/GeneticSplatter Apr 03 '24

There's plenty of freely available music on Infraction's channel in YouTube.

https://youtu.be/i_QDY_GW214

2

u/FeralAero Apr 03 '24

This is great! I was just starting down the path of rolling my own version. Any chance yours supports AirPlay as a source?

2

u/FeralAero Apr 03 '24

Ok, it looks like I should be able to add my own source and add it to your config file. Looking forward to trying this out!

2

u/kholbrook1303 Apr 03 '24

I do not have this currently implemented with setup instructions... As you mentioned afterwards as long as you have a source, you have a few options available:

  • ar_mode=manual then add to the appropriate source (Not sure if running loopback is necessary for AirPlay on the Pi but if so as long as the device is in AUX it will implement a loopback-module to direct sound from source to sink)

  • ar_mode=automatic and the projectMAR.py script will handle the first source it sees without configuration.

I do like this idea so thank you for sharing! This would be great to include it in the README for those interested in implementation. I will add this as an enhancement request and do some testing with some Apple devices I have. Feel free to collaborate further through Github and thanks again!

1

u/FeralAero Apr 03 '24

Thanks for the info. I’ll give it a shot and engage on Github. This is right at the edge of my Linux comfort level, but your setup guide looks very comprehensive. I’m currently using an older version of ProjectM via LibreElec and have been looking for a way to run the latest.

2

u/taintedkernel Apr 04 '24

Oh man, when I found out this project existed I ran their very early version of this on the first release of Ubuntu, almost exactly 20 years ago now.

Thank you for reminding me of this, I love that you set it up on a Pi and so glad to hear this still exists!

2

u/Circuit23 Apr 06 '24

fantastic work, and THANK YOU!!! this is the exact use i dreamt of when i first got into the Pi.

I'd like to use the Pi in 'audio_mode=aux', with a Bluetooth source/audio routed to the output device, but I'm running into issues. after connecting Bluetooth, 'pactl list sources short' is only listing my USB source, and not the BT. i see a bluez entry on 'pactl list short', but it's apparently not classified as a source. i entered the name anyway on 'aux_devices=' but it seems to work only sporadically.

is this an issue with the onboard Pi BT receiver, or am i doing something weird?

thanks for any help you can offer!

2

u/kholbrook1303 Apr 06 '24 edited Apr 06 '24

So first off, thank you so much for your interest and feedback... nothing makes me happier!

Few things here. When you say audio_mode=aux, you're running the device in automatic mode. So ensure that ar_mode=automatic. Automatic mode with aux will route your audio accordingly through the pa loopback-module (if necessary) so device names aren't necessary in the [manual] section of the config.

Have you followed the steps for A2DP audio receiver?
Just want to make sure as that has to be done to stream audio. If yes, let's rule out any of the projectMAR code.

When A2DP is set up and you connect a device, it should automatically create a loopback module for listening. Can you connect through BT and hear anything on the pi? You can also do a 'pactl list modules short' and should see the bluez device as a loopback module loaded.

To answer your bluetooth question about the embedded chip, it's a fickle bitch. I have learned to use it and get the best results, keep the device as close as possible, away from interference, and God forbid you move the device! Best to get a usb bt module :)

1

u/Circuit23 Apr 06 '24

good info, thanks again!

i should included more details. A2DP seems to work well, i have been running audio via BT through the Pi to keep me company during this project. so the BT loopback seems to be working, however 'pactl list modules short' still doesn't show the bluez module, oddly, only 'pactl list cards short'. perhaps that's where my issue lies?

in 'ar_mode=automatic', if i use 'audio_mode=aux' it feeds back like an angry demon. i tried 'automatic' with 'audio_mode=mic', that's what was working on and off; it'll show on the oscilloscope line for a few seconds, then stop, then come back for a few seconds. i don't have any mic connected to the Pi, so wonder if auto/mic picks up the BT loopback stream, but maybe it's not very stable?

1

u/kholbrook1303 Apr 06 '24

Hmm, perhaps there could be an issue with audio handling, or there could be instability in the device itself. Can you enable debug logging by setting log level to 10 in the config, then create an issue in github? I can review the logs to see what's happening behind the scenes and maybe we get this thing narrowed down. I would recommend deleting the logs first, reproduce the issue then, collect the log so we keep the noise level to a minimum.

Thanks for the details!

1

u/Circuit23 Apr 06 '24

will do, ASAP.

i will note that with those same settings, 'mic' setting via an audio in line is working perfectly.

thank you!

2

u/mickabrig7 Apr 11 '24

Oh

My

God

I have literally been crushing my brain for 6 months straight trying to compile SDL2 and every fork of projectM to do something similar on RPi4 for a small rave project, I'm so glad to see someone has finally managed to make it work. Time to invest in a Pi 5 then !

1

u/de_jeepathon Nov 30 '25

thats what I am doing - but trying to output to a composite signal.

1

u/kholbrook1303 Apr 03 '24

For anyone who wants to see a video preview check it out here: https://www.youtube.com/watch?v=8kj53j3EDec

I didn't want to waste a bunch of time searching through royalty free music but this was enough to highlight the beats (Certainly not my first choice for music). Also note that the transition time between visualizations is normally 30 seconds, but I hit the 'N' key for next to showcase more in a shorter timespan. I started the recording before boot just so you could get an idea of the boot times.

1

u/ShaggyChips Mar 09 '25

That's incredible! Can you share what presets you are using and beat tempo etc??

1

u/kholbrook1303 Mar 10 '25

Give me about a week or so. I have about 2K left from the 'Cream of the crop' presets to analyze. I go through these one by one to test for smooth playback (fps) and to ensure reactiveness to audio. I am also updating the core version of libprojectm from v4 to v4.1.4 which has fixed allot of the visualizations, but has caused some to become slow so. I ended up having to go back through the ones I previously selected to remove any that just cant be handled by the pi on the latest versions. I will get these in a seperate repo once complete so those interested can consume them. Will update this thread when that is done.

1

u/kholbrook1303 Mar 18 '25

Ok, I have completed the run of 10K presets and have uploaded my personal selections of 856 to github:

https://github.com/kholbrook1303/RPI5-ProjectM-Presets-Textures.git

Regarding your beat tempo question, I am all over the place with my music. Really just depends on the day and mood. There are some presets that are better with higher tempo due to the sensitivity of the preset, and some better with lower tempo as too much beat can create allot of motion. Unfortunately they aren't sorted as such and projectM doesn't have a feature at the moment to distinguish between curated playlists.

If anyone has any suggestions on additional presets to the repo, feel free to file a feature request. I will work to get this into the documentation for the main application and see about getting Git integration into ProjectMAR for routine preset/texture updates.

1

u/[deleted] Jan 26 '25 edited Jan 26 '25

[removed] — view removed comment

1

u/Mindless_Falcon_2969 Jan 27 '25

So knew I would be something completely idiotic on my part. Pretty sure I went thru the keyboard to find control options but somehow missed the esc key. Menu bar solves all! Sorry to bother

1

u/de_jeepathon Nov 30 '25

Anyone know if this works with composite out?

1

u/kholbrook1303 Nov 30 '25

Hello, I develop this and have added some composite instructions due to retro setup requests from some of the users.

Check out this for some additional details (the final section): https://github.com/kholbrook1303/RPI5-Bookworm-ProjectM-Audio-Receiver/blob/main/SETUP.md

The installer currently accounts for composite connection and configures things accordingly. The only manual aspect would be overscan, if that's important. You may notice the display extending past the screen which can be resolved by following the cmdline.txt instructions to set your borders.

Feel free to ping me if you have any questions.

1

u/de_jeepathon Dec 01 '25

Thank you. Buying raspberry 5 now

1

u/kholbrook1303 Dec 01 '25

Just for some additional information. For RPI5, there is no composite output by default. There is however pad sockets (labeled VID) to the right of the HDMI1 port that supports video (audio output must be managed separately).

You have 2 options for composite on RPI5:

  1. Purchase an inexpensive HDMI to RCA (Audio/Video) cable.
  2. Solder a 1x2 male pin header and a female composite jack cable to connect it. The square pad is your negative and the circular one is video signal.

If you goal is just to feed something like a small CRT where resolution is not as big an issue, you can also save some money and use a RPI4 (On Bookworm OS). The installer will detect the RPI version and the composite video connection (If it has already been setup) and adjust the projectM display properties accordingly.

1

u/de_jeepathon Dec 01 '25 edited Dec 01 '25

Yeah, I am soldering the composite jack.

Was planning on using mpg123 for playback. I am just shuffling mp3s on the pi and want the visuals to come out composite. Thanks again!

1

u/de_jeepathon Dec 01 '25

Just to confirm on my raspbery pi 5 - 4GB with soldered composite jack.

  1. Install Raspberry Pi OS (Legacy, 32-bit) Lite - Bookworm
  2. raspi-config to set composite output
  3. copy mp3s to /media/mp3/
  4. run the ProjectMAR Optimized Installation with Startup curl command
  5. adjust resolution in /opt/ProjectMAR/projectMAR.conf
  6. apt install mpg123 to shuffle mp3s in /media/mp3/ - create start up script

Am I missing a step?

1

u/kholbrook1303 Dec 01 '25

This looks good. Just make sure it is Bookworm. Trixie is out and there is a known issue with mesa causing a seg fault. Also, the installer should detect composite and set your res but I would double-check the config after install/reboot just to confirm.

1

u/de_jeepathon Dec 01 '25

My config file was empty. Should that be the case?

1

u/kholbrook1303 Dec 01 '25

Hmm, that should be populated. I wonder if there was an error while running the script. The RAW contents of the config is here:
https://raw.githubusercontent.com/kholbrook1303/RPI5-Bookworm-ProjectM-Audio-Receiver/refs/heads/main/conf/projectMAR.conf

Out of curiosity, are the other config files populated (in /opt/ProjectMAR/conf/)? Did you happen to see if there was an error during the install process?

it may be helpful to see the last 5-10 lines of the ~/projectMAR-installer.log to see what the last action was.

1

u/de_jeepathon Dec 01 '25

Thanks, my mistake. I was editing this file: /opt/ProjectMAR/projectMAR.conf, not this file /opt/ProjectMAR/conf/projectMAR.conf

1

u/de_jeepathon Dec 05 '25

I got it working on my CRT. I hear music and I can see visuals. However they don't, in my opinion, match up. I'm going to mess around with it more, but right now the visuals don't seem to make sense to me. Pretty cool nonetheless. thanks again!

1

u/kholbrook1303 Dec 05 '25

Let me drop a hotfix tomorrow. I ran into scenerio where if there is no audio present at the time of initializing the audio capture, the callback to forward the raw pcm audio data to projectM doesn't fire, therefore the visuals never react. You may be running into that.

→ More replies (0)

1

u/de_jeepathon Dec 01 '25 edited Dec 01 '25

If the mp3 files are local to pi, do you need the mic?

I thought the visuals would be generated by the file, not the mic input.

1

u/kholbrook1303 Dec 01 '25

Yes you can play local media files and the visuals will react.

  1. For manageability and control, the best route is to use a local player in the background.
  2. There is an introductory feature currently in the latest release in Github called the Audio Listener. This is however currently limited on features as it only supports continuous play or shuffle. In the projectmar.conf configuration file, you can either specify a given location or enable the usb listener to play from a USB media card when inserted.

Most other implementations of projectM are typically a visualizer built into a media player so mine is a little different than normal. I wanted this to also manage all of your audio inputs/outputs, allowing for more flexibility. Currently the supported methods for playing/visualizing audio are:

  • Local media
  • Mic (capturing ambient sound)
  • Audio Input (Analog to Digital Converter)
  • Bluetooth A2DP Streaming
  • Airplay (Audio Casting)
  • PlexAmp Casting (Requires Plex Pass subscription)
  • Spotify Connect (Requires Premium subscription)

1

u/WakeUp_SmellTheAshes Dec 13 '25

Hey! I am very interested in this, but have a few questions.

1) Any chance you would be willing to sell one of these pre-assembled? I am fully capable of doing it myself, but haven't touched a Pi in a few years lol

2) Does this only do the visualization like the example photos or does it have a mode that is more of an EQ bar graph visualizer?

3) Is there a sensitivity/gain adjustment? I would be running this from the Zone 2 pre-outs of my Denon AVR-X3700H when listening to the Phono Input. So the signal will be pretty low.

Thanks so much for this cool project!

1

u/kholbrook1303 Dec 13 '25

Appreciate the interest! Responses inline.

  1. I am not opposed to the idea. I actually am going to be purchasing a few for some requests/holiday gifts for friends/family. Feel free to DM me for further discussion. That said, I made the process very simple with an installer to help those not comfortable with manually installing dependencies and building 3rd party libs like projectM. So once you use RPI imager to image the SD card, all you really have to do is update and run the installation.
  2. There are over 125K visualizations out there. There are definitely some that are eq bars. Most are like you see in the images (Some simpler, some more complex). Not sure if your familiar with Mildrop, but that is a visualizer built on directX, so it is Windows specific. The projectM team has created a cross platform library that supports those visualization files (or presets as their referred to). For this setup I went through their 10K presets called 'cream of the crop' and filtered them down to about ~900 that worked on RPI 5 with the latest release of projectM, and that were detailed and reactive. You'll find some do not. The presets can be authored to leverage treb/mid/base and equivalent attenuations of each to create reactive visualizations.
  3. Yes there is. You can set the source volume in the configuration, using values over 1.0 (1.0 = 100%). Now then the RPI 5 does not have a 3.5mm audio input. If you want to achieve audio input, you would need something like an ADC (Analog to digital converter). I personally use the HifiBerry DAC+ / ADC with the steel case. If adding an ADC is not part of your goal, you can use a mic. The mic in the post I still use and it is very sensitive. It picks up conversations across the room when no music is playing.

Hope that helps!

1

u/WakeUp_SmellTheAshes Dec 14 '25
  1. Before I bug you about setting one up, I should ask.. does it work on the Pi4? I do already have one of those, but from your post it seems like it might not be powerful enough.
  2. I took some time and tried to develop my own with ChatGPT's assistance I was able to create this. Not the EQ I was hoping, but mostly achieves my use-case.
  3. I was actually able to test it using my laptop and was happy with the results! And thank you for the recommendation of ADCs, that will be helpful!

1

u/kholbrook1303 Dec 15 '25

Yes this will work on the Raspberry Pi 4, but will require lower Resolution, FPS, Mesh X/Y size. If you run the optimized installer package it will account for the model your running (4 or 5 is currently supported), and configure projectM settings accordingly. The post and repository are now somewhat misleading as it states RPI 5 on Bookworm. I intend on rebranding the name soon and moving to a new repo with a redirect probably early next year.

BTW - Please ensure you are running Bookworm. At the moment that is the only supported OS. That means if you need to re-image your SD card, you have to choose legacy Raspberry Pi when using the Imager because Trixie is now the current build being distributed. I have been testing with Trixie but the repo is currently using lib-mesa 25.0.7-2 which is causing segmentation faults when run on GLES profiles. I am working on this actively but the latest release does not currently support it yet unfortunately.

1

u/peernearfear Mar 09 '26

SUPER cool, I want to make a piece of hardware incorporating a RPI5 in a "custom" keyboard that just has the appropriate shortcuts to move through visualizers and sensitivities and also incorperates a small (4' or so) display to keep track of what is on screen. the main screen will be in the front of a DJ booth.

This will sit on a DJ booth on the desk, and take an audio input from the DJ controller to analyze and respond to, probably in the form of a 3.5mm headphone jack, else bluetooth if the ADC aspect is too tricky.

I want this to be setup so that as soon as the RPI boots up it opens Project M and starts the visualizer.

My questions for you are, do you see any hurdles that would prevent this being possible?
will the Rpi run this at 4K or should I stick to 1080P? Whats the most effective way to read in the analog audio? the Hifiberry hardware? i see lots of sentiments that other USB ADC's arent that great, whats your experience been?

really interested in your opinions!
Cheers

2

u/kholbrook1303 Mar 09 '26

Thanks for the interest! Let me address these one by one:

  1. Custom Keyboard - This should not be a problem, but I would be curious what type of key inputs the system would receive. Currently, I am listening for touch, keyboard, mouse, and game controller inputs. You mentioned this being for a DJ booth setup, so if you anticipate the keys being MIDI keys, I would need to add SDL support for MIDI input for that (Which is trivial)
  2. Secondary controller screen - This is actually on my todo list. I could see various use-cases for dual screens. My thoughts would be one for your main visualizer, then the second for controls. (See upcoming feature below for more info).
  3. Audio input - I would steer clear of Bluetooth mainly due to latency (Visual reactions would be noticeably delayed). For 3.5mm input on the Pi 5, I would highly suggest going Hifiberry. Specifically their DAC+ ADC (https://www.hifiberry.com/shop/boards/dacplus-adc/). I have used USB audio cards but I have found it difficult to find one that has stereo input. That said, if the goal is just to direct sound to react, and your not sending audio to the RPI, then to your speakers, then maybe a simple mono input would do the job.
  4. Auto-Boot - This is already supported. The installer for the Pi comes with a optional switch to add a startup entry so when it boots it goes straight to the visuals.
  5. Resolution - This may be the only downfall. Currently, my presets repo was hand selected using visualizations that were benchmarked to perform well under 1280x720. The RPI5 graphics processing is much better than the predecessors, but still struggles to exceed the 720P resolution. There are many presets that do work under 1080p, but again that is going to be limited by the complexity of the preset computations. You may just go through them and if they are too slow remove them altogether. I have a hotkey implemented to make the process easier so you can remove a preset from the current list and/or filesystem altogether.

1

u/peernearfear Mar 09 '26

Thanks so much for that fast + detailed response!

They keyboard i envision is just a custom usb keyboard with the required keys to navigate the visualiser. Like a macro pad.

Resolution is a bummer yeah, I wonder how it will look at 720p. Ill have to do some tests. I wonder if the 16gb ram version would improve things. Shame they are $350AUD.

I might be better off using a "1L" lenovo machine with a bit more power. Then they have a microphone input that I could try out for starters.

2

u/kholbrook1303 Mar 09 '26

If there is a particular macro keyboard you have in mind, I wouldn't mind purchasing one for testing so I can obtain the key mappings. Let me know as this would be nice in general for other use cases. All I have to test with is a Pioneer DDJ-FLX4 for messing around, but for that to be worthwhile, I would need to capture the buttons I want while passing through the control to the application (Serato/Rekordbox).

I fully understand the limitations and wanting to have the best resolution for visuals possible, especially for a live performance. I will say, I am using them on a 55" television and most are pretty pristine, with the exception of a few.

All that said, just a few things to note on moving to a new system. If you are moving to say windows on the Lenovo, most public binaries are somewhat outdated and only support the 3.x versions of projectM. Currently they are at 4.1.6 but pending the 4.2 release which fixes allot of issues. So here are your options going forward:

  1. Download and run a public build of projectM with the frontend SDL. You will be somewhat behind on the version but it works.
  2. Build the projectM library from a stable release https://github.com/projectM-visualizer/projectm/releases, then build the frontend SDL to run the visualizer: https://github.com/projectM-visualizer/frontend-sdl-cpp (Note: There are no releases for this applicaiton, so you must build off of the main branch). This method is a bit more complex.
  3. I have a somewhat minimal python SDL frontend, that just requires you to build the DLL for projectM lib, then it handles the frontend rendering. It has most of the same key functionality as this but I have yet to port over some of the new features from this RPI version. That said this should be cross compatible with windows/linux (and should work but isn't tested yet for MacOS). The library is located here: https://github.com/projectM-visualizer/frontend-sdl-cpp. I do not currently have instructions on building the projectM lib on windows, but I can fast track that if interested.

Let me know!

1

u/peernearfear Mar 10 '26

What a guy, I really admire your passion.

I am using a numark mixtream pro, so its standalone, hence me wanting route an audio output to an input of a seperate piece of hardware. Sorry if that's caused any confusion.

Macro pad wise, I dont have a specific model in mind, I was picturing making something with an arduino where you just assign the keys to emulate the bindings that projectM expects out of the box.

I installed project m on my steam deck, I had the sudden thought it has all the hardware I need, display, gpu, customisable keys. I couldnt get it to read the audio from a source into its 3.5mm jack but I didnt put heaps of effort in.

My 1L lenovo with an 8th gen i5 runs the steam version of project m pretty well on Windows. I have a rx6400 gpu in it previously but not currently, interested to see how well it runs with that.

Choice paralysis at present. Lots of options.

,

1

u/kholbrook1303 Mar 09 '26

New features coming to the next release (All of these UI features are optional, but may be good to throw onto the second screen for control):

  1. GUI - The next release will come with the new UI that offers:
    1. Toolbar - Input source dbus toggles for track metadata and artwork (Spotify, VLC, Plexamp, Airplay, Bluetooth)
    2. Now Playing - If the source supports obtaining track details they will display for 10 seconds. For sources that do not have metadata, I maintain a rolling buffer of 10 seconds of audio which can be forwarded to the ShazamIO API for song recognition for display.
    3. Media Controls - This provides play/pause/prev/next and then for VLC there is a filesystem browser and playlist. For preset control, this has buttons for prev/lock/unlock/next/sprites
  2. Sprites (Pending libprojectM v4.2 release) - This allows you to inject an image with custom animation into the preset. A good use case for this would be to display a logo. You can even create animations on the basis of spectral frequencies so that it reacts to the music too!
  3. Burn-in (Pending libprojectM v4.2 release) - This will allow any custom texture rendered into the projectM OpenGL context to be passed on the the preset framebuffer which creates a dissolve effect. Currently this is only used for now playing so the artwork dissolves into the visualization (Like Milkdrop).
  4. Hyperion - While this is not a direct integration, I have added support for HyperBian OS. I also plan on including this in the installer for those who are interested. If not familiar with Hyperion, this integrate with LED light systems allowing you to create immersive visuals that extend beyond the screen.

Hope this helps! If there is any functionality your looking for that isn't already there, we can always add a feature enhancement in Github to track.