diff --git a/Procfile b/Procfile index d66f483..39a87b1 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -pi: ssh -S none pi@pi4 'killall -v -s SIGKILL reaper jackd; sudo nice -n -20 sudo -u pi /home/pi/reaper_linux_armv7l/REAPER/reaper /home/pi/stream.RPP' \ No newline at end of file +pi: ssh -S none pi@pi4 'killall -v -s SIGKILL reaper jackd; sudo nice -n -20 sudo -u pi /home/pi/reaper_linux_armv7l/REAPER/reaper -nosplash /home/pi/stream.RPP' \ No newline at end of file diff --git a/README.md b/README.md index 39b6575..e7183ae 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ This code allows to use [Raspberry Pi 4](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/) as a USB gadget -composite of Ethernet and multichannel Audio input/output. - -The Pi 4 is powerful enough to run [Reaper (armv7l)](https://www.reaper.fm/download.php) and its [ReaStream](https://www.reaper.fm/reaplugs/) plugin with low latency over the built-in Ethernet. +composite of multichannel Audio input/output and Ethernet, meaning it can transform an iPad (or any other [UAC2](https://en.wikipedia.org/wiki/USB#Audio_streaming) compatible device) into a VST effect/instrument integrated into a desktop DAW – the Pi 4 is powerful enough to run [Reaper (armv7l)](https://www.reaper.fm/download.php) and its [ReaStream](https://www.reaper.fm/reaplugs/) plugin with low latency over the built-in Ethernet. ### Other versions * [Pi Zero](https://github.com/AlexanderPavlenko/pi-audio-duplex/tree/zero-v1) @@ -58,7 +56,7 @@ apt install jackd2 xserver-xorg fontconfig libgtk-3-dev open -a xquartz # "Allow network" in Preferences / Security scp ~/.Xauthority pi@pi4:. export DISPLAY=:0 ; ssh -v -X -S none pi@pi4 -reaper_linux_armv7l/install-reaper.sh # [R]un REAPER +sudo nice -n -20 sudo -u pi reaper_linux_armv7l/install-reaper.sh # [R]un REAPER ``` #### Preferences diff --git a/jack.sh b/jack.sh index 0449ebc..73a2c70 100755 --- a/jack.sh +++ b/jack.sh @@ -1,3 +1,3 @@ #!/bin/sh export JACK_NO_AUDIO_RESERVATION=1 -exec jackd -P70 -p16 -t2000 -dalsa -p256 -n3 -r48000 -s -dhw:CARD=UAC2Gadget,DEV=0 +exec jackd -P70 -p16 -t2000 -dalsa -p256 -n4 -r48000 -s -dhw:CARD=UAC2Gadget,DEV=0 diff --git a/stream.RPP b/stream.RPP index 97409f9..5adde60 100644 --- a/stream.RPP +++ b/stream.RPP @@ -1,4 +1,4 @@ - - - > - PRESETNAME "Program 1" FLOATPOS 0 0 0 0 FXID {BB35DE4B-39EA-A31A-65E5-C3975CEB496B} WAK 0 0 diff --git a/usb.sh b/usb.sh index 86f8c9b..36861a9 100755 --- a/usb.sh +++ b/usb.sh @@ -2,6 +2,7 @@ cd /sys/kernel/config/usb_gadget/ || fail mkdir -p lexi && cd lexi || fail +#rm -rf configs/c.1/*.usb0 echo 0x1d6b > idVendor # Linux Foundation echo 0x0104 > idProduct # Multifunction Composite Gadget @@ -26,19 +27,24 @@ ln -s functions/ecm.usb0 configs/c.1/ # UAC2 audio # https://www.kernel.org/doc/html/latest/usb/gadget-testing.html#uac2-function mkdir -p functions/uac2.usb0 -echo 3 > functions/uac2.usb0/c_ssize -echo 3 > functions/uac2.usb0/p_ssize echo 48000 > functions/uac2.usb0/c_srate echo 48000 > functions/uac2.usb0/p_srate + # USB Device Class Definition for Audio Devices: 4.1 Audio Channel Cluster Descriptor -# fail: "11011110011".to_i(2) = 1779 # Side Right, Side Left, -, Front Right of Center, Front Left of Center, Back Right, Left, -, -, Front Right, Left -# fail: "111110111".to_i(2) = 503 # Back Center, Front Right of Center, Front Left of Center, Back Right, Left, -, Front Center, Front Right, Left -# fail: "11111111".to_i(2) = 255 -# fail: "1111111111".to_i(2) = 1023 -# works: "11110011".to_i(2) = 243 # Front Right of Center, Front Left of Center, Back Right, Left, -, -, Front Right, Left -# but ALSA fails: "cannot set period size to 256 frames for capture" -echo 51 > functions/uac2.usb0/c_chmask + +## Quality: 24 bit, 4 input + 2 output channels +echo 51 > functions/uac2.usb0/c_chmask # "110011".to_i(2) echo 3 > functions/uac2.usb0/p_chmask +echo 3 > functions/uac2.usb0/c_ssize +echo 3 > functions/uac2.usb0/p_ssize + +## Quantity: 16 bit, 8 input + 8 output channels +# fixme: 0 inputs in Reaper... +#echo 1779 > functions/uac2.usb0/c_chmask # "11011110011".to_i(2) +#echo 1779 > functions/uac2.usb0/p_chmask +#echo 2 > functions/uac2.usb0/c_ssize +#echo 2 > functions/uac2.usb0/p_ssize + ln -s functions/uac2.usb0 configs/c.1/ # End functions