ge0rg / aprsdroid

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

Feature: Force audio output through headset port #145

Open emiliogon opened 8 years ago

emiliogon commented 8 years ago

Hardware manufacturers have differences in their headset ports and how they are detected, despite Android's clear specification. Confounding the problem is that many hams will build radio-to-phone cables for AFSK with different component values connecting to different radios and phones. I have experienced some strange behaviors on a Samsung Galaxy Nexus versus slow but solid performance on an HTC EVO, and it does sound like Samsung phones are notorious for picky headset detection.

It would be great to avoid all of these issues completely with an option to force audio output through specific ports, regardless of wether hardware is detected.

There are apps out there to do this, but they vary in quality and often have ads. It would be much better if APRSdroid included this directly, especially since direct AFSK is one of the most promising features.

Granted, this may suffer from manufacturer differences in the same way the hardware does. The app may need root to override the system's headset detection, but that will be worth it to be able to reuse an older device for APRS.

ge0rg commented 8 years ago

That's an interesting idea. APRSdroid currently has an "Audio Output" setting that sets the channel for [AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html#AudioTrack%28int, int, int, int, int, int%29). Android has a deprecated [setRouting()](https://developer.android.com/reference/android/media/AudioManager.html#setRouting%28int, int, int%29) method, but I can't imagine it would have any effect. If you know a programmatic way to force either, please let me know.