gdzx / audiosource

:microphone: Use an Android device as a USB microphone
MIT License
172 stars 9 forks source link

error: adb not found #13

Closed CodeShakingSheep closed 2 months ago

CodeShakingSheep commented 2 months ago

Hi,

I tried to run audiosource with ./audiosource run after activating dev options and debugging on my Android phone and installing the app. However I receive the following error error: adb not found. However, my device can be found in Android Studio when using PTP. What can I do to get it running?

Thanks for this app!

gdzx commented 2 months ago

Hi!

You need to have adb in your $PATH (and also python, and pactl which comes with pulseaudio or pipewire-pulse). You can either install the platform tools with your package manager, or add Android/sdk/platform-tools to your $PATH like so: export PATH="$PATH:/home/user/Android/sdk/platform-tools" (you may need to adjust the location of the SDK).

Best regards,

CodeShakingSheep commented 1 month ago

Thank you. That helped. Now I get another error which is unrelated to the previous one:

[+] Loading PulseAudio module
27
[+] Waiting for device
* daemon not running; starting now at tcp:5037
ADB server didn't ACK
Full server startup log: /tmp/adb.1000.log
Server had pid: 16574
--- adb starting (pid 16574) ---
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 Android Debug Bridge version 1.0.41
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 Version 35.0.1-11580240
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 Installed as /home/{REDACTED_USER_NAME}/Android/Sdk/platform-tools/adb
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 Running on Linux 6.8.0-40-generic (x86_64)
09-07 23:12:07.574 16574 16574 I adb     : main.cpp:63 
09-07 23:12:07.575 16574 16574 I adb     : auth.cpp:416 adb_auth_init...
09-07 23:12:07.575 16574 16574 I adb     : auth.cpp:152 loaded new key from '/home/{REDACTED_USER_NAME}/.android/adbkey' with fingerprint {REDACTED_FINGERPRINT}
09-07 23:12:07.575 16574 16574 I adb     : auth.cpp:391 adb_auth_inotify_init...
09-07 23:12:08.575 16574 16574 E adb     : usb_libusb.cpp:571 failed to open device: Access denied (insufficient permissions)
09-07 23:12:08.575 16574 16574 I adb     : transport.cpp:1150 1C171FDF600FCW: connection terminated: failed to open device: Access denied (insufficient permissions)

It complains about insufficient permissions although I granted microphone and sensors permission to the app. Any idea what could be the issue? Thanks.

CodeShakingSheep commented 1 month ago

I figured out that I need to set the USB connection to PTP. Afterwards it was working fine. So as a follow-up question: it's apparently not possible to use the phone as webcam (via USB connection Webcam) and microphone at the same time, correct? When I had my phone via USB connection Webcam I got this output.

[+] Loading PulseAudio module
27
[+] Waiting for device
error: protocol fault (couldn't read status): Success

Would there be any way to make this work? Thanks.

gdzx commented 1 month ago

It's apparently not possible to use the phone as webcam (via USB connection Webcam) and microphone at the same time, correct?

Yes, the device really appears as a regular USB webcam, so ADB (on which Audio Source relies) is not accessible.

Would there be any way to make this work?

You can try scrcpy. It seems it can forward the camera feed into a v4l2loopback device, which will appear as a regular webcam.

(Untested command: scrcpy --v4l2-sink=/dev/videoN --video-source=camera --no-video-playback --no-audio.)