private void initTuners(){
  DeviceList deviceList=new DeviceList();
  int result=LibUsb.init(null);
  if (result != LibUsb.SUCCESS) {
    mLog.error("unable to initialize libusb [" + LibUsb.errorName(result) + "]");
  }
 else {
    mLog.info("LibUSB API Version: " + LibUsb.getApiVersion());
    mLog.info("LibUSB Version: " + LibUsb.getVersion());
    result=LibUsb.getDeviceList(null,deviceList);
    if (result < 0) {
      mLog.error("unable to get device list from libusb [" + result + " / "+ LibUsb.errorName(result)+ "]");
    }
 else {
      mLog.info("discovered [" + result + "] attached USB devices");
    }
  }
  for (  Device device : deviceList) {
    DeviceDescriptor descriptor=new DeviceDescriptor();
    result=LibUsb.getDeviceDescriptor(device,descriptor);
    if (result != LibUsb.SUCCESS) {
      mLog.error("unable to read device descriptor [" + LibUsb.errorName(result) + "]");
    }
 else {
      TunerInitStatus status=initTuner(device,descriptor);
      StringBuilder sb=new StringBuilder();
      sb.append("usb device [");
      sb.append(String.format("%04X",descriptor.idVendor()));
      sb.append(":");
      sb.append(String.format("%04X",descriptor.idProduct()));
      if (status.isLoaded()) {
        Tuner tuner=status.getTuner();
        try {
          mTunerModel.addTuner(tuner);
          sb.append("] LOADED: ");
          sb.append(tuner.toString());
        }
 catch (        Exception e) {
          sb.append("] NOT LOADED: ");
          sb.append(status.getInfo());
          sb.append(" Error:" + e.getMessage());
        }
      }
 else {
        sb.append("] NOT LOADED: ");
        sb.append(status.getInfo());
      }
      mLog.info(sb.toString());
    }
  }
  LibUsb.freeDeviceList(deviceList,true);
}

private void initTuners ( ) { DeviceList deviceList = new DeviceList ( ) ; int result = LibUsb . init ( null ) ; if ( result != LibUsb . SUCCESS ) { mLog . error ( "unable to initialize libusb [" + LibUsb . errorName ( result ) + "]" ) ; } else { mLog . info ( "LibUSB API Version: " + LibUsb . getApiVersion ( ) ) ; mLog . info ( "LibUSB Version: " + LibUsb . getVersion ( ) ) ; result = LibUsb . getDeviceList ( null , deviceList ) ; if ( result < 0 ) { mLog . error ( "unable to get device list from libusb [" + result + " / " + LibUsb . errorName ( result ) + "]" ) ; } else { mLog . info ( "discovered [" + result + "] attached USB devices" ) ; } } for ( Device device : deviceList ) { DeviceDescriptor descriptor = new DeviceDescriptor ( ) ; result = LibUsb . getDeviceDescriptor ( device , descriptor ) ; if ( result != LibUsb . SUCCESS ) { mLog . error ( "unable to read device descriptor [" + LibUsb . errorName ( result ) + "]" ) ; } else { TunerInitStatus status = initTuner ( device , descriptor ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "usb device [" ) ; sb . append ( String . format ( "%04X" , descriptor . idVendor ( ) ) ) ; sb . append ( ":" ) ; sb . append ( String . format ( "%04X" , descriptor . idProduct ( ) ) ) ; if ( status . isLoaded ( ) ) { Tuner tuner = status . getTuner ( ) ; try { mTunerModel . addTuner ( tuner ) ; sb . append ( "] LOADED: " ) ; sb . append ( tuner . toString ( ) ) ; } catch ( Exception e ) { sb . append ( "] NOT LOADED: " ) ; sb . append ( status . getInfo ( ) ) ; sb . append ( " Error:" + e . getMessage ( ) ) ; } } else { sb . append ( "] NOT LOADED: " ) ; sb . append ( status . getInfo ( ) ) ; } mLog . info ( sb . toString ( ) ) ; } } LibUsb . freeDeviceList ( deviceList , true ) ; }
loads all usb tuners and usb / mixer tuner devices
