How much power can the BalenaFin give via USB?

I’m trying to run rtl-sdr with BalenaFin and run Gqrx. Connecting the SDR device via regular USB results in the following errors:

[Logs]    [4/15/2023, 15:10:39] [xserver] gqrx: stderr: gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.10.5.1
[Logs]    [4/15/2023, 15:10:39] [xserver] gqrx: stderr: built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp xtrx
[Logs]    [4/15/2023, 15:10:39] [xserver] gqrx: stderr: Using device #0 Realtek RTL2838UHIDIR SN: 00000001
[Logs]    [4/15/2023, 15:10:39] [xserver] gqrx: stderr: Detached kernel driver
[Logs]    [4/15/2023, 15:10:39] [xserver] gqrx: stderr: Found Rafael Micro R820T tuner
[Logs]    [4/15/2023, 15:10:40] [xserver] gqrx: stderr: [R82XX] PLL not locked!
[Logs]    [4/15/2023, 15:10:40] [xserver] gqrx: stderr: [R82XX] PLL not locked!
[Logs]    [4/15/2023, 15:10:40] [xserver] gqrx: stderr: [R82XX] PLL not locked!

And Gqrx is not capable of getting data out of this device in a reasonable speed, such that actual FM radio can be heard. There are some more troubleshooting details in this reddit thread.

The device is being powered by BalenaFin’s USB. I read on a different reddit thread that some people report that low power from USB can be a cause for such issues.

Hence I tried to connect this RTL device straight to the power supply, and connect the D+ and D- wires to BalenaFin’s USB header:

USB header indexed "35"

The device seems to be identified, but is even less operational. I get the following librtlsdr errors from Gqrx:

[Logs]    [4/21/2023, 21:44:54] [xserver] gqrx: stderr: gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.10.5.1
[Logs]    [4/21/2023, 21:44:54] [xserver] gqrx: stderr: built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp xtrx
[Logs]    [4/21/2023, 21:44:54] [xserver] gqrx: stderr: Using device #0 Realtek RTL2838UHIDIR SN: 00000001
[Logs]    [4/21/2023, 21:44:54] [xserver] gqrx: stderr: Detached kernel driver
[Logs]    [4/21/2023, 21:44:54] [xserver] gqrx: stderr: rtlsdr_demod_write_reg failed with -1
[Logs]    [4/21/2023, 21:44:55] [xserver] gqrx: stderr: rtlsdr_demod_read_reg failed with -1
[Logs]    [4/21/2023, 21:44:55] [xserver] gqrx: stderr: Found Rafael Micro R820T tuner
[Logs]    [4/21/2023, 21:44:55] [xserver] gqrx: stderr: r82xx_read: i2c rd failed=-1 reg=00 len=3
[Logs]    [4/21/2023, 21:44:55] [xserver] gqrx: stderr: r82xx_set_freq: failed=-1
[Logs]    [4/21/2023, 21:44:56] [xserver] gqrx: stderr: rtlsdr_demod_read_reg failed with -1
[Logs]    [4/21/2023, 21:44:56] [xserver] gqrx: stderr: [R82XX] PLL not locked!
[Logs]    [4/21/2023, 21:44:56] [xserver] gqrx: stderr: rtlsdr_demod_read_reg failed with -1
[Logs]    [4/21/2023, 21:44:56] [xserver] gqrx: stderr: rtlsdr_demod_read_reg failed with -1
[Logs]    [4/21/2023, 21:44:56] [xserver] gqrx: stderr: [R82XX] PLL not locked!
[Logs]    [4/21/2023, 21:44:56] [xserver] gqrx: stderr: rtlsdr_demod_read_reg failed with -1
[Logs]    [4/21/2023, 21:44:56] [xserver] gqrx: stderr: rtlsdr_demod_write_reg failed with -1

My next idea is to try to connect all 4 USB headers without using the powersupply directly. Any idea if I’m digging in the right place? Perhaps the USB issues I’m experiencing are related to some BalenaOS specifics?

Help or comments will be greatly appreciated!

Hello, I routinely run two RTL_SDR dongles simultaneously on my Fin, so unless yours is experiencing a hardware issue, I don’t think it’s power-related. I haven’t tried gqrx on a Pi, but I have run this project: GitHub - balena-io-experimental/sdr-spectrum-monitor: Running OpenWebRX on balena to monitor radio spectrum and stream audio. and processed/streamed decent quality audio. I’m not sure if gqrx is too taxing for a Pi/Fin or if there is another issue causing the poor performance. Are you running anything else alongside gqrx on your device? Feel free to post your Dockerfile, etc… You may want to test the base performance of the SDR on your device with tools such as rtl_test and rtl-fm as described here: Rtl-sdr - rtl-sdr - Open Source Mobile Communications

Hey and thanks for sharing your experience @alanb128. The project’s repository is here:

I am running mpd and some other services in parallel to the xserver service in which gqrx is running. While gqrx was not taking any samples, I ran rtl_test via SSH and I observed a lot of packets lost. There are 3 processes in the xserver and another one in the audio container that read GPIO continuously and they take a lot of CPU. Shutting down the 3 xserver GPIO processes hasn’t helped much for rtl_test.

To be fully specific about the hardware, here’s a link to the product on Aliexpress. and a screenshot in case the link goes down:

image

I do not suspect the device to be the problem, as the same device works great with Gqrx when I connect it to my intel x86_64 machine.

@doronbehar that’s a very neat project, thanks for sharing. It would be interesting to try rtl_test with no other containers running and see if you get the same performance. I had just assumed you’re using the standard RTL-SDR dongle but the one you linked seems to be based on the same RTL2832U chip. Either way, it seems like it should work. Please keep us posted here!