Raspberry Pi Setup
Optimizing mtrack for Raspberry Pi
Raspberry Pi Setup
mtrack is designed to run on small devices like the Raspberry Pi, making it perfect for portable live performance setups.
Hardware Requirements
Recommended Models
- Raspberry Pi 4 (2GB+ RAM) - Recommended for best performance
- Raspberry Pi 3B+ - Works but may have limitations with many tracks
- Raspberry Pi Zero 2 W - Minimal setup, fewer tracks
Audio Interface
Use a class compliant USB audio interface:
- MOTU UltraLite-mk5 (tested)
- Behringer interfaces (tested)
- Any class compliant USB audio device
Storage
- SD Card: Use a high-quality, fast SD card (Class 10, UHS-I or better)
- USB Storage: For large song libraries, consider USB 3.0 external storage
Installation
Install Rust
|
|
Install mtrack
|
|
Install Dependencies
|
|
Performance Optimization
CPU Governor
Set CPU to performance mode:
|
|
Make it permanent:
|
|
Audio Buffer Settings
Adjust buffer settings in your configuration for lower latency:
|
|
Note: Smaller buffers may cause dropouts on slower hardware. Test and adjust.
Disable Unnecessary Services
Disable services you don’t need:
|
|
Storage Optimization
Use Fast Storage
- Use a fast SD card or USB 3.0 storage
- Consider mounting song repository on USB storage for better performance
Optimize Audio Files
- Use WAV format (no decoding overhead)
- Use 44.1kHz sample rate (standard, lower CPU usage)
- Avoid unnecessarily high bit depths if not needed
Network Setup
Static IP (Recommended)
Set a static IP for reliable remote control:
|
|
Add:
interface eth0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
WiFi Setup
If using WiFi, ensure stable connection:
|
|
Systemd Service
Set up mtrack to run as a service:
|
|
Add:
MTRACK_CONFIG=/path/to/mtrack.yaml
Enable and start:
|
|
Power Management
Disable Screen Blanking
If using a display:
|
|
Add:
[Seat:*]
xserver-command=X -s 0 -dpms
USB Power
Ensure adequate power supply (especially with USB audio interfaces):
- Use official Raspberry Pi power supply or equivalent
- Consider powered USB hub for multiple devices
Troubleshooting
Audio Dropouts
- Increase buffer sizes
- Check CPU usage:
htop - Disable unnecessary services
- Use performance CPU governor
Slow Startup
- Check SD card speed:
sudo hdparm -tT /dev/mmcblk0 - Consider faster storage
- Reduce song repository size
Device Not Found
- Check USB power supply
- Try different USB port
- Check
dmesgfor USB errors - Verify device is class compliant
Example Configuration
Optimized configuration for Raspberry Pi:
|
|
Related Documentation
- Installation - Installation instructions
- Configuration - Configuration reference
- Systemd Setup - Running as a service