Skip to content

Instantly share code, notes, and snippets.

@ivangabriele
Last active June 15, 2024 21:23
Show Gist options
  • Save ivangabriele/70902b27ecee8f88a3e30b26e2984cc8 to your computer and use it in GitHub Desktop.
Save ivangabriele/70902b27ecee8f88a3e30b26e2984cc8 to your computer and use it in GitHub Desktop.
Debian Raspberry Audio, Bluetooth and MIDI (BLE MIDI) commands cheat sheet.

Audio

ALSA

Bluetooth

Debugging

Hardware

service bluetooth status
dmesg | grep -i bluetooth
hwinfo
hcitool dev

Bluetooth Devices

hcitool scan

BlueZ

https://tttapa.github.io/Pages/Ubuntu/Software-Installation/BlueZ.html

sudo apt-get install bluez
cd /tmp
wget https://mirrors.edge.kernel.org/pub/linux/bluetooth/bluez-5.66.tar.xz
sudo apt-get install xz-utils
tar -xf bluez-5.66.tar.xz
sudo apt-get install build-essential libglib2.0-0 libglib2.0-dev libudev-dev libical-dev libreadline-dev libdbus-1-dev libasound2-dev python3-docutils
cd bluez-5.66
./configure --enable-midi --with-systemdsystemunitdir=/etc/systemd/system
make
sudo make install

# ???
sudo apt-get install --reinstall bluez

# ?
# https://www.reddit.com/r/archlinux/comments/yu9az9/comment/iznh0yv/?utm_source=reddit&utm_medium=web2x&context=3
# http://www.bluez.org/le-audio-support/
sudo echo "\n\nExperimental = true" >> /etc/bluetooth/main.conf
sudo reboot
sudo service bluetooth status

Enable midi bluetooth

https://gist.github.com/elehcim/e088a8868d82e3b36163aad19a641343

sudo service bluetooth stop
sudo apt install build-essential debhelper fakeroot wget dh-autoreconf flex bison libdbus-glib-1-dev libglib2.0-dev                    libcap-ng-dev udev libudev-dev libreadline-dev libical-dev check dh-systemd libebook1.2-dev libasound2-dev
cd /tmp/
mkdir blumidi
cd blumidi/
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/bluez/5.48-0ubuntu3.1/bluez_5.48.orig.tar.xz
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/bluez/5.48-0ubuntu3.1/bluez_5.48-0ubuntu3.1.debian.tar.xz
tar xJf bluez_5.48.orig.tar.xz
cd bluez-5.48/
tar xJf ../bluez_5.48-0ubuntu3.1.debian.tar.xz
sed -i 's/\(--enable-usb\)/\1 --enable-midi/' debian/rules
dpkg-buildpackage -rfakeroot -b
# I didn't care about the error on the impossibility to sign the packages
cd ..
sudo dpkg -i bluez*.deb libbluetooth*.deb
sudo service bluetooth restart


# To check the new MIDI device
aplay -l
aconnect -i

Pair

bluetoothctl
power on
scan on
scan off
devices
agent on
pair <mac_address>
trust <mac_address>
connect <mac_address>

Midi

pmidi

πŸ“ Manpage πŸ“ Alsa Documentation: Playing MIDI πŸ“ Alsa Documentation: Recording MIDI

List MIDI ports

pmidi -l

Play MIDI file through MIDI Keyboard

pmidi -p <port>:<port> <midi_file_path>

Record MIDI file from MIDI Keyboard

https://wiki.archlinux.org/index.php/USB_MIDI_keyboards

Listen to MIDI events:

aconnect -io
aseqdump -p <client>

WildMIDI

πŸ“ Official Website

sudo apt-get install -y wildmidi

sudo apt-get install alsa-utils
sudo apt-get install hwinfo
sudo apt-get install pciutils

Wifi

vim /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/run/wpa_supplicant 
update_config=1

# reading passphrase from stdin
network={
	ssid=""
	psk=""
}

https://wiki.archlinux.org/index.php/wpa_supplicant


Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment