[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  https://libusb.info  in the download section. The tarball at this time is libusb-1.0.22.tar.bz 
untar in a directory of your choice, say $PWD and open the file. 

$PWD/libusb-1.0.22/libusb/os/darwin_usb.c 

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
./configure
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
 




  

Join sdrangel@groups.io to automatically receive all group messages.