Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USRP: Don't call get_tx/rx methods if tx/rx channels is 0, as may result in KeyError exception #1288

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

srcejon
Copy link
Collaborator

@srcejon srcejon commented Jun 13, 2022

First attempt to fix #1284

@Bob-Sellers
Copy link

sdrangel-7.3.2-2-g032b36ce7-win64.exe

2022-06-13 09:43:34.423 (D) USRPInput::openDevice: open device here
2022-06-13 09:43:34.423 (D) DeviceUSRPParams::open: type=x300,addr=192.168.10.2,fpga=HG,name=,serial=XXXXXXX,product=X310,master_clock_rate=50000000
2022-06-13 09:43:34.495 (D) DeviceUSRPParams::open: exception: ValueError: Can't infer daughterboard clock rate. Specify dboard_clk_rate in the device args.
2022-06-13 09:43:34.495 (C) USRPInput::openDevice: failed to open device

I'll just see whether I can find sensible values for master_clock_rate and dboard_clk_rate

@f4exb f4exb merged commit 7d1e8f8 into f4exb:master Jun 13, 2022
@Bob-Sellers
Copy link

200 MHz for these parameters seems sensible after reading this: https://files.ettus.com/manual/page_twinrx.html

log now reads:

2022-06-13 11:00:50.806 (D) USRPInput::openDevice: open device here
2022-06-13 11:00:50.806 (D) DeviceUSRPParams::open: type=x300,addr=192.168.10.2,fpga=HG,name=,serial=XXXXXXX,product=X310,master_clock_rate=200000000,dboard_clk_rate=200000000
2022-06-13 11:00:55.174 (D) DeviceUSRPParams::open: m_nbRxChannels: 4 m_nbTxChannels: 0

@Bob-Sellers
Copy link

The radio doesn't have AGC and there seems to be a bit of trouble setting the gain value. However, it looks like this can be overcome by configuring 'Gain - Man' BEFORE starting the RX. Trying to change it after previously starting the radio in 'Gain - Auto' doesn't often work.

When I say the gain can be set, I can see the spectrum moving up and down with the gain setting. I'm a bit concerned that when I tune to where a strong signal should be in the FM band, it isn't there. I'll investigate this a bit more.

I also see a few of these issues in the logs:

2022-06-13 11:14:40.720 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-13 11:14:40.726 (D) USRPInput::acquireChannel: exception: LookupError: KeyError: Invalid TX channel: 0

when the radio is in manual gain mode and the it has already been determined in the same session that the radio doesn't have any TX channels.

@Bob-Sellers
Copy link

When I change the sample rate as the radio is operating the axes on the displayed spectrum don't change, they are set correctly for the startup sample rate. The appearance of the data in the display changes (making me think that the sample rate is actually changing) but the axes don't update.

The axes do update if I stop the capture, set the sample rate and restart.

@Bob-Sellers
Copy link

I set the master_clock_rate parameter in the 'Devices - User arguments' field as I had done successfully on an Ettus E320. With that device, the manually configured master clock rate was displayed in the sampling device configuration pane - next to the selected sample rate.

With this X310 the master clock rate parameter is not displayed next to the sample rate. With the X310, for a selected sample rate of the 2MS/s, the display reads '- 2000k'

@Bob-Sellers
Copy link

Bob-Sellers commented Jun 13, 2022

When I select the receiver [0:0] and start a capture, the LED under the RF A, RX2 port illuminates, so that's where I connected my antenna. Turns out it was receiving on the non-illuminated RF A, TX/RX port.

I will check the internal wiring of the radio, as I understand a number of different rx daughterboards can be used with this device.

-- AFTER FURTHER INVESTIGATION --

Looks like this is due to UHD driver mismatch between the uhd.dll bundled with SDRangel and my radio (with UHD ver 4.2). When I replace the bundled uhd.dll with one that matches my radio the correct LED's light up.

@Bob-Sellers
Copy link

With regard to sample rates, it looks like there might be a similar issue to the E320.

I set 2 MS/s sample rate and center on a prominent FM signal, say 93MHz. If I change the center frequency to 92MHz the prominent signal is indicated to be at 92.95 MHz (at the right hand side of the spectrum). If I tune to 94MHz, the prominent signal is indicated to be at 93.05 MHz (at the left hand side of the spectrum).

Looks like the radio is sampling faster than indicated.

Just tried to repeat this, and it looks like the sample rate might be different for a a new restart.

Tune to 92MHz, prominent signal is now indicated at 92.7MHz, tune to 94MHz prominent signal is 93.3MHz (as before, when tuned to 93MHz the signal is in the dead center)

@Bob-Sellers
Copy link

There is a DDC block in the X310 consisting of CIC and half band filters. Obviously not all requested sample rates are available (and some that are available don't give great performance, due CIC passband roll off).

If I use the Ettus supplied utility to capture data from radio to disk I can read the warning messages when a bad choice of decimation rate is selected. As well as the requested sample rate and the actual sample rate achieved.

So for this command:

rx_samples_to_file --file c:temp\usrp_samples.dat --rate 3000000 --freq 93000000

I get this response:

Creating the usrp device with: ...
[INFO] [UHD] Win32; Microsoft Visual C++ version 14.1; Boost_107000; UHD_4.2.0.0-release
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 1472 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
Using Device: Single USRP:
Device: X-Series Device
Mboard 0: X310
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: TwinRX RX0
RX Channel: 1
RX DSP: 1
RX Dboard: A
RX Subdev: TwinRX RX1
RX Channel: 2
RX DSP: 2
RX Dboard: B
RX Subdev: TwinRX RX0
RX Channel: 3
RX DSP: 3
RX Dboard: B
RX Subdev: TwinRX RX1

Setting RX Rate: 3.000000 Msps...
[WARNING] [0/DDC#0] The requested decimation is odd; the user should expect passband CIC rolloff.
Select an even decimation to ensure that a halfband filter is enabled.
Decimations factorable by 4 will enable 2 halfbands, those factorable by 8 will enable 3 halfbands.
decimation = dsp_rate/samp_rate -> 67
[WARNING] [0/DDC#0] The requested decimation is odd; the user should expect passband CIC rolloff.
Select an even decimation to ensure that a halfband filter is enabled.
Decimations factorable by 4 will enable 2 halfbands, those factorable by 8 will enable 3 halfbands.
decimation = dsp_rate/samp_rate -> 67
Actual RX Rate: 2.985075 Msps...[WARNING] [MULTI_USRP] Could not set RX rate to 3.000 MHz. Actual rate is 2.985 MHz

Setting RX Freq: 93.000000 MHz...
Setting RX LO Offset: 0.000000 MHz...
Actual RX Freq: 93.000000 MHz...

Waiting for "lo_locked": +++++++++ locked.

Press Ctrl + C to stop streaming...

Done!

It looks as though SDRangel is trying to set a sample rate that cannot be achieved. The radio is saying that it can't be achieved and reporting what the best is that it can do and that SDRangel isn't acting on that information?

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 15, 2022

In #1278 (comment) - you say that SDRangel does correct to the nearest valid sample rate - so not sure what the difference is here.

Note that SDRangel doesn't understand/use any of the text that the UHD driver prints to the log file - it calls set_rx_rate, then get_rx_rate/get_master_clock_rate to get what was actually set. What do youy get for the following log messages:

        USRPInput::applySettings: clock set to " << settings.m_clockSource;
        USRPInput::applySettings: set sample rate set to %d", settings.m_devSampleRate);


        USRPInput::applySettings: actual sample rate %f", actualSampleRate);
        USRPInput::applySettings: master_clock_rate %f", masterClockRate);

@Bob-Sellers
Copy link

Just to clarify wrt to selection of the nearest valid sample rate the code appears to be working correctly for the E320 radio but not for the X310. In the development of your previous solution for the E320 there was a period when the GUI reported that the radio was sampling at a particular rate and the evidence showed otherwise.

That is the type of behaviour I'm seeing with the X310 and this code version sdrangel-7.3.2-2-g032b36ce7-win64.exe

@Bob-Sellers
Copy link

Extract from the log shows this:

2022-06-15 20:21:25.968 (D) DSPDeviceSourceEngine::gotoRunning: USRPInput started
2022-06-15 20:21:25.968 (D) USRPInput::suspendRxBuddies (0)
2022-06-15 20:21:25.968 (D) USRPInput::suspendTxBuddies (0)
2022-06-15 20:21:25.968 (D) USRPInput::applySettings: clock set to "internal"
2022-06-15 20:21:25.969 (D) USRPInput::applySettings: set sample rate set to 3000000
2022-06-15 20:21:25.979 (D) USRPInput::applySettings: frequency set to 435000000 with LO offset 0
2022-06-15 20:21:25.980 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-15 20:21:25.991 (D) USRPInput::acquireChannel: exception: LookupError: KeyError: Invalid TX channel: 0
2022-06-15 20:21:25.991 (D) USRPInput::resumeTxBuddies (0)
2022-06-15 20:21:25.991 (D) USRPInput::resumeRxBuddies (0)

There is no reference to "actual sample rate" in the log.

The only reference to "master_clock_rate" is near to the top of the log:

2022-06-15 20:20:13.544 (D) USRPInput::openDevice: open device here
2022-06-15 20:20:13.544 (D) DeviceUSRPParams::open: type=x300,addr=192.168.10.2,fpga=HG,name=,serial=XXXXXXX,product=X310,master_clock_rate=200000000,dboard_clk_rate=200000000
2022-06-15 20:20:17.923 (D) DeviceUSRPParams::open: m_nbRxChannels: 4 m_nbTxChannels: 0

@Bob-Sellers
Copy link

Just to mention the positives, I am able to get samples from the radio, look at the spectrum and waterfall and apply a variety of demod plugins.

I've been able to use the Noise Figure Plugin to sweep gain settings at a particular frequency and plot the Noise Figure so SDRangel is proving very handy. I just need to be a bit wary about sample rate setting at the moment!

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 20, 2022

I'd guess the exception that is being raised (due to no AGC) means the settings for the radio are only partially set - so need to handle that case better.

Try setting to manual - then changing the frequency.

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 20, 2022

#1293 may help get to the next problem.

@Bob-Sellers
Copy link

I have understood your request 'Try setting to manual - then changing the frequency.' to be, set the Gain drop down box to be 'Man' (as opposed to 'Auto') and then make a change in sampling frequency, is that right?

In this case I would expect that the sampling rate would 'snap' to the nearest valid sample rate. This isn't what happens.

This is what I observe, when in Gain - Man mode:

  • With the radio capturing samples - if a sample rate change is made, the GUI doesn't change the frequency scale to match the newly selected bandwidth.
  • If I change the sample rate in 1MS/s steps some of the changes have noticable effects on the captured data and some have no noticable effects. It looks like the sample rate is changing but I don't believe that SDRangel is achieving the sample rate that the dials say that it is set to (because I know the hardware doesn't support that rate).

extract from log, when incrementing sample rate:

2022-06-23 11:35:17.708 (D) USRPInputGUI::updateHardware
2022-06-23 11:35:17.708 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-23 11:35:17.708 (D) USRPInputThread::run - received 81/256 samples
2022-06-23 11:35:17.709 (D) USRPInput::applySettings: set sample rate set to 3000000
2022-06-23 11:35:17.709 (D) USRPInputThread::run - received 112/256 samples
2022-06-23 11:35:17.709 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 11:35:17.709 (D) USRPInput::handleMessage config error
2022-06-23 11:35:19.238 (D) USRPInputGUI::updateHardware
2022-06-23 11:35:19.239 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-23 11:35:19.239 (D) USRPInput::applySettings: set sample rate set to 4000000
2022-06-23 11:35:19.239 (D) USRPInputThread::run - received 252/256 samples
2022-06-23 11:35:19.239 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 11:35:19.239 (D) USRPInputThread::run - received 13/256 samples
2022-06-23 11:35:19.239 (D) USRPInput::handleMessage config error
2022-06-23 11:35:20.306 (D) USRPInputGUI::updateHardware
2022-06-23 11:35:20.306 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-23 11:35:20.306 (D) USRPInput::applySettings: set sample rate set to 5000000
2022-06-23 11:35:20.306 (D) USRPInputThread::run - received 131/256 samples
2022-06-23 11:35:20.306 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 11:35:20.307 (D) USRPInputThread::run - received 171/256 samples
2022-06-23 11:35:20.307 (D) USRPInput::handleMessage config error

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 23, 2022

Is that log with the latest build? I would have expected a different error message. If it is that latest, it suggests the exception isn't being caught properly.

@Bob-Sellers
Copy link

Sorry, I've just seen your comment from here re: new version: #1293 (comment)

This log was from this version: sdrangel-7.3.2-2-g032b36ce7

I'll redo tests shortly

@Bob-Sellers
Copy link

Now using version: sdrangel-7.3.2-33-gee2043770-win64

extract from log, when incrementing sample rate:

2022-06-23 12:34:20.393 (D) DSPDeviceSourceEngine::gotoRunning: USRPInput started
2022-06-23 12:34:20.393 (D) USRPInput::suspendRxBuddies (0)
2022-06-23 12:34:20.393 (D) USRPInput::suspendTxBuddies (0)
2022-06-23 12:34:20.393 (D) USRPInput::applySettings: clock set to "internal"
2022-06-23 12:34:20.394 (D) USRPInput::applySettings: set sample rate set to 2000000
2022-06-23 12:34:20.394 (D) USRPInput::applySettings: frequency set to 93000000 with LO offset 0
2022-06-23 12:34:20.395 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 12:34:20.398 (D) USRPInput::acquireChannel: exception: LookupError: KeyError: Invalid TX channel: 0
2022-06-23 12:34:20.398 (D) USRPInput::resumeTxBuddies (0)
2022-06-23 12:34:20.398 (D) USRPInput::resumeRxBuddies (0)
2022-06-23 12:34:20.398 (D) USRPInput::start: thread created
2022-06-23 12:34:20.398 (D) USRPInputThread::issueStreamCmd start
2022-06-23 12:34:20.398 (D) USRPInputThread::startWork: stream started
2022-06-23 12:34:20.399 (D) DSPDeviceSourceEngine::gotoRunning: starting SpectrumVis
2022-06-23 12:34:20.399 (D) DSPDeviceSourceEngine::gotoRunning:input message queue pending: 0
2022-06-23 12:34:20.401 (D) SpectrumVis::handleMessage: DSPSignalNotification: centerFrequency: 93000000 sampleRate: 2000000
2022-06-23 12:34:20.401 (D) USRPInputGUI::handleInputMessages: DSPSignalNotification: SampleRate: 2000000, CenterFrequency: 93000000
2022-06-23 12:34:20.401 (D) GLSpectrumGUI::handleInputMessages: message: SpectrumVis::MsgStartStop
2022-06-23 12:34:20.401 (D) GLSpectrumGUI::handleInputMessages: message: GLSpectrum::MsgReportSampleRate
2022-06-23 12:34:23.708 (D) USRPInputGUI::updateHardware
2022-06-23 12:34:23.708 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-23 12:34:23.708 (D) USRPInputThread::run - received 241/256 samples
2022-06-23 12:34:23.708 (D) USRPInputThread::run - received 91/256 samples
2022-06-23 12:34:23.708 (D) USRPInput::applySettings: set sample rate set to 3000000
2022-06-23 12:34:23.709 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 12:34:23.709 (D) USRPInput::handleMessage config error
2022-06-23 12:34:24.739 (D) USRPInputGUI::updateHardware
2022-06-23 12:34:24.739 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-23 12:34:24.740 (D) USRPInputThread::run - received 141/256 samples
2022-06-23 12:34:24.740 (D) USRPInputThread::run - received 114/256 samples
2022-06-23 12:34:24.740 (D) USRPInput::applySettings: set sample rate set to 4000000
2022-06-23 12:34:24.740 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 12:34:24.741 (D) USRPInput::handleMessage config error
2022-06-23 12:34:25.537 (D) USRPInputGUI::updateHardware
2022-06-23 12:34:25.537 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-23 12:34:25.538 (D) USRPInput::applySettings: set sample rate set to 5000000
2022-06-23 12:34:25.538 (D) USRPInputThread::run - received 144/256 samples
2022-06-23 12:34:25.538 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 12:34:25.538 (D) USRPInput::handleMessage config error
2022-06-23 12:34:25.538 (D) USRPInputThread::run - received 96/256 samples
2022-06-23 12:34:29.489 (D) USRPInputGUI::updateHardware
2022-06-23 12:34:29.489 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-23 12:34:29.489 (D) USRPInput::applySettings: set sample rate set to 4000000
2022-06-23 12:34:29.490 (D) USRPInputThread::run - received 25/256 samples
2022-06-23 12:34:29.490 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 12:34:29.490 (D) USRPInputThread::run - received 63/256 samples
2022-06-23 12:34:29.490 (D) USRPInput::handleMessage config error
2022-06-23 12:34:30.202 (D) USRPInputGUI::updateHardware
2022-06-23 12:34:30.202 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-23 12:34:30.202 (D) USRPInputThread::run - received 217/256 samples
2022-06-23 12:34:30.202 (D) USRPInput::applySettings: set sample rate set to 3000000
2022-06-23 12:34:30.203 (D) USRPInputThread::run - received 36/256 samples
2022-06-23 12:34:30.203 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-23 12:34:30.203 (D) USRPInput::handleMessage config error
2022-06-23 12:34:32.000 (D) USRPInput::handleMessage: MsgStartStop: stop
2022-06-23 12:34:32.000 (D) DSPDeviceSourceEngine::stopAcquistion
2022-06-23 12:34:32.000 (D) DSPDeviceSourceEngine::handleSynchronousMessages: DSPAcquisitionStop
2022-06-23 12:34:32.001 (D) DSPDeviceSourceEngine::gotoIdle
2022-06-23 12:34:32.001 (D) USRPInput::stop
2022-06-23 12:34:32.001 (D) USRPInputThread::issueStreamCmd stop
2022-06-23 12:34:32.001 (D) USRPInputThread::stopWork: stream stopped
2022-06-23 12:34:32.001 (D) USRPInput::suspendRxBuddies (0)
2022-06-23 12:34:32.001 (D) USRPInput::suspendTxBuddies (0)
2022-06-23 12:34:32.001 (D) USRPInput::resumeTxBuddies (0)
2022-06-23 12:34:32.001 (D) USRPInput::resumeRxBuddies (0)
2022-06-23 12:34:32.001 (D) GLSpectrumGUI::handleInputMessages: message: SpectrumVis::MsgStartStop

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 24, 2022

I don't know why you are still getting that exception.

However, can you not just make sure you have Gain set to Man in the GUI before you start acquisition? That way it shouldn't occur.

@Bob-Sellers
Copy link

I have set the Gain to Man before starting the acquisition and I still get the exception.

I'm still using sdrangel-7.3.2-33-gee2043770-win64

Here's an extract from the log, where I set to Man before starting an acquisition, changed the sample rate and changed the gain setting:

2022-06-27 19:03:54.803 (D) DSPDeviceSourceEngine::initAcquisition
2022-06-27 19:03:54.804 (D) DSPDeviceSourceEngine::handleSynchronousMessages: DSPAcquisitionInit
2022-06-27 19:03:54.804 (D) DSPDeviceSourceEngine::gotoIdle
2022-06-27 19:03:54.804 (D) DSPDeviceSourceEngine::gotoInit: m_deviceDescription: USRPInput sampleRate: 2000000 centerFrequency: 435000000
2022-06-27 19:03:54.804 (D) DSPDeviceSourceEngine::gotoInit: initializing SpectrumVis
2022-06-27 19:03:54.804 (D) DSPDeviceSourceEngine::startAcquisition
2022-06-27 19:03:54.804 (D) DSPDeviceSourceEngine::handleSynchronousMessages: DSPAcquisitionStart
2022-06-27 19:03:54.804 (D) DSPDeviceSourceEngine::gotoRunning
2022-06-27 19:03:54.804 (D) DSPDeviceSourceEngine::gotoRunning: USRPInput started
2022-06-27 19:03:54.804 (D) USRPInput::suspendRxBuddies (0)
2022-06-27 19:03:54.804 (D) USRPInput::suspendTxBuddies (0)
2022-06-27 19:03:54.805 (D) USRPInput::applySettings: clock set to "internal"
2022-06-27 19:03:54.805 (D) USRPInput::applySettings: set sample rate set to 2000000
2022-06-27 19:03:54.817 (D) USRPInput::applySettings: frequency set to 435000000 with LO offset 0
2022-06-27 19:03:54.818 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-27 19:03:54.829 (D) USRPInput::acquireChannel: exception: LookupError: KeyError: Invalid TX channel: 0
2022-06-27 19:03:54.829 (D) USRPInput::resumeTxBuddies (0)
2022-06-27 19:03:54.829 (D) USRPInput::resumeRxBuddies (0)
2022-06-27 19:03:54.829 (D) USRPInput::start: thread created
2022-06-27 19:03:54.829 (D) USRPInputThread::issueStreamCmd start
2022-06-27 19:03:54.829 (D) USRPInputThread::startWork: stream started
2022-06-27 19:03:54.830 (D) DSPDeviceSourceEngine::gotoRunning: starting SpectrumVis
2022-06-27 19:03:54.830 (D) DSPDeviceSourceEngine::gotoRunning:input message queue pending: 0
2022-06-27 19:03:54.833 (D) SpectrumVis::handleMessage: DSPSignalNotification: centerFrequency: 435000000 sampleRate: 2000000
2022-06-27 19:03:54.833 (D) USRPInputGUI::handleInputMessages: DSPSignalNotification: SampleRate: 2000000, CenterFrequency: 435000000
2022-06-27 19:03:54.833 (D) GLSpectrumGUI::handleInputMessages: message: SpectrumVis::MsgStartStop
2022-06-27 19:03:54.833 (D) GLSpectrumGUI::handleInputMessages: message: GLSpectrum::MsgReportSampleRate
2022-06-27 19:03:54.863 (D) GLShaderSpectrogram::initGrid: requested: 1024 actual: 1024
2022-06-27 19:04:21.317 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:21.317 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:21.317 (D) USRPInputThread::run - received 26/256 samples
2022-06-27 19:04:21.317 (D) USRPInput::applySettings: set sample rate set to 3000000
2022-06-27 19:04:21.317 (D) USRPInputThread::run - received 10/256 samples
2022-06-27 19:04:21.317 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-27 19:04:21.317 (D) USRPInput::handleMessage config error
2022-06-27 19:04:26.686 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:26.686 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:26.687 (D) USRPInputThread::run - received 63/256 samples
2022-06-27 19:04:26.687 (D) USRPInput::applySettings: set sample rate set to 4000000
2022-06-27 19:04:26.687 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-27 19:04:26.687 (D) USRPInput::handleMessage config error
2022-06-27 19:04:26.687 (D) USRPInputThread::run - received 6/256 samples
2022-06-27 19:04:30.701 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:30.701 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:30.702 (D) USRPInputThread::run - received 82/256 samples
2022-06-27 19:04:30.702 (D) USRPInput::applySettings: set sample rate set to 5000000
2022-06-27 19:04:30.702 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-27 19:04:30.702 (D) USRPInputThread::run - received 71/256 samples
2022-06-27 19:04:30.702 (D) USRPInput::handleMessage config error
2022-06-27 19:04:31.270 (C) SampleSinkFifo::write: (USRPInput) overflow - dropping 128 samples
2022-06-27 19:04:32.666 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:32.666 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:32.666 (D) USRPInput::applySettings: set sample rate set to 4000000
2022-06-27 19:04:32.666 (D) USRPInputThread::run - received 120/256 samples
2022-06-27 19:04:32.667 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-27 19:04:32.667 (D) USRPInput::handleMessage config error
2022-06-27 19:04:32.667 (D) USRPInputThread::run - received 232/256 samples
2022-06-27 19:04:33.304 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:33.304 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:33.305 (D) USRPInputThread::run - received 41/256 samples
2022-06-27 19:04:33.305 (D) USRPInput::applySettings: set sample rate set to 3000000
2022-06-27 19:04:33.305 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-27 19:04:33.305 (D) USRPInputThread::run - received 68/256 samples
2022-06-27 19:04:33.305 (D) USRPInput::handleMessage config error
2022-06-27 19:04:34.058 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:34.058 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:34.058 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 50 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:45.958 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:45.958 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:45.963 (D) USRPInput::applySettings: Gain set to 60 for channel 0
2022-06-27 19:04:45.963 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 60 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:46.067 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:46.067 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:46.073 (D) USRPInput::applySettings: Gain set to 65 for channel 0
2022-06-27 19:04:46.073 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 65 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:46.826 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:46.826 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:46.834 (D) USRPInput::applySettings: Gain set to 89 for channel 0
2022-06-27 19:04:46.834 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 89 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:46.943 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:46.943 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:46.946 (D) USRPInput::applySettings: Gain set to 99 for channel 0
2022-06-27 19:04:46.946 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 99 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:47.659 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:47.659 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:47.661 (D) USRPInput::applySettings: Gain set to 90 for channel 0
2022-06-27 19:04:47.661 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 90 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:47.775 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:47.775 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:47.783 (D) USRPInput::applySettings: Gain set to 65 for channel 0
2022-06-27 19:04:47.783 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 65 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:47.892 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:47.892 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:47.900 (D) USRPInput::applySettings: Gain set to 50 for channel 0
2022-06-27 19:04:47.900 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 50 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:48.005 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:48.005 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:48.007 (D) USRPInput::applySettings: Gain set to 44 for channel 0
2022-06-27 19:04:48.007 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 44 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false
2022-06-27 19:04:48.146 (D) USRPInputGUI::updateHardware
2022-06-27 19:04:48.146 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:04:48.148 (D) USRPInput::applySettings: Gain set to 42 for channel 0
2022-06-27 19:04:48.148 (D) USRPInput::applySettings: center freq: 435000000 Hz m_transverterMode: false m_transverterDeltaFrequency: 0 deviceCenterFrequency: 435000000 device stream sample rate: 2,000,000 S/s sample rate with soft decimation: 2,000,000 S/s m_log2SoftDecim: 0 m_gain: 42 m_lpfBW: 10,000,000 m_antennaPath: TX/RX m_clockSource: internal force: false

@Bob-Sellers
Copy link

Just tried this with the sdrangel-7.4.0-win64 release, with the same results.

2022-06-27 19:19:36.973 (D) USRPInputGUI::updateHardware
2022-06-27 19:19:36.973 (D) USRPInput::handleMessage: MsgConfigureUSRP
2022-06-27 19:19:36.973 (D) USRPInputThread::run - received 153/256 samples
2022-06-27 19:19:36.973 (D) USRPInputThread::run - received 96/256 samples
2022-06-27 19:19:36.974 (D) USRPInput::applySettings: set sample rate set to 3000000
2022-06-27 19:19:36.974 (D) USRPInput::applySettings: exception: RuntimeError: NotImplementedError: set_rx_agc() is not supported on this radio!
2022-06-27 19:19:36.974 (D) USRPInput::handleMessage config error

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 27, 2022

Are you using the version of UHD that is included with sdrangel or another?

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 28, 2022

@f4exb - Could you please merge f4exb/sdrangel-windows-libraries#14 in to your sdrangel-windows-libraries?

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 28, 2022

Here's a build with UHD 4.2.0 included - https://github.com/f4exb/sdrangel/suites/7123330160/artifacts/282663595

Please give that a try without changing the UHD DLL. There may be a binary incompatibility if you change it.

@Bob-Sellers
Copy link

Are you using the version of UHD that is included with sdrangel or another?

I was using the uhd.dll from UHD 4.2.0 that I had copied into the SDRangel directory.

The included uhd.dll seemed to illuminate the incorrect receive port on my radio. This was corrected when I used the more up to date file.

@Bob-Sellers
Copy link

Here's a build with UHD 4.2.0 included - https://github.com/f4exb/sdrangel/suites/7123330160/artifacts/282663595

Please give that a try without changing the UHD DLL. There may be a binary incompatibility if you change it.

Just tried this and it seems to work as I expected.

  • The problems I had with the old bundled uhd.dll have been resolved - the correct led illuminates next to to the active receive port.
  • I still get the 'set_rx_agc() is not supported on this radio!' exception in the log, when I make changes to the sample rate
  • The spectrum bandwidth scale doesn't change when sample rate changes are made
  • sample rates are selectable in the GUI which the hardware cannot achieve (and there is no warning of this disparity)

@Bob-Sellers
Copy link

Just been reading some UHD documentation re: set_rx_agc()

https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html#abdab1f6c3775a9071b15c9805f866486

An attempt to call set_rx_agc() on a radio without AGC will result in an exception. set_rx_agc() is called in both the if and the else clause, lines 828 and 838 respectively. Presumably this is why I'm getting an exception?

if (settings.m_gainMode == USRPInputSettings::GAIN_AUTO)
{
try
{
m_deviceShared.m_deviceParams->getDevice()->set_rx_agc(true, m_deviceShared.m_channel);
qDebug() << "USRPInput::applySettings: AGC enabled for channel " << m_deviceShared.m_channel;
}
catch (uhd::not_implemented_error &e)
{
qDebug() << "USRPInput::applySettings: AGC not implemented on this radio. Please set to manual.";
}
}
else
{
m_deviceShared.m_deviceParams->getDevice()->set_rx_agc(false, m_deviceShared.m_channel);
m_deviceShared.m_deviceParams->getDevice()->set_rx_gain(settings.m_gain, m_deviceShared.m_channel);
qDebug() << "USRPInput::applySettings: AGC disabled for channel " << m_deviceShared.m_channel << " set to " << settings.m_gain;
}

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 29, 2022

.

@srcejon
Copy link
Collaborator Author

srcejon commented Jun 29, 2022

Hang on - there's another path! I'll fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USRP X310 - failed to open device
3 participants