-
Notifications
You must be signed in to change notification settings - Fork 15
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
2 Mhz samplerate + Bandwidth auto mismatch #84
Comments
@nmaster2042 - that's very odd. If you don't mind, please add this line immediately after line 995 in Settings.cpp (https://github.com/pothosware/SoapySDRPlay3/blob/master/Settings.cpp#L995):
After that, please rebuild and reinstall this SoapySDRPlay3 module. Then run SDR++ again with the same configuration that is giving you this problem; it should print one or more debug lines in the terminal with the information about requested bandwidth and selected bandwidth. Please post them here, so we can try to figure out what's going on. Franco |
I added the log line you provided. Here is the printed log on the console when selecting 2 Mhz samplerate and Auto for Bandwidth:
If I chose 2.05Mhz samplerate, no issue, and the log on the console is like this:
It is coherent with previous logs coming from SDR++ soapy_source. My question is that I think when 2 Mhz samplerate is selected, and badwidth is set to auto, it should be 1.54Mhz, not 5 Mhz. Shouldn't it be ? I hope my tests can help. |
@nmaster2042 - thanks for your logs. From what I see there, it looks like SDR++ is calling the I don't know how SDR++ comes up with that value of the requested bandwidth (5MHz), but I don't think it is a good value because of the aliasing problem with a sample rate of just 2MHz. In the GNU Radio OOT module I wrote for the SDRplay RSPs ( Franco |
@fventuri I don't know how the value of 5 Mhz is selected. The soapy_source is not specific to sdrplay. Here is the code in the source module about BW and SR. If my understanding is good, if Auto is selected for BW, it passes 0 as value.
|
I made a try with GQRX. I select Input rate = 2000000 and bandwidth = 0,000000 MHz (to let driver select the matching BW). Here is the log from the line you asked me to insert
There is 2 calls but the second one give the good values and good work in gqrx. |
@nmaster2042 - thanks for your research work on SDR++ and gqrx. In the source code for SDR++ can you find the call to Franco |
@fventuri I had to add 2 points because there is 2 case with dev->setBandwith(), see below
Now go back to the tests.
Last line is my printf, the 2 lines with date is log from soapy_source and the one begining by [INFO] is the log you asked me to add in the soapySDRPlay driver.
First line is log from SSoapySDRPlay driver I don't understand where the 5 Mhz BW is coming from. Moreover there is no issue with other soapy devices. Hopes this can help. |
@nmaster2042 - thanks for your diligent work and your help debugging this issue. Looking at that code from SDR++, I have the impression that the problem might be in the SDR++ function At this point I think you may want to create an issue in the SDR++ repository about that function.
Franco |
@fventuri I added a point before _this->sampleRates Now the code looks like this:
Now, starting SDR++, on console I see:
The first log is the point I just added before setting SR. It's the IF part where it passes when Auto is selected for bandwidth. |
Now same test but selecting SR = 1 Mhz, BW = auto
And this working fine. |
More exhaustive tests. SR 62.5 khz, BW = auto,
SR 96 khz, BW = auto,
SR 125 khz, BW = auto,
SR 192 khz, BW = auto,
SR 250 khz, BW = auto,
SR 384 khz, BW = auto
SR 500 khz, BW = auto
SR 768 khz, BW = auto
SR 1Mhz, BW = auto
SR 2Mhz, BW = auto, BAD
SR 2.05Mhz, BW = auto,
SR 3Mhz, BW = auto,
SR 4Mhz, BW = auto,
SR 5Mhz, BW = auto,
SR 6Mhz, BW = auto,
SR 7Mhz, BW = auto,
SR 8Mhz, BW = auto,
SR 9Mhz, BW = auto, BAD
SR 10Mhz, BW = auto, BAD
The real BW used by soapySDRPlay driver is the last line of each log block. |
@nmaster2042 - thanks for your extensive tests and the detailed logging. It looks like the SDR++ method If you haven't already created an issue with SDR++, perhaps it is time to take a look at the internals of that One more thing: SDR++ also supports the SDRplay API natively (instead of using SoapySDR); I think using the native API is probably a better choice because it skips the SoapySDR middleman. I wonder if you already tried this approach instead of SoapySDR, and if you had the same problems with it. Franco |
@fventuri: There will be no issue opened on SDR++ repository because the author said long time ago he doesn't want to maintain this because he wrote support for a lot of SDRs. He also noticed this make a lot of issues (conflict between soapy and native sources sometimes. on the official repository, soapy_source has never be finished: string args was never implemented this was introduced in a fork. But it the author choice, and I totally respect this. SDR++ Author is adding support for new devices given to him, but he can't have all SDRs arround, even if his SDR collection is already large. In my opinion, soapy_source is sill an option to get support for other SDRs, even if ti's not the best one compared to native support. Here is the last saopy_source development: sannysanoff/SDRPlusPlusBrown#11 Now on this fork, for soapy _source we have:
That's why I still have interest in this source module even if it's no more an official one. Ex: the new RSP1B I just bought. I will make tests for the BW selection, the main issue will be not to break other soapy device where BW selection in auto mode has no issue. I think this module would be worth to be maintaining in Out of tree module. I hope this will be the case. Thank you for your share, and advises about this issue I discovered. |
Hi.
Usig SDR++ with Soapy source I found there is a mismatch when selecting 2Mhz samplerate while letting bandwidth as Auto.
In logs on console we can read:
[31/03/2024 00:22:18.000] [INFO] Bandwidth for samplerate 2000000.000000 is 5000000.000000
But I think it should be 1.54 Mhz, isn't it ?
To have good waterfall I must select manually BW of 1.54 Mhz.
If I chose sample rate of 2.05 Mhz (actually 2048 khz) while letting bandwidth as Auto, things are going well, we have in logs:
[31/03/2024 00:22:36.000] [INFO] Bandwidth for samplerate 2048000.000000 is 5000000.000000
This seems to be the correct combination in this case.
I used a RSP2, the last SDRPlay 3.14 API and the last SoapySDRPlay driver.
The text was updated successfully, but these errors were encountered: