Giter Site home page Giter Site logo

Code erroring out about adb_forwarder HOT 16 OPEN

hunterap23 avatar hunterap23 commented on August 15, 2024
Code erroring out

from adb_forwarder.

Comments (16)

Mr4Goosey avatar Mr4Goosey commented on August 15, 2024 1

Alright, just had a go;
The code runs just fine and it says it's forwarding the device:
image

I see zero difference compared to the stream's delay/dropped frames compared to when I have the USB disconnected, though, and I can disconnect the USB cable and it'll continue without even the slightest hiccup. If I re-plug the USB cable nothing happens, and if I re-run the adb_handler once again it runs fine but nothing happens. Disabling my desktop's internet connection causes it to stop working entirely.

I'm not entirely certain how this works under the hood, but it looks suspiciously much like it's just not doing anything over USB and it's using the network connection instead, and it just does nothing when the network connection doesn't exist.

Maybe my expectations were off, but I was expecting to be able to push 1080p30 at high quality compression more effectively than over Wi-Fi, as that was dropping 90% of frames. As this is a wired connection, I expected it to have more bandwidth available.

from adb_forwarder.

Utsawb avatar Utsawb commented on August 15, 2024

same issue.

from adb_forwarder.

lawrencestroud avatar lawrencestroud commented on August 15, 2024

same issue.

Easy enough to resolve this error. Add , shell=True as an argument within the end of the brackets. You'll need to repeat this later in the code. But having said all that, the code ran and did nothing. It couldn't detect any devices via adb when I can clearly see them in Powershell. Conclusion: I gave up. If you have any better luck, please share! There is an obvious gap in the market here for some simple code to convert a phone into a webcam (and all the versions on the web , DroidCam / IVcam etc are inconsistent or plain right dodgy pieces of software).

from adb_forwarder.

HunterAP23 avatar HunterAP23 commented on August 15, 2024

@lawrencestroud @utsawb1
Can you post the config you use? My guess is that you may not have formatted the path to the ADB executable correctly: if you have the path C:\Users\tester\adb\adb.exe you would need the path in the config file to look like C:\\Users\\tester\\adb\\adb.exe

I'm also hesitant to use shell=True because it's considered insecure.

from adb_forwarder.

Mr4Goosey avatar Mr4Goosey commented on August 15, 2024

Hi @HunterAP23 - I'm running into the same issue with my config set up like this:
{ "location": "C:\\Users\\Victor\\Downloads\\platform-tools\\adb.exe", "port": "8080" }
The forwarder and platform tools are here:
image

from adb_forwarder.

Mr4Goosey avatar Mr4Goosey commented on August 15, 2024

Having added shell=True to the two sp.Popen calls has made it run somewhat farther, but now it stalls on my ADB being invalid. The ADB is a fresh download, I'm not sure why it'd be invalid. I've had apps like Iriun Webcam (which I suspect does exactly this) running perfectly on this computer + phone. The error still occurs when I switch to use the ADB that came with Iriun.
image

from adb_forwarder.

HunterAP23 avatar HunterAP23 commented on August 15, 2024

Going to rework and refactor some things - I'll follow up when I release some updates and see if the issues are fixed.

from adb_forwarder.

Mr4Goosey avatar Mr4Goosey commented on August 15, 2024

Excited to see what you come up with, it'd be great to have something like this actually functional.
It's mind-blowing to me how there's not a single app/program out there that just offers a USB feed plus basic camera controls (manual exposure, focus lock, that sort of thing). I was thinking I'd probably be able to extend this myself to get the camera controls I'm looking for exposed.
Would you happen to have any idea how soon you'd be able to take a look at this? Days, weeks?
Appreciate the effort, and that you put this out here in the first place!

from adb_forwarder.

HunterAP23 avatar HunterAP23 commented on August 15, 2024

Excited to see what you come up with, it'd be great to have something like this actually functional.
It's mind-blowing to me how there's not a single app/program out there that just offers a USB feed plus basic camera controls (manual exposure, focus lock, that sort of thing). I was thinking I'd probably be able to extend this myself to get the camera controls I'm looking for exposed.

The issue with getting camera controls accessible over USB is that it's not possible to access hardware on Android devices in that way. It would essentially require one app on desktop and another on the device itself to communicate over a network connection, where the device app opens the hardware camera and the desktop app receives the camera feed. I'm not an Android programmer but I was toying with the idea of doing this, but it'll take quite a bit of work (a few months for me).

