HomSpace Forum

Full Version: Success with Raspberry Pi 5
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Just a quick note to say that I managed to get SamplerBox working with Raspberry Pi 5.  

I couldn't use the pre-installed version in the image file, it gave an error.

I used the python files from the github.  One or two of the dependencies were a bit finnicky, instead of installing with pip install they had to be installed with other ways (sorry to be vague, i was hoping to go through my bash history and copy paste it but it was lost).  if push comes to shove and someone gets stuck i'd be happy to try and help.

my big question is the following:  what modifications were made to the raspberry pi linux package to make it more streamlined for the samplerbox image file?  i'd like to do anything to  help with latency of course Smile

what a luxury yacht of a program, thanks so much for this!  i'm currently porting it to a vtech children's toy learning alphabet keyboard, added a rotary encoder (knob) to sweep through samples, lots of fun ideas to try out.

thanks in advance for the above question
Hi Skabadee,
You touch two todo's here Blush :  1) document the build and 2) upgrade to new raspbian version including pi5 support.

As I answered in this topic I intend to include some sort of installation log when releasing a PI5 working version of samplerbox.
I do have notes from the previous versions, but I am not sure these are complete (perhaps you know what can happen during nightly builds Cool ).

Since it will take a while before I can seriously work on the next version, I will dig up those notes and publish them with suitable warning "you may have to read this in a creative way".

Good to hear you like the box !
Hans
(13-09-25, 21:21)hansehv Wrote: [ -> ]Hi Skabadee,
You touch two todo's here Blush :  1) document the build and 2) upgrade to new raspbian version including pi5 support.

As I answered in this topic I intend to include some sort of installation log when releasing a PI5 working version of samplerbox.
I do have notes from the previous versions, but I am not sure these are complete (perhaps you know what can happen during nightly builds Cool ).

Since it will take a while before I can seriously work on the next version, I will dig up those notes and publish them with suitable warning "you may have to read this in a creative way".

Good to hear you like the box !
Hans

Aha thank you I (well we if I include the other person with a similar question) would love to see the notes, however incomplete or not they are!  Even if you couldn't find them any general ideas about how to streamline the build would be more than welcome (did you use PREEMPT_RT realtime patch or another special version of the OS?  did you delete any services?).  

Either way thanks again for an amazing program!  Love it.
Hi Skabadee,
Starting point is the standard server version of raspbian.
Indeed a lot of services are deleted.
Since it will take quite some time before I can work on the next version, I'll share the notes of the latest build in the download archive to give an idea. Next time I will use the bash history as a base... Rolleyes
Extras like the autohotspot are not in there, but can be found on the image. Since you use your own image, I can also dig that up should you need it.
Please share your findings if any.
Regards, Hans

DocDecibel

(24-08-25, 11:18)skabadee Wrote: [ -> ]Hi all,

Just a quick note to say that I managed to get SamplerBox working with Raspberry Pi 5.  

I couldn't use the pre-installed version in the image file, it gave an error.

I used the python files from the github.  One or two of the dependencies were a bit finnicky, instead of installing with pip install they had to be installed with other ways (sorry to be vague, i was hoping to go through my bash history and copy paste it but it was lost).  if push comes to shove and someone gets stuck i'd be happy to try and help.

my big question is the following:  what modifications were made to the raspberry pi linux package to make it more streamlined for the samplerbox image file?  i'd like to do anything to  help with latency of course Smile

what a luxury yacht of a program, thanks so much for this!  i'm currently porting it to a vtech children's toy learning alphabet keyboard, added a rotary encoder (knob) to sweep through samples, lots of fun ideas to try out.

thanks in advance for the above question

Hi skabadee,
I'm more a musician than a programmer, and I cannot manage to make SmaplerBox work on my Pi 5. Did you finally have time to document (event by quick notes) what you did to make it work ? I would very much appreciate this help ... I'm stuck !
Thanks in advance.
hi docdecibel,

sorry for the slow reply, my life is a bit chaos right now.

i didn't take super super detailed notes when i installed it, although i did write this:

----
some errors in dependenfcies.. the sequencer one i think was called pymidi or something, i installed it by hand (using i think pip install git+ giturl) then watch for errors, it was missing a dependency)
----

i think this was the biggest roadblock, like i said above, it's not good enough to do pip install pymidi (or whatever is the one not installing properly), try different methods to install and keep a keen eye out for errors when it installs (other dependencies needed?)

if you have specific problems please post them here and it would jog my memory more.  i'm attaching here a requirements.txt of "my" project (the successful rpi5 install of samplerbox), maybe have a look through that and it might help as well, maybe worst case if you systematically install those packages it will work?  my intuition is that you should try the "pymidi" idea above first though.

like i said, post here any problems, i'll take a look if i can help

here's the requirements.txt for my install:
Code:
beautifulsoup4==4.13.4
certifi==2025.8.3
cffi==1.17.1
charset-normalizer==3.4.3
Cython==3.1.2
filelock==3.18.0
idna==3.10
lgpio==0.2.2.0
markdown-it-py==3.0.0
mdurl==0.1.2
midi==0.2.3
numpy==2.3.2
psutil==7.0.0
pyalsaaudio==0.11.0
PyAudio==0.2.14
pycparser==2.22
Pygments==2.19.2
pyserial==3.5
PySocks==1.7.1
requests==2.32.4
rich==14.1.0
rpi-lgpio==0.6
rtmidi-python==0.2.3
rtmidi2==1.4.0
smbus==1.1.post2
sounddevice==0.5.2
soupsieve==2.7
swig==4.3.1
tqdm==4.67.1
typing_extensions==4.14.1
UNKNOWN==0.0.0
urllib3==2.5.0
Hi Skabadee & Docdecibel,
A little clarification is missing here (my bad).
For both rtmidi and python-midi you should use the adapted versions under my GitHub account:
  • python-midi, this one has a (now stale) branch, but this is to keep the python2.7 version.
    The builtin sequencer of samplerbox will not work if you use the original.
  • rtmidi2, don't use the master branch, but the (now a stale) python3 branch. However it's the one having the needed adaptations. For some reason I never merged this in the master branch.
Just copy them down in your home directory and run setup..
Above is not mentioned in the notes in the download archive archive as mentioned above ...
Hans
ah great thanks for the info!  was just about to mess around with the sequencer part so that will be useful.

feel free to ignore this question if you're too busy to get into it, but was wondering if you used RT-kernel with your image file?  or if you disabled certain services to get faster latency?  i was wondering what the low-hanging fruit are (if any) to reduce latency when compiling our own image files.

once again i wanted to say thanks so much for this program, all your little notes for the future users (like how to recompile the parts written in C) make the difference between something unknowable to less experienced programmers (i would proabably just have modified things, not noticed any difference in how the program works, and given up).  so thanks for all those notes and little explanations!

on my end, i'm slowly working towards a project that is a sampler that is focused on live manipulation of breakbeats and other samples - things like controlling sample offsets live (start points), have a function to spread loopbeats over multiple input buttons so you can trigger different parts, some buttons that directly control live effects, a knob that controls different things (like offset of the sample to sweep through samples), and it all works on a slightly modified childrens toy (vtech alphabet desk).  it's coming along nicely i think, slowly figuring out what makes fun/experimental live ways to muck with a sample.   been trying to figure out how to make tape-style delay (where you can pitch up or down the delay).   just thought i'd tell you all about it since it's been very enjoyable for me and of course it all rests on the back of all your work, and the people who made the previous versions of samplerbox.
hey yall,

so i installed samplerbox on a fresh install of raspberry pi 5 (using RT-PREEMPT version for extra low latency).

i kept what i think are good notes about how to install it from A to Z, and in the process had to modify a few things. put all my notes and updated files here:

https://github.com/boboliiii/samplerboxrpi5

please if you end up doing it, keep track of any issues along the way (or not!) so we can make the notes more solid.
Many thanks Skabadee,
I'll certainly use your findings if I finally get opportunity pick up this project again.

The SequencerWrite indeed exists & works in the original version. If you don't use the smfplayer (which is a quite niche thing indeed) it doesn't matter.

sounds.py: looks OK to me and if your samplerbox does work as expected (= sustain/loop sounds when holding down the key - which is controlled by the changed code), the ChatGPT also did some nice work by formatting this old code into a more readable version  Cool

rtmidi.pyx: one serious change there, this will need testing. But if it works, also in improvement in readability..

But I'm happy that the critical/complex pieces of code survived the upgrade. The python2.7 => python3 conversion (needed for PI4) came with more serious headaches  Dodgy

Thanks again, Hans