Root Privileges Required
Error: “spank requires root privileges for accelerometer access”
Cause: Spank needs direct access to the Apple Silicon accelerometer via IOKit HID, which requires root permissions. Frommain.go:208-210:
Accelerometer Access Issues
Error: “sensor worker failed” or “creating accel shm”
Cause: Failed to initialize shared memory or access the accelerometer sensor. Frommain.go:250-255:
Verify you're on Apple Silicon M2+
Verify you're on Apple Silicon M2+
Spank requires macOS on Apple Silicon M2 or newer. M1 chips are not supported.Supported: M2, M2 Pro, M2 Max, M3, M3 Pro, M3 Max, M4, M4 Pro, M4 MaxNot supported: Intel Macs, M1 (different accelerometer hardware)
Check for conflicting processes
Check for conflicting processes
Another process might be accessing the accelerometer.
Restart and try again
Restart and try again
Sometimes the sensor needs a clean initialization:
Audio Playback Problems
No sound when slapping
Possible causes:- System audio is muted - Check your volume settings
- Detection threshold too high - Slaps aren’t strong enough to trigger
- Speaker initialization failed - Audio decoding error
Lower sensitivity threshold
The default This makes detection more sensitive to lighter taps.
--min-amplitude is 0.3. Try lowering it:Audio decode errors
Error messages like:spank: decode /path/to/file.mp3: <error>spank: open /path/to/file.mp3: no such file or directory
main.go:361-365:
Verify MP3 format
Verify MP3 format
Only MP3 files are supported. Other formats will fail.
Check file permissions
Check file permissions
Ensure the MP3 files are readable:
Test file validity
Test file validity
Play the file with another tool to verify it’s valid:
Mode Selection Issues
Error: “—sexy, —halo, and —custom are mutually exclusive”
Cause: You’re trying to use multiple modes at once. Frommain.go:212-224:
Error: “—min-amplitude must be between 0.0 and 1.0”
Cause: Invalid amplitude threshold value. Frommain.go:226-228:
Detection Issues
Spank detects slaps but doesn’t respond
Cause: Cooldown period is active. Spank has a 750ms cooldown between responses to prevent rapid-fire audio playback. Frommain.go:69 and main.go:333-335:
Too sensitive / False positives
Cause: Detection threshold is too low. Solution: Increase the--min-amplitude value:
Not sensitive enough
Cause: Detection threshold is too high. Solution: Decrease the--min-amplitude value:
Custom Audio Issues
Error: “no audio files found in /path/to/directory”
Cause: The custom directory is empty or contains only subdirectories. Frommain.go:116-118:
Error: “loading custom audio: permission denied”
Cause: Spank can’t read the directory or files. Solution:Running as a Service
Service doesn’t start at boot
Cause: launchd plist may have errors or incorrect permissions. Solutions:Check plist syntax
Check plist syntax
Verify plist permissions
Verify plist permissions
Check logs
Check logs
Reload the service
Reload the service
Service stops unexpectedly
Check the error log:- Sensor access failed (see Accelerometer Access Issues above)
- Audio file problems (if using
--custom) - Conflicting processes
Getting Help
If you’re still experiencing issues:-
Check the output - Spank prints diagnostic information:
- Run with verbose logging - Watch for decode errors or sensor failures
-
Verify your setup:
- Apple Silicon Mac (M1/M2/M3)
- macOS (recent version recommended)
- Running with
sudo - Valid MP3 files (if using
--custom)
- Open an issue - Report bugs at the GitHub repository
Quick Diagnostics
Run through this checklist:Most issues are related to root permissions, audio file format, or sensitivity settings. Double-check these first.