run two instances of HDSDR at once?

527 views
Skip to first unread message

John Beale

unread,
May 24, 2012, 1:45:40 AM5/24/12
to ultra-c...@googlegroups.com
I have two different RTL2832U tuner sticks. Can I run two instances of HDSDR at once? If so how? The first one starts OK but the second instance fails with "cannot create device [...] libusb_claim_interface(devh,0)".

The reason I want two running at once is to compare the received signal frequency to see if a frequency drift is from the transmitter or in the receiver.  I suppose I can just use two separate computers, but it would be convenient if there was a way with only one.

Adam Nielsen

unread,
May 24, 2012, 2:33:25 AM5/24/12
to ultra-c...@googlegroups.com
> I have two different RTL2832U tuner sticks. Can I run two instances of
> HDSDR at once? If so how? The first one starts OK but the second
> instance fails with "cannot create device [...]
> libusb_claim_interface(devh,0)".

Do they have different USB IDs? If so, you might be able to get away
with specifying the VID and PID in the device hint, so that HDSDR will
bind to a specific device instead of just "the first one".

Otherwise, you may be able to work around it by changing the order you
plug the devices in. Try this:

1. Plug both devices in and run HDSDR.

2. Find out which one the first HDSDR instance is using (you can do
this by unplugging both devices one at a time, and see which one causes
HDSDR to stop working.)

3. Plug in the second one (the one that didn't affect HDSDR when it
was unplugged) and launch HDSDR. Make sure you plug it back in to the
same USB port it was in before.

4. Plug in the first one (which broke HDSDR in step 2) and run the
second instance of HDSDR. Again, plug it into the same USB port it was
in before.

This should work, but only if the devices are enumerated in USB-bus
order. If it's using some other order it probably won't help. Try it
and let me know if it works!

Cheers,
Adam.

Bob R

unread,
May 30, 2012, 4:58:00 PM5/30/12
to ultra-c...@googlegroups.com
Hi Adam,

I have a bit of a dongle glut going on, four of them are from the same company and the other is different.  However, they are all 'ezcap' workalikes and are identified as such by ExtIO.

Using two different dongles was super easy.  Plug them in, fire up two instances of HDSDR and go.

I did not have success using dongles from the same manufacturer, however.  I tried using your suggested sequence below, but it did not seem to work.  Seemingly no matter what order the devices are inserted or initialized in ExtIO, the second one always hangs and/or throws an error.  I did try Ian's RTL driver for SDR Sharp and it behaved similarly.

It would be nice if this worked!

Thanks

Youssef

unread,
May 31, 2012, 11:46:50 AM5/31/12
to ultra-c...@googlegroups.com
You can run as many instances as connected dongles you have. Just don't use the ExtIO. Use the native RTLSDR support. No extra files needed.

Youssef

Bob R

unread,
May 31, 2012, 1:26:09 PM5/31/12
to ultra-c...@googlegroups.com
Ah!  I didn't have success the first time around and figured it was just a limitation in libusb or something.

When you open the second instance of SDRSharp and pick RTL as the frontend, it attempts to run Open() with DeviceIndex set to 0.  As this is already in use, the open fails and returns a _dev of "0".  This reference doesn't store samplerate, so the soundcard sample rate doesn't get set correctly (samplerate/decimation = 0) and you get a port audio error.

The workaround is to start the second copy of sdrsharp, click the rtl frontend in the combo box, click the frontend button, select the unused dongle, close the controller gui, select 'Other' front end, and then re-select the RTL frontend.  This will re-run Open().

I 'fixed' it by commenting out the following in RtlSdrIO.cs:

                    //if (_dev != IntPtr.Zero)
                    //{
                        Close();
                        Open();
                    //}

It should probably add a test to find the first available dongle on startup, rather than the first index, but i don't really want to dig that deep at this time.

Thanks!

Bob R

unread,
May 31, 2012, 2:44:23 PM5/31/12
to ultra-c...@googlegroups.com
Video of two running simultaneously - http://www.youtube.com/watch?v=vBUWB_6-cXU

I'm going to do some 'stress tests' on another machine later to see how many dongles I can realistically operate at one time (I have five functional ones and one with a broken antenna connection that still spits out samples).

(sorry for the cheesy narration, it was faster than typing all of those boxes)
Reply all
Reply to author
Forward
0 new messages