Would you happen to have any idea how soon you'd be able to take a look at this? Days, weeks?
Appreciate the effort, and that you put this out here in the first place!

I'm working on it as we speak, I'm expecting to actually get it done by later today/tonight (I'm US eastern time). This app's been needing a good rewrite for some time now.

from adb_forwarder.

Mr4Goosey avatar Mr4Goosey commented on August 15, 2024

The issue with getting camera controls accessible over USB is that it's not possible to access hardware on Android devices in that way. It would essentially require one app on desktop and another on the device itself to communicate over a network connection, where the device app opens the hardware camera and the desktop app receives the camera feed. I'm not an Android programmer but I was toying with the idea of doing this, but it'll take quite a bit of work (a few months for me).

I hadn't considered that - I had just assumed that there would be pre-existing hooks/function calls for that sort of thing over the debug connection, but it's not surprising that that's not the case.
I imagine it'd be easier to do something like this if the controls were phone-side, rather than the phone being controlled from the desktop... Maybe I'll give something like that a shot. I'm entirely unfamiliar with software/application programming as all my experience is in the game-dev space, but who knows, maybe I'll be able to figure it out.

Looking forward to giving it another shot once you've done your rewrite though!

from adb_forwarder.

Mr4Goosey avatar Mr4Goosey commented on August 15, 2024

For a completely different awful idea - do you think it'd be possible to handle my camera controls etc. through a regular camera app on my phone, so that the sensor and image processing settings are set to what I want, and to still be able to use this to stream the final result to the PC?

from adb_forwarder.

HunterAP23 avatar HunterAP23 commented on August 15, 2024

For a completely different awful idea - do you think it'd be possible to handle my camera controls etc. through a regular camera app on my phone, so that the sensor and image processing settings are set to what I want, and to still be able to use this to stream the final result to the PC?

You know if you use the IP Webcam app that you can access the web GUI for that camera instance through a URL right?
The README provides an example of this in steps 13-16, but this assumes you're using the IP Webcam app on your device

from adb_forwarder.

HunterAP23 avatar HunterAP23 commented on August 15, 2024

I created a new branch called testing where I've posted the updated code for the project. Please try it out and let me know if it works as expected.

from adb_forwarder.

Mr4Goosey avatar Mr4Goosey commented on August 15, 2024

You know if you use the IP Webcam app that you can access the web GUI for that camera instance through a URL right?
The README provides an example of this in steps 13-16, but this assumes you're using the IP Webcam app on your device

I did actually know that, and I've got it set up - I don't know why I blanked on this, but just completely forgot while typing these comments. That does indeed solve that 'issue'.

I created a new branch called testing where I've posted the updated code for the project. Please try it out and let me know if it works as expected.

I'll give it a shot sometime today!

from adb_forwarder.

zettairyouiki01 avatar zettairyouiki01 commented on August 15, 2024

@Mr4Goosey
Not sure if you're still interested in this Goosey and perhaps you already did the connection correctly but... The script creates a loopback on the local computer, so you should be entering 127.0.0.1:8080 as the target address to use the phone connected over USB. I got it working as such with the script in testing branch.

To avoid getting your hopes up, The performance over wired was still lackluster for me with lots of compression artefacts when cranking the quality to 100% (Using the IP Webcam app). I was honestly hoping for minimal compression, I dont think any IP Webcam / similar app etc developer is reading the sensor data and pushing low compression over the network. RAW data from the sensor is likely too bandwidth intensive so no one does it, this is a pretty strange niche use case after all.

from adb_forwarder.

HunterAP23 avatar HunterAP23 commented on August 15, 2024

I admittedly forgot about this project - been too busy with other ones.
I merged the testing branch into the master to include that loopback fix.

To avoid getting your hopes up, The performance over wired was still lackluster for me with lots of compression artefacts when cranking the quality to 100% (Using the IP Webcam app). I was honestly hoping for minimal compression, I dont think any IP Webcam / similar app etc developer is reading the sensor data and pushing low compression over the network. RAW data from the sensor is likely too bandwidth intensive so no one does it, this is a pretty strange niche use case after all.

The 100% quality setting on the IP Webcam app isn't really viable for any Android device to use, since it's an insane performance hog. It'll drop frames, and might not even really improve the image much when you go past 90% quality.

I hate to say that my project isn't up to snuff, but I would recommend looking at alternatives like DroidCam/DroidCamX (for using your device as a general UVC webcam device) or DroidCam OBS (a newer version of DroidCam that only works inside of OBS).

from adb_forwarder.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.