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

SDRPlayV3 API doesn't support multiple devices #2346

Open
ijessen-mitll opened this issue Dec 2, 2024 · 4 comments
Open

SDRPlayV3 API doesn't support multiple devices #2346

ijessen-mitll opened this issue Dec 2, 2024 · 4 comments

Comments

@ijessen-mitll
Copy link

SDRPlayV3 API doesn't seem to support multiple devices within a single application.

While not strictly documented, this seems to be inherent in the API - I've written a small test application which confirms that once a device is selected, no further devices can be successfully selected by the same application.

#include "sdrplay_api.h"
#include <stdio.h>

int main()
{

    sdrplay_api_DeviceT devs[4];
    unsigned int ndev;
    int i;
    sdrplay_api_ErrT err;
    sdrplay_api_DeviceParamsT *deviceParams = NULL;
    sdrplay_api_DeviceT *chosenDevice = NULL;

    if ((err = sdrplay_api_Open()) != sdrplay_api_Success)
    {
        printf("sdrplay_api_Open failed %s\n", sdrplay_api_GetErrorString(err));
    }
    else
    {
        if ((err = sdrplay_api_DebugEnable(NULL, sdrplay_api_DbgLvl_Verbose)) != sdrplay_api_Success)
        {
            printf("sdrplay_api_DebugEnable failed %s\n", sdrplay_api_GetErrorString(err));
        }

        sdrplay_api_LockDeviceApi();
        // Fetch list of available devices
        if ((err = sdrplay_api_GetDevices(devs, &ndev, sizeof(devs) / sizeof(sdrplay_api_DeviceT))) != sdrplay_api_Success)
        {
            printf("sdrplay_api_GetDevices failed %s\n", sdrplay_api_GetErrorString(err));
            goto UnlockDeviceAndCloseApi;
        }
        printf("number of devices found: %d\n", ndev);

        for (int i = 0; i < ndev; ++i)
        {
            chosenDevice = &devs[i];

            // Select chosen device
            if ((err = sdrplay_api_SelectDevice(chosenDevice)) != sdrplay_api_Success)
            {
                printf("sdrplay_api_SelectDevice %d failed %s: %s\n", i+1, sdrplay_api_GetErrorString(err), sdrplay_api_GetLastError(chosenDevice)->message);
                goto UnlockDeviceAndCloseApi;
            }
        }
    }

UnlockDeviceAndCloseApi:
    // Unlock API
    sdrplay_api_UnlockDeviceApi();
CloseApi:
    // Close API
    sdrplay_api_Close();

    return 0;
}

The sdrangel plugin is written to allow multiple instances connected to multiple devices. However, any instance besides the first to be started will fail.

My suggestion is that sdrangel not enumerate any additional SDRPlay devices once the first has been selected (or at least make them unselectable).

@srcejon
Copy link
Collaborator

srcejon commented Dec 2, 2024

Do you know if SDRconnect supports multiple devices?

@ijessen-mitll
Copy link
Author

The SDRconnect interface locks out the device selection dropdown once an RSP1b has been selected - so no, it doesn't seem to support multiple simultaneous devices (other than the dual tuners of an RSPduo, of course).

@MichSouth
Copy link

I have a RSPduo but I cannot select a second RSPduo to use the second tuner?

@srcejon
Copy link
Collaborator

srcejon commented Dec 14, 2024

SDRangel only supports one of RSPduo's tuners at a time, currently.

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