Super random. but maybe someone knows about USB-C ...
# random
c
Super random. but maybe someone knows about USB-C spec here. I have an android device and I want to have it plugged into my machine for debugging. BUT i also want it plugged into a dock that has USB microphone plugged into it. I can do each of those individually (either hook up to external mic OR be in debug mode between laptop and phone), but no matter how many splitters/docks i buy on amazon, I can't get both functionality at once. is there something that can do this?
e
you want the external mic to be usable on the Android device?
r
Specifically they recommend using adb over network which probably isn’t the answer you were hoping for
e
basically USB communication is always host-to-peripheral, never peripheral-to-peripheral. (in fact it is also host-polled, peripherals do not initiate communication)
USB C adds signaling so that two devices can negotiate which one is the host
in theory, if your hardware supports it, you could run your desktop in USB gadget (peripheral) mode, and have your phone be the host to both that and the mic
but adb doesn't know how to run over a reverse connection like that afaik
t
adb over wifi + wireless charger
c
Yep. Basically I'm building an app for an external usb mic AND I want to be able to be viewing my adb logs. but adb over wifi/adb over tcp keeps disconnecting. so if i can somehow do both at once... id be saved. lol
t
follow up idea: usb hub + microphone + wired lan so your network is more reliable and hopefully doesn't drop out of the adb connection? or maybe there is a way to pass thru a usb device to the underlying QEMU process so you can use an emulator
c
oooh. hub with wired lan could be interesting. my networking gear is on the first level while im on the second, but while in deep debug sessions i suppose i could walk downstairs instead of disconnecting every 5 minutes.
t
or maybe get something like an old nvidia shield TV. IIRC they have multiple usb ports. though I've only ever done wifi adb with one
or just a better wifi AP so your stuff doesn't drop out?
c
my AP is fine
its the wifi debugging on android thats the isue
old nvidia shield tv is also interesting. i didn't know they had multiple ports
t
interesting. I rarely use adb over wifi. IIRC they had 2 ports
c
i just keep having wifi debugging issues like everyone here https://www.reddit.com/r/androiddev/comments/108exg2/wifi_debugging_is_frustrating/
t
gave mine to the ex in the divorce or i'd check
👍 1
c
thanks. appreciate it. adb over lan was something i hadn't thought of.
also wasn't sure of the shield. hopefully theyre not too expensive.
e
I never use android studio to set up wireless debugging
the adb commands have always worked for me
t
I'd guess biggest issue would be OS version updates. adb over TCP works great though. I use it at huge scales on our CI system
e
but yeah, everything that isn't "adb over usb" is "adb over tcp (over something else)"
💯 1
t
or join the civilized society and dev on linux. https://source.android.com/docs/devices/automotive/start/passthrough
c
maybe i gotta learn the adb commends for adb over tcp. i just always used the wifi debugging feature in AS
t
from the redit thread
e
the adb mdns handshake works for me reliably on linux, but ymmv I guess
t
I had always assumed the studio wifi feature was QOL and security focused. doing it manually would open the device to accept connection from anything on the network I suspect
also a good reason to have your DHCP reserve an IP for your phone
e
developer options > wireless debugging on the phone, pair with pairing code → same security as android studio
if you can root your android device and install usbip-tools and vhci-hcd.ko, you could actually do the opposite - debug over USB, attach a USB device (real or emulated) over IP
t
you have a write up link of that some where I can read? sounds like a great tool to be aware of
e
I haven't written anything up, but it's just regular Linux stuff
t
awesome ty friend