teamclouday / AndroidMic

Use your Android phone as a mic to Windows PC
MIT License
113 stars 9 forks source link

Update Android side + new Rust backend #28

Closed wiiznokes closed 1 year ago

wiiznokes commented 1 year ago

Hello, it's me again 😄 I had time to kill so i decided to port the server side to Rust (wanted to know if this was possible). I also added some features

windows app remains compatible with default options. The good things is that the rust cli is compatible with Linux.

I added more info in the readme of rust project.

Also, i updated android to Android 14 and factorised some part.

Otherwise, the results are much better Rust side, especially with UDP and 48000 activated on my side. But it drops when I use my bluetooth headset, then it's Windows which perform the best (not perfect either tho).

I can't test audio format because my card only support f32 and oboe doesn't support it i thinks.

teamclouday commented 1 year ago

Hi, it's been a while. Hope everything is going well! This is a huge update, great work I'm not very familiar with Rust lol. But I like the language, may find some time to learn it

Just a little curious about the UDP implementation. Does it automatically handle the socket packet ordering from the server side? I know that udp will just send packets in parallel so wonder how the server handles them after receiving.

Other than that this looks great! Glad there's a solution for linux. I'll merge it but feel free to comment or update!

wiiznokes commented 1 year ago

I'm not very familiar with Rust lol. But I like the language, may find some time to learn it

when you get use to it, it's hard to code with something else

Does it automatically handle the socket packet ordering from the server side?

well, i only tested it on my local network so I didn't have that kind of problem, I didn't even ask myself the question to be honest. I think it has time to arrive before another is sent

otherwise, i'm not sure about some part on Rust side, like how to handle Little and bigEndian, i don't think my solution is portable. And I couldn't get the stereo to work

teamclouday commented 1 year ago

I see haha maybe it just works because the packets carry the circular buffer offsets so they already have that ordering info. And it's local connection so packet drops are very rare.

In terms of endianness, I think it only causes problem when the android phone and pc have different endianness. Not 100% sure.