f4exb / sdrangel

SDR Rx/Tx software for Airspy, Airspy HF+, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay and FunCube
GNU General Public License v3.0
2.92k stars 442 forks source link

sdrangel-6.18.1: USRP1 on the TX/RX switch the receiving antenna sometimes changes from the TX/RX to the RX2 #1119

Open yarda opened 2 years ago

yarda commented 2 years ago

Subject or type of issue

SDR

Development environment

Actual behavior

Expected behavior

Steps to reproduce

Log Files

Log:

2022-01-27 23:07:16.442 (I) SDRangel 6.18.1 Qt 5.15.2 64b x86_64 Fedora 34 (Workstation Edition) DSP Rx:24b Tx:16b PID 33437
2022-01-27 23:07:16.443 (I) MainSettings::MainSettings: settings file: format: 0 location: /home/yarda/.config/f4exb/SDRangel.conf
2022-01-27 23:07:17.112 (W) QMetaObject::connectSlotsByName: No matching signal for on_presetTree_currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)
2022-01-27 23:07:17.112 (W) QMetaObject::connectSlotsByName: No matching signal for on_presetTree_itemActivated(QTreeWidgetItem*,int)
2022-01-27 23:07:18.666 (I) PluginManager::loadPluginsDir: loaded plugin libantennatools.so
2022-01-27 23:07:18.683 (I) PluginManager::loadPluginsDir: loaded plugin libaprs.so
2022-01-27 23:07:18.685 (I) PluginManager::loadPluginsDir: loaded plugin libbeamsteeringcwmod.so
2022-01-27 23:07:18.687 (I) PluginManager::loadPluginsDir: loaded plugin libchanalyzer.so
2022-01-27 23:07:18.731 (I) PluginManager::loadPluginsDir: loaded plugin libdemodadsb.so
2022-01-27 23:07:18.733 (I) PluginManager::loadPluginsDir: loaded plugin libdemodais.so
2022-01-27 23:07:18.735 (I) PluginManager::loadPluginsDir: loaded plugin libdemodam.so
2022-01-27 23:07:18.737 (I) PluginManager::loadPluginsDir: loaded plugin libdemodatv.so
2022-01-27 23:07:18.739 (I) PluginManager::loadPluginsDir: loaded plugin libdemodbfm.so
2022-01-27 23:07:18.741 (I) PluginManager::loadPluginsDir: loaded plugin libdemodchirpchat.so
2022-01-27 23:07:18.747 (I) PluginManager::loadPluginsDir: loaded plugin libdemodfreedv.so
2022-01-27 23:07:18.749 (I) PluginManager::loadPluginsDir: loaded plugin libdemodnfm.so
2022-01-27 23:07:18.751 (I) PluginManager::loadPluginsDir: loaded plugin libdemodpacket.so
2022-01-27 23:07:18.754 (I) PluginManager::loadPluginsDir: loaded plugin libdemodpager.so
2022-01-27 23:07:18.756 (I) PluginManager::loadPluginsDir: loaded plugin libdemodssb.so
2022-01-27 23:07:18.759 (I) PluginManager::loadPluginsDir: loaded plugin libdemodvor.so
2022-01-27 23:07:18.761 (I) PluginManager::loadPluginsDir: loaded plugin libdemodvorsc.so
2022-01-27 23:07:18.763 (I) PluginManager::loadPluginsDir: loaded plugin libdemodwfm.so
2022-01-27 23:07:18.765 (I) PluginManager::loadPluginsDir: loaded plugin libfeatureafc.so
2022-01-27 23:07:18.767 (I) PluginManager::loadPluginsDir: loaded plugin libfeatureais.so
2022-01-27 23:07:18.769 (I) PluginManager::loadPluginsDir: loaded plugin libfeaturedemodanalyzer.so
2022-01-27 23:07:18.772 (I) PluginManager::loadPluginsDir: loaded plugin libfeaturegs232controller.so
2022-01-27 23:07:18.774 (I) PluginManager::loadPluginsDir: loaded plugin libfeaturepertester.so
2022-01-27 23:07:18.776 (I) PluginManager::loadPluginsDir: loaded plugin libfeaturerigctlserver.so
2022-01-27 23:07:18.778 (I) PluginManager::loadPluginsDir: loaded plugin libfeaturesimpleptt.so
2022-01-27 23:07:18.780 (I) PluginManager::loadPluginsDir: loaded plugin libfeaturestartracker.so
2022-01-27 23:07:18.783 (I) PluginManager::loadPluginsDir: loaded plugin libfilesink.so
2022-01-27 23:07:18.785 (I) PluginManager::loadPluginsDir: loaded plugin libfilesource.so
2022-01-27 23:07:18.787 (I) PluginManager::loadPluginsDir: loaded plugin libfreqtracker.so
2022-01-27 23:07:18.790 (I) PluginManager::loadPluginsDir: loaded plugin libinputairspy.so
2022-01-27 23:07:18.792 (I) PluginManager::loadPluginsDir: loaded plugin libinputaudio.so
2022-01-27 23:07:18.796 (I) PluginManager::loadPluginsDir: loaded plugin libinputfcdpro.so
2022-01-27 23:07:18.798 (I) PluginManager::loadPluginsDir: loaded plugin libinputfcdproplus.so
2022-01-27 23:07:18.800 (I) PluginManager::loadPluginsDir: loaded plugin libinputfileinput.so
2022-01-27 23:07:18.803 (I) PluginManager::loadPluginsDir: loaded plugin libinputhackrf.so
2022-01-27 23:07:18.805 (I) PluginManager::loadPluginsDir: loaded plugin libinputkiwisdr.so
2022-01-27 23:07:18.806 (I) PluginManager::loadPluginsDir: loaded plugin libinputlocal.so
2022-01-27 23:07:18.811 (I) PluginManager::loadPluginsDir: loaded plugin libinputplutosdr.so
2022-01-27 23:07:18.813 (I) PluginManager::loadPluginsDir: loaded plugin libinputrtlsdr.so
2022-01-27 23:07:18.815 (I) PluginManager::loadPluginsDir: loaded plugin libinputtestsource.so
2022-01-27 23:07:18.831 (I) PluginManager::loadPluginsDir: loaded plugin libinputusrp.so
2022-01-27 23:07:18.833 (I) PluginManager::loadPluginsDir: loaded plugin libinterferometer.so
2022-01-27 23:07:18.835 (I) PluginManager::loadPluginsDir: loaded plugin libjogdialcontroller.so
2022-01-27 23:07:18.837 (I) PluginManager::loadPluginsDir: loaded plugin liblocalsink.so
2022-01-27 23:07:18.840 (I) PluginManager::loadPluginsDir: loaded plugin liblocalsource.so
2022-01-27 23:07:18.860 (I) PluginManager::loadPluginsDir: loaded plugin libmap.so
2022-01-27 23:07:18.863 (I) PluginManager::loadPluginsDir: loaded plugin libmimometismiso.so
2022-01-27 23:07:18.866 (I) PluginManager::loadPluginsDir: loaded plugin libmimoplutosdr.so
2022-01-27 23:07:18.868 (I) PluginManager::loadPluginsDir: loaded plugin libmimotestmi.so
2022-01-27 23:07:18.871 (I) PluginManager::loadPluginsDir: loaded plugin libmodais.so
2022-01-27 23:07:18.873 (I) PluginManager::loadPluginsDir: loaded plugin libmodam.so
2022-01-27 23:07:19.442 (I) PluginManager::loadPluginsDir: loaded plugin libmodatv.so
2022-01-27 23:07:19.445 (I) PluginManager::loadPluginsDir: loaded plugin libmodchirpchat.so
2022-01-27 23:07:19.448 (I) PluginManager::loadPluginsDir: loaded plugin libmodfreedv.so
2022-01-27 23:07:19.450 (I) PluginManager::loadPluginsDir: loaded plugin libmodieee_802_15_4.so
2022-01-27 23:07:19.452 (I) PluginManager::loadPluginsDir: loaded plugin libmodnfm.so
2022-01-27 23:07:19.455 (I) PluginManager::loadPluginsDir: loaded plugin libmodpacket.so
2022-01-27 23:07:19.459 (I) PluginManager::loadPluginsDir: loaded plugin libmodssb.so
2022-01-27 23:07:19.461 (I) PluginManager::loadPluginsDir: loaded plugin libmodwfm.so
2022-01-27 23:07:19.464 (I) PluginManager::loadPluginsDir: loaded plugin libnoisefigure.so
2022-01-27 23:07:19.466 (I) PluginManager::loadPluginsDir: loaded plugin liboutputaudio.so
2022-01-27 23:07:19.468 (I) PluginManager::loadPluginsDir: loaded plugin liboutputfileoutput.so
2022-01-27 23:07:19.470 (I) PluginManager::loadPluginsDir: loaded plugin liboutputhackrf.so
2022-01-27 23:07:19.473 (I) PluginManager::loadPluginsDir: loaded plugin liboutputlocal.so
2022-01-27 23:07:19.475 (I) PluginManager::loadPluginsDir: loaded plugin liboutputplutosdr.so
2022-01-27 23:07:19.477 (I) PluginManager::loadPluginsDir: loaded plugin liboutputtestmosync.so
2022-01-27 23:07:19.478 (I) PluginManager::loadPluginsDir: loaded plugin liboutputtestsink.so
2022-01-27 23:07:19.481 (I) PluginManager::loadPluginsDir: loaded plugin liboutputusrp.so
2022-01-27 23:07:19.486 (I) PluginManager::loadPluginsDir: loaded plugin libradioastronomy.so
2022-01-27 23:07:19.488 (I) PluginManager::loadPluginsDir: loaded plugin libradioclock.so
2022-01-27 23:07:19.490 (I) PluginManager::loadPluginsDir: loaded plugin libudpsink.so
2022-01-27 23:07:19.493 (I) PluginManager::loadPluginsDir: loaded plugin libudpsource.so
2022-01-27 23:07:19.496 (I) PluginManager::loadPluginsDir: loaded plugin libvorlocalizer.so
[INFO] [UHD] linux; GNU C++ version 11.2.1 20210728 (Red Hat 11.2.1-1); Boost_107500; UHD_4.1.0.5
[INFO] [USRP1] Opening a USRP1 device...
[INFO] [USRP1] Using FPGA clock rate of 64.000000MHz...
[INFO] [USRP1] Opening a USRP1 device...
[INFO] [USRP1] Using FPGA clock rate of 64.000000MHz...
2022-01-27 23:07:22.380 (C) USRPInput::applySettings: could not set clock  "internal"
2022-01-27 23:07:22.394 (C) USRPInput::applySettings: could not set clock  "internal"
2022-01-27 23:07:22.396 (W) AudioOutputDevice::start: using system default device alsa_output.pci-0000_00_1b.0.analog-stereo
2022-01-27 23:07:22.396 (I) AudioOutputDevice::start: audio format OK
2022-01-27 23:07:22.500 (C) USRPInput::applySettings: could not set clock  "internal"
2022-01-27 23:07:22.504 (I) WebAPIServer::start: starting web API server at http://:8091
2022-01-27 23:07:32.363 (C) USRPOutput::applySettings: could not set clock to  "internal"
2022-01-27 23:07:32.423 (C) USRPOutput::applySettings: could not set clock to  "internal"
2022-01-27 23:07:45.144 (W) AudioInputDevice::start: using default device alsa_input.pci-0000_00_1b.0.analog-stereo
2022-01-27 23:07:45.144 (I) AudioInputDevice::start: audio format OK
[WARNING] [MULTI_USRP] The hardware does not support the requested TX sample rate:
Target sample rate: 3.000000 MSps
Actual sample rate: 3.047619 MSps

