Skip to content

Commit b6a1c1a

Browse files
committed
Handling of /boot/firmware
Added Python Mido examples in the package
1 parent c18e3b2 commit b6a1c1a

5 files changed

Lines changed: 20 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ client 128: 'MIDI' [type=user,pid=1271]
2323

2424
## Still cannot receive and send MIDI messages on your Raspberry PI?
2525

26-
This ttymidi-rpi package takes care of adding the right lines to cmdline.txt and config.txt, but in doubt, please check the content of the files.
26+
This ttymidi-rpi package takes care of adding the right lines to cmdline.txt and config.txt, but in doubt, please check the content of the files. On latest Debian releases, the files are in /boot/firmware/, not in /boot/.
2727

28-
* /boot/cmdline.txt: should not have any `console=serialx` or `console=ttySx` keywords
29-
* /boot/config.txt: should contain `dtoverlay=midi-uart0` and `dtoverlay=miniuart-bt`
28+
* /boot/firmware/cmdline.txt: should not have any `console=serialx` or `console=ttySx` keywords
29+
* /boot/firmware/config.txt: should contain `dtoverlay=midi-uart0` and `dtoverlay=miniuart-bt`
3030

31-
In recent Debian versions (>= 12), it seems that the `'enable_uart=1'` option does more harm than good. I advise you to delete `enable_uart=1` in /boot/config.txt, and keep the two `dtoverlay` lines.
31+
In recent Debian versions (>= 12), it seems that the `'enable_uart=1'` option does more harm than good. I advise you to delete `enable_uart=1` in /boot/config.txt, and keep the two `dtoverlay` lines, at least on RPI Zero (Ok on RPI 4B).
3232

3333
For MIDI scripting I recommend using [Python MIDO](https://mido.readthedocs.io/en/stable/) which is packaged for Debian.
3434

debian/changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
ttymidi (0.20240907) experimental; urgency=medium
2+
3+
* Added example MIDO Python scripts
4+
* Handle boot files in /boot/firmware
5+
* Recommends: python3-rtmidi and python3-mido to run the examples
6+
7+
-- Ludovic Drolez <ldrolez@debian.org> Sat, 07 Sep 2024 12:00:25 +0000
8+
19
ttymidi (0.20231106) experimental; urgency=medium
210

311
* changed the defaults for the Raspberry

debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Rules-Requires-Root: no
1010
Package: ttymidi-rpi
1111
Architecture: any
1212
Depends: ${shlibs:Depends}, ${misc:Depends}
13+
Recommends: python3-mido, python3-rtmidi
1314
Description: Raspberry serial MIDI shield support for Alsa
1415
If you have a serial MIDI shield for your Raspberry PI
1516
this package will configure the ttymidi daemon to link

debian/ttymidi-rpi.docs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
README.md
22
debian/README.Debian
33
debian/README.source
4+
examples

debian/ttymidi-rpi.postinst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ set -e
2121
case "$1" in
2222
configure)
2323
#if dpkg --compare-versions "${2}" lt "20160321"; then
24+
BOOT=/boot
25+
if [ -f /boot/firmware/config.txt ]; then
26+
BOOT=/boot/firmware
27+
fi
2428
echo "Adjusting cmdline.txt..."
25-
sed -e "s|console=serial[0-9][^ ]*||;s|console=ttyS[0-9][^ ]*||;" -i /boot/cmdline.txt || echo "Failed"
29+
sed -e "s|console=serial[0-9][^ ]*||;s|console=ttyS[0-9][^ ]*||;" -i $BOOT/cmdline.txt || echo "Failed"
2630
echo "Adjusting config.txt..."
27-
CONFIG=/boot/config.txt
31+
CONFIG=$BOOT/config.txt
2832
raspi-config nonint set_config_var enable_uart 1 $CONFIG
2933
if ! grep -q '^dtoverlay=midi-uart0' $CONFIG ; then
3034
sed $CONFIG -i -e 's/\[all\]/\[all\]\ndtoverlay=midi-uart0/'

0 commit comments

Comments
 (0)