Nimbo77 posted Jan 23, 13:52:
Are you having trouble setting up the serial MIDI on your Pi3 or Zero? So did I!
I finally got it working on my Pi Zero by following the guide by tronix at: https://openenergymonitor.org/emon/node/12412
TLDR for newbs like me: The way the pins work, that you connect your MIDI to, have changed in Pi3/Zero.
As far as I can tell, you MUST follow the steps for this to work on those boards.
Note that for Pi Zero, these lines are NOT neccessary (and won't work, because the Zero doesn't have onboard Bluetooth):
sudo systemctl disable hciuart
sudo nano /lib/systemd/system/hciuart.service
change the first ttyAMA0 in ttyS0
Nimbo77 posted Jan 23, 13:55:
Note: I see my wording might be misleading (wish you could edit posts here).
To clarify, those three last lines of instructions are only part of the guide. Go read the guide!
Cuki posted Jan 26, 13:03:
I did not understand if it did work for Pi3?
Nimbo77 posted Jan 27, 20:26:
While I haven't tried it on a Pi3 myself, it is supposed to work for Pi3.
Just follow all the steps in https://openenergymonitor.org/emon/node/12412. It's worth a try if your stuck!
Gabor Kita posted Feb 9, 17:35:
Hi, I'm Gabor from Hungary.
My experiences with Pi3 and serial midi (similar to Nimbo77's solution):
The first problem was that (RPI3): Serial port not working. Some searches on google said, the bluetooth is using the uart, so need to disabled bluetooth.
In the /boot/config.txt:
reboot, then uart start to work, but only 38400 bit/s, not 31250. (I build an easy tester with arduino, and on RPI run an easy python script, which is print the received bytes)
It is not enough:
The uart is still working only 38400 baud.
Need an other line in the /boot/config.txt:
Reboot, and wow, uart is working 31250 baud, and the samplerbox have sound, when I play on the midi keyboard :) (Not with usb-midi, but raspberry's physical uart with optocoupler, like this: http://samplerbox.org/makeitelectronic)
In summary, my /boot/cmdline.txt:
root=/dev/mmcblk0p2 ro rootwait console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 elevator=noop bcm2708.uart_clock=3000000
and my /boot/config.txt:
Gabor Kita posted Feb 9, 17:38:
Sorry, don't need the last 5 line
Gabor Kita posted Feb 9, 17:45:
Some other 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
mount /dev/mmcblk0p1 /boot
mount -o remount,rw /dev/mmcblk0p2 /
- I use usb audio, but not working.
and write into 2 lines:
(and into samplerbox.py: AUDIO_DEVICE_ID = 2)
- when I played with piano preset, the octave was shifted.
midinote = note + 12
- I experimented with buffer (to lower latency)
It seems to lower:
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 someone have any idea, please write. Thanks.
Pavel posted Feb 10, 06:38:
I've noticed the same too. Have you tried to measure delay between a midi message and sound starting to play in SB code?
Perhaps its not a kernel problem but rather an application issue (i.e. inserting a playing note in array), in which case can be optimised.
Cuki posted Feb 10, 22:51:
it works for me