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

Mirics chipset based blue (dolphin) MSI.SDR receiver (libmiri) is initialized with wrong flavour. #2127

Closed
Peter3579 opened this issue May 26, 2024 · 7 comments

Comments

@Peter3579
Copy link

$ lsusb
Bus 003 Device 009: ID 1df7:2500 SDRplay RSP1

The following change fixed it for me:

diff --git a/plugins/samplesource/sdrplay/sdrplayinput.cpp b/plugins/samplesource/sdrplay/sdrplayinput.cpp
index 41d6f4437..a02537a8e 100644
--- a/plugins/samplesource/sdrplay/sdrplayinput.cpp
+++ b/plugins/samplesource/sdrplay/sdrplayinput.cpp
@@ -110,12 +110,6 @@ bool SDRPlayInput::openDevice()
         return false;
     }
 
-    if ((res = mirisdr_set_hw_flavour(m_dev, MIRISDR_HW_SDRPLAY)) < 0)
-    {
-        qCritical("SDRPlayInput::openDevice: failed to set HW flavour: %s", strerror(errno));
-        return false;
-    }
-
     char vendor[256];
     char product[256];
     char serial[256];
@@ -142,6 +136,12 @@ bool SDRPlayInput::openDevice()
         m_variant = SDRPlayRSP1;
     }
 
+    if ((res = mirisdr_set_hw_flavour(m_dev, (m_variant == SDRPlayRSP1)?  MIRISDR_HW_DEFAULT : MIRISDR_HW_SDRPLAY)) < 0)
+    {
+        qCritical("SDRPlayInput::openDevice: failed to set HW flavour: %s", strerror(errno));
+        return false;
+    }
+
     qDebug("SDRPlayInput::openDevice: m_variant: %d", (int) m_variant);
 
     return true;

@f4exb
Copy link
Owner

f4exb commented May 31, 2024

It works for me with MIRISDR_HW_SDRPLAY

@Peter3579
Copy link
Author

Well, I don't have a receiver stick from SDRPlay.com but a Chinese alternative. Could that make the difference? The Soapy driver allows to select the needed flavour. If you say your stick also identifies with 1df7:2500 but needs the MIRISDR_HW_SDRPLAY. then my patch does not work for you and maybe a lot of others.

@f4exb
Copy link
Owner

f4exb commented Jun 1, 2024

I do tested with the blue "Dolphin" Chinese clone and it does identify as 1df7:2500
dmesg:

[137332.627053] usb 1-1.4.4: new high-speed USB device number 26 using xhci_hcd
[137332.751590] usb 1-1.4.4: New USB device found, idVendor=1df7, idProduct=2500, bcdDevice= 2.00
[137332.751604] usb 1-1.4.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0

lsusb:

Bus 001 Device 026: ID 1df7:2500 SDRplay RSP1 

@Peter3579
Copy link
Author

My functionality tests are on VHF and higher since I currently don't have a HF antenna. For instance, I can't receive any 100 MHz FM broadcast station with MIRISDR_HW_SDRPLAY. Just the noise floor is visible in the spectrum (and changes with the gain setting).

According to the hw_switch_freq_plan in soft.c the MSI2500 GPIO-bits are selecting (in general) different RF filter paths with MIRISDR_HW_SDRPLAY and MIRISDR_HW_DEFAULT, respectively. So it might be that it makes no difference at your test frequency. Or the circuit of the Chinese clone receiver has (silently) changed in the meantime.

@f4exb
Copy link
Owner

f4exb commented Jun 2, 2024

OK... I did not really pay attention to the actual data. Indeed this seems to fix the problem.

@f4exb f4exb closed this as completed in ade3eed Jun 2, 2024
@ericek111
Copy link
Contributor

What clone do you have, please, that does not work with the default flavour? I have both the blue dolphin and the DIP-switch ones, and both work fine without changing the flavour.

I'd like to know what exactly does hw_switch_freq_plan do.

@Peter3579
Copy link
Author

Peter3579 commented Jun 7, 2024

Hi Erik,
The issue was that the flavour MIRISDR_HW_SDRPLAY was set whilst MIRISDR_HW_DEFAULT was needed.

The hw_switch_freq_plan located in libmiri/src/soft.c sets, depending on the flavour, the strategy how the tuner is configured and the GPIO-pins for selecting the right "frontent" are set. The frontend selection is what you do manually with the DIP switches at you other clone. The GPIO-setting is the very last entry in the struct below. The corresponding frequency bands in MHz are coded the first entry.

typedef struct
{
    uint32_t low_cut;
    int mode;
    int upconvert_mixer_on;
    int am_port;
    int lo_div;
    uint32_t band_select_word;
} hw_switch_freq_plan_t;

hw_switch_freq_plan_t hw_switch_freq_plan_default[] = {
        {0,    MIRISDR_MODE_AM,  MIRISDR_UPCONVERT_MIXER_ON, MIRISDR_AM_PORT2, 16, 0xf780},
        {12,   MIRISDR_MODE_AM,  MIRISDR_UPCONVERT_MIXER_ON, MIRISDR_AM_PORT2, 16, 0xff80},
        {30,   MIRISDR_MODE_AM,  MIRISDR_UPCONVERT_MIXER_ON, MIRISDR_AM_PORT2, 16, 0xf280},
        {50,   MIRISDR_MODE_VHF, 0, 0, 32, 0xf380},
        {108,  MIRISDR_MODE_B3,  0, 0, 16, 0xfa80},
        {250,  MIRISDR_MODE_B3,  0, 0, 16, 0xf680},
        {259,  6              ,  0, 0, 8,  0xf680},
        {330,  MIRISDR_MODE_B45, 0, 0, 4,  0xf380},
        {960,  MIRISDR_MODE_BL,  0, 0, 2,  0xfa80},
        {2400, -1, 0, 0, 0, 0x0000},
};

To answer your first question: It is the blue aluminium case china clone (MSI.SDR Panadapter) with the white dolphin on 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

No branches or pull requests

3 participants