Created
February 19, 2015 07:18
-
-
Save Echooff3/47d61d8645d8e04e78db to your computer and use it in GitHub Desktop.
Android Raspberry Pi Code
This file contains hidden or 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
#!/usr/bin/env python | |
import usb.core | |
import time | |
import sys | |
dev = usb.core.find(idVendor=int(sys.argv[2], 16), idProduct=int(sys.argv[2], 16)) | |
mesg = dev.ctrl_transfer(0xc0, 51, 0, 0, 2) | |
# here we should check if it returned version 2 | |
time.sleep(1) | |
# requesting audio | |
dev.ctrl_transfer(0x40, 0x3a, 1, 0, "") | |
# putting device in accessory mode | |
dev.ctrl_transfer(0x40, 53, 0, 0, "") |
This file contains hidden or 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 | |
#/home/johnny/android-usb-audio.py $1 $2 | |
#(sleep 3s ; pactl load-module module-loopback source=`pactl list sources short | grep alsa_input.usb | cut -f 1`) & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment