josephernest / SamplerBox

SamplerBox is a sampler musical instrument based on RaspberryPi.
https://www.samplerbox.org
429 stars 97 forks source link

Some experience - r/w remount problem, usb audio, octave shifted, latency #25

Closed gkita closed 2 years ago

gkita commented 7 years ago

Some experience:

-sometimes I cant remounted r/w the file system (when I modified files on sd card, with an other pc) : mount -o remount,rw / mount -> can't find / in /etc/fstab

solution:

mount /dev/mmcblk0p1 /boot mount -o remount,rw /dev/mmcblk0p2 /

Solution:

touch /etc/asound.conf and write into 2 lines:

defaults.pcm.card 1 defaults.ctl.card 1

(and into samplerbox.py: AUDIO_DEVICE_ID = 2)

def MidiCallback..:

midinote = note + 12

in the open audio section (try-except): blocksize=0 (instead of 512, 128, 32 etc)

But there is still a lot of latency. I think 20-30 ms. Especially when I played piano preset. It has fast attack, and I feel the latency, and it disturb me a bit. Whit the slow attack preset (like slow string, chello etc) it isn't annoying.

Have someone ever try any real-time kernel, or very small and easy raspbian image for faster system? If you have any idea, please write. Thanks.

josephernest commented 2 years ago

Thanks for this feedback and these tips @gkita!

Yes the "octave shifted" issue is linked to a choice I made in 2015, see https://github.com/josephernest/SamplerBox/pull/1#issuecomment-111742090 there are different conventions midinote 60 = C3, midinote 60 = C4, etc. I should probably have made another choice :) Now we could change this in the code, but I'm not sure how it would affect people who have configured all their programs with this convention... You can discuss it here: https://github.com/josephernest/SamplerBox/pull/1.

PS: Good idea for real-time kernel, I don't know if someone has tested (I might have tried years ago but I don't remember the results). Oh in fact I think Martin Husovsky tested this: https://www.youtube.com/watch?v=u965qqNJqQM you can ask him (you can easily find his contact details), and tell us if you found a way to make a realtime kernel work with SamplerBox :)