EttusResearch / uhd

The USRP™ Hardware Driver Repository
http://uhd.ettus.com
Other
946 stars 646 forks source link

UHD fails with multiple USRPs in GNU Radio flowgraph with sink and source #629

Open jdemel opened 1 year ago

jdemel commented 1 year ago

Issue Description

In GNU Radio, it is not possible to use two N310s with both sinks and source. UHD fails and claims it cannot create either the sink or source, whatever comes last.

Setup Details

A GNU Radio flowgraph with a UHD sink and source. A device string that specifies addr0=...,addr1=... triggers this issue.

Expected Behavior

Initialize both USRPs and run a flowgraph. The same configuration works with e.g. benchmark_rate.

Actual Behaviour

UHD throws an error that the device is already claimed.

Steps to reproduce the problem

Additional Information

https://github.com/EttusResearch/uhd/blob/dfc7b31cfb9a5a001f0786a1ad963b93aad871a6/host/lib/device.cpp#L49-L53

This would fix it:

            if (std::find_if(hash_key_blacklist.begin(),
                    hash_key_blacklist.end(),
                    [key](std::string i) { return key.find(i) != std::string::npos; })
                == hash_key_blacklist.end()) {
                boost::hash_combine(hash, key);
                boost::hash_combine(hash, dev_addr[key]);
            }