UUU[WARNING] [MULTI_USRP] Setting IQ imbalance compensation is not possible on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
UUU[WARNING] [MULTI_USRP] Setting IQ imbalance compensation is not possible on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
2022-01-27 23:08:12.793 (C) USRPInput::applySettings: could not set clock  "internal"
2022-01-27 23:08:12.794 (C) USRPInput::applySettings: could not set clock  "internal"
2022-01-27 23:08:12.869 (C) USRPInput::applySettings: could not set clock  "internal"
[WARNING] [MULTI_USRP] Setting IQ imbalance compensation is not possible on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] Setting IQ imbalance compensation is not possible on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] Setting IQ imbalance compensation is not possible on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
2022-01-27 23:08:38.323 (W) QOpenGLTexturePrivate::destroy() called but texture context 0x55781d71bde0 is not shared with current context 0x55781c1bf750.
Texture has not been destroyed
2022-01-27 23:08:38.323 (W) QOpenGLTexturePrivate::destroy() called but texture context 0x55781d71bde0 is not shared with current context 0x55781c1bf750.
Texture has not been destroyed
2022-01-27 23:08:38.323 (W) QOpenGLTexturePrivate::destroy() called but texture context 0x55781d71bde0 is not shared with current context 0x55781c1bf750.
Texture has not been destroyed
2022-01-27 23:08:38.323 (W) QOpenGLTexturePrivate::destroy() called but texture context 0x55781d71bde0 is not shared with current context 0x55781c1bf750.
Texture has not been destroyed
2022-01-27 23:08:38.323 (W) QOpenGLTexturePrivate::destroy() called but texture context 0x55781d71bde0 is not shared with current context 0x55781c1bf750.
Texture has not been destroyed
2022-01-27 23:08:50.317 (C) AudioInput::openDevice: could not open audio source
2022-01-27 23:08:50.551 (C) AudioInput::applySettings: failed to open device  ""
2022-01-27 23:08:50.637 (C) AudioInput::applySettings: failed to open device  ""
[INFO] [USRP1] Opening a USRP1 device...
[INFO] [USRP1] Using FPGA clock rate of 64.000000MHz...
2022-01-27 23:09:04.869 (C) USRPInput::applySettings: could not set clock  "internal"
2022-01-27 23:09:04.869 (C) USRPInput::applySettings: could not set clock  "internal"
2022-01-27 23:09:04.952 (C) USRPInput::applySettings: could not set clock  "internal"
[WARNING] [MULTI_USRP] Setting IQ imbalance compensation is not possible on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
2022-01-27 23:09:17.639 (C) USRPInput::acquireChannel: Failed to lock LO
f4exb commented 2 years ago

