[Solved] Start/Stop problem with LimeSDRmini in OSX Environment #osx

Fabio IZ0IBA 2220156

As many have reported using the LimeSDRmini in an OSX environment RX and TX is possible only the very first time the device is plugged in the USB port.
It is not possibile to resume operation. Hitting the Green triangle button result in TIMEOUT messages in the console debug listing. 

After many experiments, trial and errors and thanks to the Myriad RF Discussion Forum a solution has been found !!!
When the stop button is pressed the libusb driver send a ClearPipeStallBothEnds() message. For this to work it is necessary that device implement the ClearFeature Usb message to 
handle properly the command. Some experiments show that are devices that do not handle the request to clear the stall condition. So the USB endpoint remain in a stalled state and 
it is not possible to recover until disconnection and re-enumeration process. 

As a Fix it possible to modify the libusb stack to avoid sending the ClearPipeStallBothEnds() message. Doing so the endpoints remain cleared and reception and transmission is possible on the
next stream activation.

To do the fix it necessary to download the libusb source from  in the download section. The tarball at this time is 
untar in a directory of your choice, say $PWD and open the file. 


Search for "ClearPipeStallBothEnd" and you will find this line 
kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef); 

it appear in two place only 
In both play comment the line and modify as follow 
kresult = 0;

Save the file, recompile the libusb library with the command
make -j4 
sudo make install

All software that dynamically link the library will work soon, while application that statically link the library need to be recompiled.
(To be sure .. recompile all) 

At restart SDRAngel will start and stop the LimeSDRmini as many times you want. 

Honestly this mod get rid of the ClearPipeStallBothEnd forever but it is possible that some devices will require soon or later this USB message to work 
properly so some side-effects could be generated. Let consider this a temporary workaround while community understand how to make possible for LimeSDRmini
to handle properly the ClearFeature.

73, Fabio IZ0IBA


Žiga S.

Hi Fabio,

Thanks, it is a very nice information and I acknowledge the consequences in my mojave-build.

I am writing a script, to build up env in mojave, to prepare my build env.
(Maybe some other day will prepare repo support, with manifest.xml,
 to get more standardized way of putting together all the deps...) 

As I have decided to build everysingle lib, no macports/brew/tralala, there we have full control over source.
Thatway I can release this kind of quick workarounds, quite easy and with no pain :)

Cheerz, z