ge0rg / aprsdroid

APRSdroid - Geo-Location for Radio Amateurs
https://aprsdroid.org/
GNU General Public License v2.0
504 stars 96 forks source link

RTL-SDR Support #371

Closed Rio6 closed 4 months ago

Rio6 commented 4 months ago

It would be nice if APRSDroid can support rtl-sdr, which would allow Android phones too receive APRS packets directly without an additional modem.

There are already drivers out there like SDR driver that handles the devices and exposes IQ stream for other applications.

Having this can turn any Android device into a nice APRS tracker using a rtl-sdr dongle, and would be very useful. Is this something in-scope for APRSDroid?

penguin359 commented 4 months ago

My first thought on this would be that the extra layer needed to make this work, the app that controls the SDR and does the FM demod or similar, would be it's own Android App to avoid bloating the main app, but the audio capture from this app could certainly be fed into the modem used by APRSdroid. It would likely be receive-only which would change some functionality in APRSdroid as all other methods assume TX is possible as I recall.

Rio6 commented 4 months ago

I was hoping some of the afsk demodulation can be reused for fm, but upon reading code I see it's all handled in external library. It doesn't seem easy to extend it for other type of demodulation.

In that case, a loopback dongle is probably the simplest. Then any FM player can route audio back to APRSDroid. A software solution might exist but I couldn't find an app that does it.

penguin359 commented 4 months ago

Ultimately, it's not so much that a different demod needs to be added, but an additional layer needs to be added. The AFSK demod done by PacketDroid is still needed after something does an FM demod on the signal from the SDR dongle. It is certainly possible to do, but would probably be best developed in a side-by-side app that then feeds into APRSdroid. As for a loopback dongle, I have already done that many times for some other modes. The dongle I used was thin air. ;-)

I've used SDR Touch many times to capture SSTV signals from the ISS and them Robot36 to decode them live as they are coming down. In this scenario, I have SDR Touch doing the FM demod from the SSTV signal sent on 145.8 MHz and playing the audio out the loudspeaker. The Robot36 app just tries to decode whatever it hears over the microphone which is the audio from the phone itself as output by SDR Touch. It's not ideal, but works pretty well as long as there's not too much background noise. Anything I say while the picture is coming in turns into noise in the captured image. In theory, you could have the AFSK mode in APRSdroid do the same and capture APRS packets as received through SDR Touch. It is possible to do that now, but the better solution, of course, would be if an app like SDR Touch could instead just feed the audio directly into some channel read by APRSdroid. It's possible that the Media Projection API in Android might let us bypass the microphone and directly demod the audio sent by SDR Touch. I'm not sure if it can be muted without preventing APRSdroid from receiving it, but it should allow for cleaner decode.

In any case, SDR on a phone tends to drag the battery down heavily, use a lot of CPU, abd be a little more finicky in my experience if there's any loose connection with it. You'd likely want a powered-hub in-between so the phone battery doesn't die too quickly.

Rio6 commented 4 months ago

That's some good information, thanks!

In any case, this seems to be out of scope for APRSDroid so I'll close this issue.