signalwareltd / rtl_tcp_andro- Goto Github PK
View Code? Open in Web Editor NEWrtl_tcp and libusb-1.0 port for Android modified to support opening devices from Linux file descriptors
License: GNU General Public License v2.0
rtl_tcp and libusb-1.0 port for Android modified to support opening devices from Linux file descriptors
License: GNU General Public License v2.0
The latest version on F-Droid is 2.2, dated December 2014. They disabled 3.01 (which seems to be the first one after the AS migration) as there seem to have been some gradle/JNI issues:
https://f-droid.org/wiki/page/marto.rtl_tcp_andro
Any chance you can sort this out? F-Droid is the main distribution channel for all those who don’t want to (or cannot) use Google Play. The maintainers are usually happy to receive contributions from app developers, and will gladly help you sort out any issues.
You can add Screenshots for F-Droid, too, if you want.
https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/
Hello,
i'm trying to use at same spot, dump1090 works fine on my computer).
My guess is that the internal hackRF amplifier should be activated, but I can't figure out how to do it from android, would it be possible to have a "config file mode" to force some hackrf settings not handled by sdrTcpArguments ?
regards
Hello,
Running latest rtl-sdr driver from the market, CyanogenMod 11 (android 4.4.4) on hp touchpad, usb otg is enabled, y cable is in place, additional power is provided, can connect mouse and keyboard and they are recognized.
When trying to run "rtl-sdr driver" with rtl-sdr dongle connected getting LIBUSB_ERROR_OTHER:
Starting service with device rtl-sdr /dev/bus/usb/001/002
Opening fd 51
Closed service due to exception SdrException: libusb exception LIBUSB_ERROR_OTHER
I've been able compile a native Android nrsc5 binary to decode HD Radio streams and play them with this driver via the Termux command line.
Alternatively, you can install a proot, Linux on Android distro and decode the audio from there with a very nice GUI such as this one:
https://github.com/markjfine/nrsc5-dui
Instructions to do all of the above can be found here: theori-io/nrsc5#277
You can reproduce the error as following:
Fresh Installation of RTL SDR Driver
Error then is the following:
onStart
RtlSdr: found 1 device opening options
HackRF: found 0 device opening options
Only 1 option available, no need to ask user. Opening rtl-sdr /dev/bus/usb/001/003
Closing service
Queueing
Arguments SdrTcpArguments{gain=24, samplerateHz=1024000, frequencyHz=91800000, address='0.0.0.0', port=14423, ppm=0}
Starting service with device rtl-sdr /dev/bus/usb/001/003
Got a permission for an unexpected device NULL. Expected UsbDevice[mName=/dev/bus/usb/001/003,mVendorId=3034,mProductId=10296,mClass=0,mSubclass=0,mProtocol=0,mManufacturerName=Realtek,mProductName=RTL2838UHIDIR,mVersion=1.00,mSerialNumberReader=android.hardware.usb.IUsbSerialReader$Stub$Proxy@38a97ae, mHasAudioPlayback=false, mHasAudioCapture=false, mHasMidi=false, mHasVideoCapture=false, mHasVideoPlayback=false, mConfigurations=[
UsbConfiguration[mId=1,mName=USB2.0-Bulk&Iso,mAttributes=128,mMaxPower=250,mInterfaces=[
UsbInterface[mId=0,mAlternateSetting=0,mName=Bulk-In, Interface,mClass=255,mSubclass=255,mProtocol=255,mEndpoints=[
UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
UsbInterface[mId=1,mAlternateSetting=0,mName=Bulk-In, Interface,mClass=255,mSubclass=255,mProtocol=255,mEndpoints=[]]].
Caught exception RuntimeException: Could not get a connection
-> RtlSdrDevice -> RtlSdrDevice$1
Closed service due to exception RuntimeException: Could not get a connection
ERROR STARTING! Reason: unknown_error
Most likely reason is in
UsbPermissionObtainer.java
UsbDevice device = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
UsbDevice device = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); if (device != null && device.equals(usbDevice)) { if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) { if (!manager.hasPermission(device)) { Log.appendLine("Permissions were granted but can't access the device"); task.setDone(null); } else { Log.appendLine("Permissions granted and device is accessible"); task.setDone(manager.openDevice(device)); } } else { Log.appendLine("Extra permission was not granted"); task.setDone(null); } context.unregisterReceiver(this); } else { Log.appendLine("Got a permission for an unexpected device %s. Expected %s.", device == null ? "NULL" : device, usbDevice); task.setDone(null); }
see
[https://developer.android.com/reference/android/content/Intent]
This method was deprecated in API level 33. Use the type-safer getParcelableArrayListExtra(java.lang.String, java.lang.Class) starting from Android Build.VERSION_CODES#TIRAMISU.
I've been experimenting with the source code and stumbled upon strange data coming from android application. It's almost only two bytes 0x7f and 0x80. I believe this is an issue with the gain setting, but looks like changing gain does not help at all.
Here is a summary picture with the histogram of two files. One from the archlinux with ./rtl_tcp -f 1090000000 -s 2000000
another from your app with the same arguments. Same dongle of course.
Maybe you've seen something like this before and have any tips about what am I doing wrong?
Hi, just wanted to get in touch to see what the best way would be to add support for the RTL-SDR Blog V4? This is a new RTL-SDR dongle i'm releasing for sale, but unfortunately the hardware changes mean that it's not compatible with the current drivers. https://www.rtl-sdr.com/rtl-sdr-blog-v4-dongle-initial-release/
Basically there needs to be three main changes:
These changes are implemented at https://github.com/rtlsdrblog/rtl-sdr-blog-minimal
Are you accepting PR's? If you like I can do a PR on your code with the necessary changes.
onStart
RtlSdr: found 1 device opening options
HackRF: found 0 device opening options
Only 1 option available, no need to ask user. Opening rtl-sdr /dev/bus/usb/001/003
Closing service
Queueing
Arguments SdrTcpArguments{gain=24, samplerateHz=1024000, frequencyHz=91800000, address='0.0.0.0', port=14423, ppm=0}
Starting service with device rtl-sdr /dev/bus/usb/001/003
Caught exception IllegalArgumentException: marto.rtl_tcp_andro: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
-> PendingIntent -> UsbPermissionObtainer -> RtlSdrDevice -> RtlSdrDevice$1
Closed service due to exception IllegalArgumentException: marto.rtl_tcp_andro: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
ERROR STARTING! Reason: unknown_error
Hey, quick question... I'm trying to compile this code with and run it on my samsung gs4. I pulled from your commit on Aug 04 before I noticed that you added "Nothing works". The rtl_tcp_andro binary that is checked in works perfectly, but when I try to compile it myself, I get a link error at run-time saying "CANNOT LINK EXECUTABLE: cannot locate symbol "stpcpy" referenced by /data/data/marto.rtl_tcp_andro_files/rtl_tcp_andro".
This seems weird to me because it doesn't look like stpcpy is even being used. There is one call for strcpy though. I'm assuming I'm having it build against the wrong platform, but I can't seem to get it right. Do you have any suggestions?
Thanks,
Jon
i could be wrong but..
i tested this more times, and it doesn't work as it should..
I set direct sampling, but all i get is static noise with a peak in the middle from 100khz till cca 25MHz.
It may be that driver is using I, instead of Q sampling mode.
Maybe this is the issue at librtlsdr.c:
/* only enable In-phase ADC input */
r |= rtlsdr_demod_write_reg(dev, 0, 0x08, 0x4d, 1);
/* swap I and Q ADC, this allows to select between two inputs */
r |= rtlsdr_demod_write_reg(dev, 0, 0x06, (on > 1) ? 0x90 : 0x80, 1);
VirusTotal reported false positive when I uploaded the latest release:
I have a built long time ago simple power injector for my RTL-SDR DIY kit. When I try to connect it, including additional power from powerbank, to my Redmi 9 I'm getting an error message "Your Android device does not provide enough power to the dongle. You must use an externally powered USB hub or an externally powered USB OTG cable."
What's up
Since you updated the Target API
I think you should start a foregroundservice instead of startservice.
public void startWithDevice(SdrDevice sdrDevice, SdrTcpArguments sdrTcpArguments) { Check.isNotNull(sdrDevice); Check.isNotNull(sdrTcpArguments); addWork(sdrDevice, sdrTcpArguments); if (!isRunning) { Intent intent = new Intent(getApplicationContext(), BinaryRunnerService.class); startService(intent); } else { closeService(); } }
so i think this would help
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { startForegroundService(intent); } else startService(intent);
Additonal you should add in your AndroidManifest.xml
<service android:name="com.sdrtouch.rtlsdr.BinaryRunnerService" android:foregroundServiceType="connectedDevice" android:exported="false" />
welle.io (an open source DAB/DAB+ SDR receiver software) uses your great driver!
Google Play: https://play.google.com/store/apps/details?id=io.welle.welle
Website: https://www.welle.io
Source: https://github.com/AlbrechtL/welle.io
I would be very happy if you add welle.io to the supported app list.
Hi!
I want to run as a server in Android box, but I cannot reconnect after the connection has ended. How to running always?
Thank you!
FYI, I made a fork of libusb and ported your patch to it to make it more easily accessible:
https://github.com/BuLogics/libusb/commits/android_usbfd
I also have a libusb-compat-0.1 which supports the calls for android with file descriptors:
https://github.com/BuLogics/libusb-compat-0.1/tree/android_usbfd
Does the driver support Android 5.02?
It reports device not found. The device works with a PC and the OTG cable works with dongles and hard drives.
I also have a Nexus 5, but it is also running 5.02. My old Samsung is probably not powerful enough...
Peter
The product-id and vendor-id values are supposed to be in decimal format, not hex.
I see that you convert them from hex to decimal internally however, so the app is working.
Still, this file should be portable to other projects which are expecting the standard format.
I'm working on the next version of welle.io. Most of time welle.io gets the message Wrong arguments were supplied! Please, check the sdr_tcp manual!
when trying to use the rtl-sdr driver. Sometimes it is also working.
What can be the cause? Which arguments are wrong?
Rtl-sdr driver gives the following output.
onStart
RtlSdr: found 1 device opening options
Only 1 option available, no need to ask user. Opening rtl-sdr /dev/bus/usb/001/003
Closing service
Queueing
Arguments SdrTcpArguments{gain=24, samplerateHz=2048000, frequencyHz=100000000, address='127.0.0.1', port=1234, ppm=0}
Starting service with device rtl-sdr /dev/bus/usb/001/003
Opening fd 58
Set sampling rate to 2048000
Tuner gain set to 2.400000 dB
SdrTcp: Closing sdrtcp due to sdrtcp_open_socket seeing state 2 and success 0
SdrTcp: Closing from state 0
Closed service due to exception SdrException: Wrong arguments were supplied! Please, check the sdr_tcp manual!
Closing service
Tested with Android One 9.0.
Just putting in my vote for allowing this driver to be used on chromeOS. I have a chromebox and would love to use SDR Driver on it to set up rtl_tcp. I don't think there are any relevant differences in the underlying android OS so this might be as simple as allowing chromeOS within the app packaging?
I've been wrong before, though.
Note that while ChromeOS now has native linux functionality and the RTL device can be seen inside crostini, there's no reasonable way to NAT or bridge the internal linux network interface back to the external.
Hi there was wondering how hard it would be to add support for ported libairspy: https://github.com/demantz/airspy_android
So i could use SDRTouch or Welle.iowith airspy while on the go?
Thanks for Anwsering and Best Regards
Hi, as user of f-droid, while trying the version in the fdroid repo (2.2) the RF analyzer software is not working with the driver. with the 3.02 release you gently put on github, this is working correctly.
Is it possible tu push this 3.02 version to fdroid repo ?
Regards.
Dear mr. Marinov,
I very appreciate the changes you made in 'libusb' and 'rtl-sdr' to let it work at an Android device!
I would really like it when you are able to get your modifications integrated in the original projects. Or at least rebase your modifications on the master-branche of the 'libusb' and 'rtl-sdr' projects.
In the original 'libusb'-project there is even Android-support included. Maybe you can use that lib without modifications?
Thanks in advance!
Many greetings,
Vincent
As reference, these are the locations of the original projects:
https://github.com/libusb/libusb.git
https://github.com/keenerd/rtl-sdr.git
Hello,
we recently tested your app rtl_tcp by an automated Android GUI testing tool developed by our team, and we found a bug that the app will break when we click.Here is the trace.
Did someone got it working with NooElec Donges?
I have tried the Nooelec NESDR Mini 2 and the Nooelec NESDR SMArt XTR but both would not get recognized.
Hi,
Could you add Dump1090 Android to the list of compatible apps. Thnaks
https://play.google.com/store/apps/details?id=eu.ebctech.dump1090
Dear Martin.
I wonder whether you would kindly implement a support for the Omnia SDR transceiver into your rtlsdr driver.
The Omnia SDR
www.omnia-sdr.com
is a short wave HAM radio SDR transceiver, implementing an USB hub, USB audio class device and a libusb low speed communication port for controlling an internal VFO, band pass filters etc. The Omnia firmware could be changed to let the USB audio class device identify itself as something different than an USB audio device as to avoid the stock Linux USB driver to open it, so I suppose it should be then possible to implement an audio like driver using the libusb interface by porting a Linux USB audio kernel driver to libusb in a similar way it has been done for the rtlsdr.
Once there is a driver for the Omnia, I suppose one would be able to use your stock sdrtouch Android application for receive. A transmit function would be cool as well :-)
Thanks for consideration,
Vojtech
Please can you help me with following problem. I connect SDR to OTG, but the driver does not start correctly. I've enabled all the permissions I can on Xiaomi Redmi Note 10S. Here is the log:
onStart
RtlSdr: found 1 device opening options
HackRF: found 0 device opening options
Only 1 option available, no need to ask user. Opening rtl-sdr /dev/bus/usb/001/030
Closing service
Queueing
Arguments SdrTcpArguments{gain=24, samplerateHz=2048000, frequencyHz=100000000, address='127.0.0.1', port=1234, ppm=0, biast=0}
Starting service with device rtl-sdr /dev/bus/usb/001/030
Opening fd 96
Set sampling rate to 2048000
Tuner gain set to 2.400000 dB
SdrTcp: Listening on 127.0.0.1:1234
Device was open. Closing the prompt activity.
SdrTcp: Waiting for client...
The rtl-tcp implementation is running and is ready to accept clients
Acquired wake lock. Will keep the screen on.
rtlsdr_read_async failed
rtlsdr_read_async finished successfully
SdrTcp: Requested sdrtcp stop asynchroneously
Closed service due to exception SdrException: Unknown error!
Wake lock released
Closing service
SdrTcp: TCP server shutting down.
SdrTcp: Closing sdrtcp due to main thread finishing
SdrTcp: Closing from state 0
SdrTcp: Server thread shut down
UsbDelegate USB attached: /dev/bus/usb/001/037
UsbDelegate no activity found for SDR handling
Could you merge in the changes to rtl_tcp in the rtl-sdr-blog drivers that enable direct sampling in their dongle? On a related note, it would be great to be able to dynamically switch into this mode in SDR Touch depending on the frequency.
Consider using git tags for new releases.
Hi, I'm using welle.io on Android and after some time I get this error message:
"SdrTcp: serveClient cannot send to client"
This is issued in sdrtcp.c at line 148. To me it looks like that the return code of select() in line 139 is not handled correctly. According the manual pages the select function returns the total number of socket handles that are ready and contained in the fd_set structures, zero if the time limit expired, or SOCKET_ERROR (-1) if an error occurred. If the return value is SOCKET_ERROR, WSAGetLastError (errno) can be used to retrieve a specific error code....
Shouldn't line 141 the be the following?
if(r > 0 && obj->state == STAGE_CLIENT_SERVING) {....
and the if-block in line 147-150 inside of the previous if(), so before line 145?
Please have a look.
The driver app does not request the required permissions properly with the latest version from the google play store. (Testing on a SM-T533 with Android 5.1.1)
RtlSdr: found 1 device opening options
Only 1 option available, no need to ask user. Opening rtl-sdr /dev/bus/usb/001/002
Queueing
Arguments SdrTcpArguments{gain=24, samplerateHz=1024000, frequencyHz=100000000, address='127.0.0.1', port=60187, ppm=0}
Starting service with device rtl-sdr /dev/bus/usb/001/002
Caught exception SecurityException: Admin does not have android.permission.sec.MDM_APP_MGMT
-> Parcel -> IUsbManager$Stub$Proxy -> UsbManager -> UsbPermissionObtainer -> RtlSdrDevice -> RtlSdrDevice$1
Closed service due to exception SecurityException: Admin does not have android.permission.sec.MDM_APP_MGMT
Closing service
Hi Sir
I have recently incorporated the use of your RTL SDR driver in my app see here.
https://play.google.com/store/apps/details?id=com.enthusiasticcoder.adsbflightmonitor&hl=en
I was hoping if you could added it to your list of compatible apps?
Thanks
Hallo i would like to implement your project into my app so you dont need to install one extra application. What are the stepps to do that?
thank you for your help!
I have rtl_tcp running on another computer.
Would it be possible to implement a simple "proxy mode" in this application ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.