Capture Nintendo Switch Audio Output https://mzyy94.com/blog/2020/04/17/nintendo-switch-audio-uac-gadget/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /sys/kernel/config/usb_gadget/ | |
mkdir -p procon | |
cd procon | |
echo 0x057e > idVendor | |
echo 0x2009 > idProduct | |
echo 0x0200 > bcdDevice | |
echo 0x0200 > bcdUSB | |
echo 0x00 > bDeviceClass | |
echo 0x00 > bDeviceSubClass | |
echo 0x00 > bDeviceProtocol | |
mkdir -p strings/0x409 | |
echo "000000000001" > strings/0x409/serialnumber | |
echo "Nintendo Co., Ltd." > strings/0x409/manufacturer | |
echo "Pro Controller" > strings/0x409/product | |
mkdir -p configs/c.1/strings/0x409 | |
echo "" > configs/c.1/strings/0x409/configuration | |
echo 500 > configs/c.1/MaxPower | |
echo 0xa0 > configs/c.1/bmAttributes | |
mkdir -p functions/hid.usb0 | |
echo 0 > functions/hid.usb0/protocol | |
echo 0 > functions/hid.usb0/subclass | |
echo 64 > functions/hid.usb0/report_length | |
echo BQEVAAkEoQGFMAUBBQkZASkKFQAlAXUBlQpVAGUAgQIFCRkLKQ4VACUBdQGVBIECdQGVAoEDCwEAAQChAAswAAEACzEAAQALMgABAAs1AAEAFQAn//8AAHUQlQSBAsALOQABABUAJQc1AEY7AWUUdQSVAYECBQkZDykSFQAlAXUBlQSBAnUIlTSBAwYA/4UhCQF1CJU/gQOFgQkCdQiVP4EDhQEJA3UIlT+Rg4UQCQR1CJU/kYOFgAkFdQiVP5GDhYIJBnUIlT+Rg8A= | base64 -d > functions/hid.usb0/report_desc | |
mkdir -p functions/uac1.0 | |
ln -s functions/hid.usb0 configs/c.1/ | |
ln -s functions/uac1.0 configs/c.1/ | |
udevadm settle -t 5 || : | |
ls /sys/class/udc > UDC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /sys/kernel/config/usb_gadget/ | |
mkdir -p audio | |
cd audio | |
echo 0x0104 > idProduct # Multifunction Composite Gadget | |
echo 0x1d6b > idVendor # Linux Foundation | |
mkdir strings/0x409 | |
echo "000000000" > strings/0x409/serialnumber | |
echo "Linux Foundation" > strings/0x409/manufacturer | |
echo "Multifunction Composite Gadget" > strings/0x409/product | |
mkdir -p configs/c.1/strings/0x409 | |
echo "Audio Gadget" > configs/c.1/strings/0x409/configuration | |
echo 120 > configs/c.1/MaxPower | |
mkdir -p functions/uac1.0 | |
ln -s functions/uac1.0 configs/c.1/ | |
ls /sys/class/udc > UDC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment