Skip to content

fuegovic/MODEP-on-Raspberry-Pi-3-with-Raspbian-Lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Complete Guide: Setting Up MODEP on Raspberry Pi 3 (Raspbian Lite & USB audio)

Table of Contents

  1. Before You Begin
  2. Install MODEP
  3. Check and Start MODEP Services
  4. Configure JACK for USB Audio Devices
  5. Optimize Performance
  6. Set Up a Wi-Fi Hotspot
  7. Add a Shutdown and Power Up Button
  8. Add an Activity LED (Optional)

πŸ’» Before You Begin

Step 1: Prepare the SD Card

  • Download and install Pi-imager
  • Select Raspbian Lite as the OS
  • Configure your username/hostname in the settings
  • Write the image to the SD card

Step 2: Initial Setup

  • Insert the SD card into the Raspberry Pi and power it on
  • Connect to the internet (Ethernet or Wi-Fi)
  • Update the system:
    sudo apt update && sudo apt upgrade -y

🎚️ Install MODEP

MODEP (MOD Emulation Pedalboard) turns your Raspberry Pi into a powerful multi-effects unit. Follow these steps to install it:

Step 1: Install MODEP

curl https://blokas.io/apt-setup.sh | sh
sudo apt update
sudo apt install modep -y
sudo apt install libfluidsynth3

libfluidsynth3 is required for instruments from FluidPlug

Step 2: Enable Auto-Login (Console Mode)

sudo raspi-config
  • Navigate to System Options > Boot/Auto Login > Console Autologin
  • Save and reboot:
sudo reboot

πŸš€ Check and Start MODEP Services

Verify that MODEP services are running:

systemctl list-units --type=service | grep modep

Critical services:

  • modep-mod-ui
  • modep-mod-host
  • jack

If the UI is not accessible, restart the services:

sudo systemctl stop modep-mod-ui modep-mod-host jack
sudo systemctl start jack modep-mod-host modep-mod-ui

Check statuses:

sudo systemctl status jack
sudo systemctl status modep-mod-host
sudo systemctl status modep-mod-ui

πŸ”Š Configure JACK for USB Audio Devices

Step 1: Identify Audio Devices

Run:

aplay -l

Look for your USB audio device in the output. It may be listed as Headset, CODEC, or another name (e.g., hw:DeviceName,0).

Step 2: Set Up JACK

Edit /etc/jackdrc:

sudo nano /etc/jackdrc

Replace with:

exec /usr/bin/jackd -t 2000 -R -P 70 -d alsa -d hw:<DeviceName>,0 -r 48000 -p 256 -n 4 -X seq -s -S

Replace <DeviceName> with the name identified in the previous step.

Save and exit (CTRL+X, then Y, then Enter).

Restart JACK:

sudo systemctl restart jack

Check logs:

sudo journalctl --unit=jack --no-pager | grep XRUN

✨ Optimize Performance (Reduce Audio Crackles)

Step 1: Adjust Realtime Priority

Edit /etc/security/limits.conf:

sudo nano /etc/security/limits.conf

Add at the end:

@audio   -  rtprio     99
@audio   -  memlock    unlimited
@audio   -  nice       -20
<username>  -  rtprio     99
<username>  -  memlock    unlimited
<username>  -  nice       -20

Replace <username> with your username

Step 2: Increase USB Audio Stability

sudo nano /boot/cmdline.txt

Add this at the end of the existing line (don't start a new line):

usbcore.autosuspend=-1

Save and reboot:

sudo reboot

Step 3: Optional Overclocking πŸ’ͺ

⚠️ Caution: Overclocking can improve performance but may increase heat and power consumption. It is only recommended if you experience audio glitches (xruns). Ensure proper cooling and power stability.

Edit the config file:

sudo nano /boot/firmware/config.txt

Add the following:

# Run as fast as firmware / board allows
arm_boost=1
kernel=zImage
arm_freq=1375
core_freq=525
gpu_freq=525
over_voltage=3
force_turbo=1
sdram_freq=625
sdram_schmoo=0x02000020
over_voltage_sdram_p=4
over_voltage_sdram_i=3
over_voltage_sdram_c=3
dtparam=sd_overclock=100

Note: force_turbo=1 can be removed to avoid forcing max clock speed, which can reduce lifespan. sdram_freq could be set lower, to a safer 500MHz.

Save and reboot:

sudo reboot

πŸ›œ Set Up a Wi-Fi Hotspot (For MODEP Web UI Access)

Step 1: Identify Your Wi-Fi Adapter

nmcli device

You should see output similar to:

DEVICE         TYPE      STATE        CONNECTION
wlan0          wifi      disconnected --
eth0           ethernet  connected    Wired connection 1
lo             loopback  unmanaged    --

Step 2: Create a Wi-Fi Hotspot

sudo nmcli device wifi hotspot ssid <hotspot-name> password <password> ifname wlan0

Step 3: Configure Auto-Connect on Boot

List network connections:

nmcli connection

View connection details:

nmcli connection show <hotspot-UUID>

Enable auto-connect:

sudo nmcli connection modify <hotspot-UUID> connection.autoconnect yes connection.autoconnect-priority 100

Verify changes:

nmcli connection show <hotspot-UUID>

πŸ“΄ Add a Shutdown and Power-Up Button

Step 1: Wiring the Button

  1. Connect one leg of the push button to GPIO 3 (pin 5)
  2. Connect the other leg to GND (pin 6)

Note: GPIO 3 is part of the Raspberry Pi's hardware and supports both shutdown (with software configuration) and power-up functionality natively.

Step 2: Enable the Shutdown Button in config.txt

Edit the Raspberry Pi's configuration file:

sudo nano /boot/config.txt

Add the following line at the end:

dtoverlay=gpio-shutdown,debounce=3000

Note: The debounce=3000 parameter ensures the button must be held for at least 3 seconds to trigger a shutdown. Short presses will be ignored.

Save and exit:

  • Press CTRL+X, then Y, then Enter.

Reboot your Pi to apply the changes:

sudo reboot

Step 3: Test the Shutdown Button

  1. Press the button briefly while the Raspberry Pi is running.
    • The system will safely shut down.
  2. Press the button again (post-shutdown) to power the Pi back on.

Why This Method?

  • No dependencies or Python scripts required: Configuration happens directly in config.txt.
  • Built-in power-up support: GPIO 3 (pin 5) works for both shutdown and power-up.
  • Efficient and lightweight: Uses system-level hardware features without running extra processes or services.

🟒 Add an Activity LED (Optional)

Show activity feedback for disk writes. You can connect an LED to monitor the system's disk activity.

Step 1: Wiring the LED

  1. Connect the anode (long leg) of the LED to GPIO 14 (TX) (pin 8) through a 330Ξ© resistor.
  2. Connect the cathode (short leg) to GND (pin 6).

Step 2: Enable the Serial Port for LED Activity

Edit the config.txt file:

sudo nano /boot/config.txt

Add the following lines:

enable_uart=1
dtoverlay=disable-bt #Optional

Save and exit:

  • Press CTRL+X, then Y, then Enter.

Reboot your Pi:

sudo reboot

Step 3: Test The Activity LED

Once configured:

  1. The LED will blink on GPIO14 (TX pin) whenever the system sends serial data.
  2. This activity reflects disk I/O or other data being output from the Raspberry Pi.

About

Installing and Configuring MODEP on Raspberry Pi 3 with Raspbian Lite

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published