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

SDRangel restores LimeSDR[0:0] on startup rather than LimeSDR[0:1] #1066

Closed
srcejon opened this issue Nov 29, 2021 · 5 comments
Closed

SDRangel restores LimeSDR[0:0] on startup rather than LimeSDR[0:1] #1066

srcejon opened this issue Nov 29, 2021 · 5 comments
Milestone

Comments

@srcejon
Copy link
Collaborator

srcejon commented Nov 29, 2021

SDRangel typically restores the last DeviceSet that was being used when re-started.

One example of where this doesn't quite happen, is for LimeSDR and USRP that have multiple channels. It seems [0:0] is always restored, even if [0:1] was last used.

@f4exb
Copy link
Owner

f4exb commented Nov 29, 2021

How comes you get the second Rx ([0:1]) on the first tab R0? This is normally impossible. When you change to LimeSDR in R0 it always get the first Rx ([0,0]) to open the second you need to do it in another tab and as you know SDRangel only restores the first tab (R0) at re-start.

@srcejon
Copy link
Collaborator Author

srcejon commented Nov 29, 2021

Just press the select sampling device then select Lime/USRP[0:1]

@f4exb
Copy link
Owner

f4exb commented Nov 29, 2021

Ah yes... each Rx is seen as a different device in the list of devices. On save/restore the current device selection should be saved also. In the case of single channel devices if for example you had a RTL-SDR then it comes back with a RTL-SDR. This should be the same in this case taking into account the device subsystem (first or second channel).

@f4exb
Copy link
Owner

f4exb commented Dec 5, 2021

The Rx (or Tx) number is what is called the deviceItemIndex in the SamplingDevice structure that represents the "device" in the device set: https://github.com/f4exb/sdrangel/blob/master/sdrbase/plugin/plugininterface.h#L67

However this information is not retained in the DeviceConfig structure of a Preset: https://github.com/f4exb/sdrangel/blob/master/sdrbase/settings/preset.h#L41

The save/restore mechanism uses a Preset to save and restore the information and therefore the deviceItemIndex is not retained. When restoring it will take the first index (0).

Correction: this part is wrong it is only that the information saved for a device in a preset will not be tied to the sub-device.

@f4exb
Copy link
Owner

f4exb commented Dec 5, 2021

In fact this happens here: https://github.com/f4exb/sdrangel/blob/master/sdrgui/mainwindow.cpp#L233 and then the settings for the device once selected are applied from the working preset. getRxSamplingDeviceIndex does the job of finding the right device.

Issue is similar to what happens with presets. The information retained is the device URI e.g sdrangel.samplesource.limesdr and the "sequence" which is the sequence of the whole device for the same URI.

The information is saved here: https://github.com/f4exb/sdrangel/blob/master/sdrgui/mainwindow.cpp#L1990

@f4exb f4exb closed this as completed in fcdeffa Dec 5, 2021
@f4exb f4exb added this to the v6.17.5 milestone Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants