-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse iter approch #47
Conversation
Hi thanks for the PR! Yes I agree iter is better. The pattern of using mutex with arc was messy and it has no good impact on the performance. I initially switched to it from iter because I was using rusb which requires maintaining a global context for the connection. But later I changed to nusb and the requirement no longer exists. Thanks for changing it back.
For tcp and udp, I think both of them were designed to connect through the local internet, so if the phone and laptop are under the same wifi environment, they should be able to find each other. So they don't have to go through adb. Also adb reverse proxy only supports tcp as far as I know.
It's a little tricky because the device connection doesn't have a category for the device, and phones are usually identified by unique IDs set by the manufacturers. However, I've seen a code pattern that they send the "start accessory" command to all USB devices, and only the android devices will respond. In that case there's no need to identify phones by vendor names ourselves.
Right this is a little annoying. What I've learned is that USB communication is one channel, and it's a little different based on OS. Windows only allows one program to take over the USB, so if adb is using it, aoa won't work with the phone. On mac or linux it's different so the adb can keep running. What I have been doing is to set phone to charging only mode, shutdown adb server, close the mobile app, and then start aoa which will reopen the app after confirmation. But I agree it's not user friendly.
Thanks! Yep I learned how to use canvas from this clock example. Apparently there are games written with canvas so it can run super fast. AndroidMic/RustApp/src/streamer/mod.rs Line 144 in a670e73
It's probably better to dynamically compute this value based on sample rate and sample size. For example, 48k 24bit will carry more data than 44.1k 8bit in each frame, so the window size should be larger in that case. |
Hi and Happy new year,
This pr reuse the previous
Streamer
trait approach with an "iter".I tested
For the USB part, i had to debug multiple things. I added some info in the readme that i think is the same problem of #45.
Except that, the AsyncReader approach for usb looks very clean. The audio wave looks nice, and more optimized than mine (Android mic is at 0% on my pc). I wonder how this is possible. The scale is perhaps a little too small, at least on my setup, but it's a detail.