https://kb.ettus.com/USRP1

yarda commented 2 years ago

https://kb.ettus.com/USRP1

Unfortunately, it seems there is nothing related to this problem (or at least I wasn't able to find it).

My next steps will be extraction of the minimal reproducer from the sdrangel code and with it I will ask on the Ettus USRP forum, but I am new to sdrangel, so it will take some time.

f4exb commented 2 years ago

What about the big red text in that page: Please note that this product is now End-of-Life (EOL), and is no longer available for sale through Ettus Research, and is not recommended for use in new designs or in new projects.

and

[WARNING] [MULTI_USRP] Setting IQ imbalance compensation is not possible on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
[WARNING] [MULTI_USRP] AGC is not available on this device.
2022-01-27 23:09:17.639 (C) USRPInput::acquireChannel: Failed to lock LO

Pretty obvious isn't it?

yarda commented 2 years ago

What about the big red text in that page: Please note that this product is now End-of-Life (EOL), and is no longer available for sale through Ettus Research, and is not recommended for use in new designs or in new projects.

It's open hardware and it is still fully supported by the UHD driver. Anybody can build it. There is no need to buy it from the Ettus.

and


[WARNING] [MULTI_USRP] Setting IQ imbalance compensation is not possible on this device.
1) This just say that the HW doesn't support IQ imbalance.

[WARNING] [MULTI_USRP] AGC is not available on this device.
2) This just say that the HW doesn't support AGC
[WARNING] [MULTI_USRP] AGC is not available on this device.
2022-01-27 23:09:17.639 (C) USRPInput::acquireChannel: Failed to lock LO

This error is probably not related, I tried different things during the session, and something on my last try failed, see the previous lines from the log.

ad 1) and 2) if the client find out that the HW doesn't support AGC and IQ balance it shouldn't provide controls in the UI (or the controls should be grayed out).

f4exb commented 2 years ago

If it really "Failed to lock LO" it will not lead you very far... In short it was never assumed that the USRP plugin would support all USRPs this is mainly for B200' series.

f4exb commented 2 years ago

I do not have a USRP1 so I am unable to improve or correct things for the USRP1. Feel free to do a PR.

yarda commented 2 years ago

It seems the sdrangel works very well with the USRP1, except some minor details. E.g. the useless AGC/balance controls in the UI. Also I had a problem to switch to the secondary daugtherboard (because USRP1 has two daughterboards slots), but it seems this can be workaround with the device user arguments. I created simple ham transceiver with it and successfully made several contacts with it, the performance seems to be much better than I expected.

I think most people use the USRP HW in the full duplex mode so they may not notice such problem which manifests only in the simplex TX/RX modes. My guess is some timing problem during the TX/RX switching which leads to usage of the alternative antenna.

I definitely want to improve the USRP1 support in the sdrangel.

Is there a way how to enable the debug output? I.e. to quickly get the UHD API call sequence before I dive into the code.

f4exb commented 2 years ago

If you compile from source I think it enables debug output by default but maybe this has been disabled in the Fedora package (I do not own this part). In the log options you can control the console message level but I think that for debug it should be enabled as a whole at compile time (there is some Qt variable).

yarda commented 2 years ago

Yes, it seems the debug output was disabled in Fedora intentionally not to spam regular users. It can be re-enabled by (this could be similar in other distros):

$ echo -e "[Rules]\n*.debug=true" > ~/.config/QtProject/qtlogging.ini

Regarding the original problem it could be related to the sub devices settings and channel mapping. I will experiment with it.

github-actions[bot] commented 2 years ago

This issue is going to be closed due to inactivity

yarda commented 2 years ago

Sorry, I didn't know the policy about closing inactive issues. I opened the issue to track the problem and let other users know that such problem exists. I am bit slow with the fix. So feel free to close this issue. I will provide PR once I have something usable. I think I can reference even closed issue in the PR.

f4exb commented 2 years ago

If you have a fix that's great and if you need some more time to turn it into a PR please assign the issue to yourself. The no activity bot will skip issues that are assigned. I think you should be able to assign the issue to yourself if not please let us know here. In the meantime I remove the no issue label.

yarda commented 2 years ago

I have project "Contributor" label, but it seems I cannot assign myself to the issue. If you can assign me to the issue, please do it.

yarda commented 2 years ago

The problem doesn't seem to be in the antenna switching, but that the USRP sometimes doesn't stop transmitting. And with the power going to the TX/RX antenna, the rx is routed from the RX2 antenna and the firmware will not switch antennas until the the transmission cease. Which is correct function. Now I am trying to figure out why it sometimes doesn't stop transmitting.