Benjamin-Dobell / Heimdall

Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy devices.
MIT License
2.56k stars 584 forks source link

Building with qt4 OSX - workaround for no frontend #269

Open Liontooth opened 9 years ago

Liontooth commented 9 years ago

Is there a way to use qt4 instead of qt5?

I use macports' qt4-mac. Macports currently does not support parallel installation of qt4 and qt5, and lots of applications still depend on qt4.

As a workaround, I removed heimdall-frontend from CMakeLists.txt (note dependencies):

cmake_minimum_required(VERSION 2.8.4)

set(CMAKE_MODULE_PATH
    ${CMAKE_SOURCE_DIR}/cmake
    ${CMAKE_MODULE_PATH})

project(Heimdall)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_subdirectory(libpit)
add_subdirectory(heimdall)

add_dependencies(heimdall heimdall)

and successfully compiled heimdall.

BTW this version still has the same problem as the official release with OSX 10.9.5 and T989:

libusbx: error [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access

If I unload these:

sudo kextunload -b com.devguru.driver.SamsungComposite
sudo kextunload -b com.devguru.driver.SamsungACMData
sudo kextunload -b com.devguru.driver.SamsungACMControl

I get a different error (issue #137) :

Setting up interface...
libusbx: error [get_endpoints] error getting pipe information for pipe 1: unknown error
libusbx: error [darwin_set_interface_altsetting] could not build endpoint table
ERROR: Setting up interface failed!

Cheers,
David
Benjamin-Dobell commented 9 years ago

Is there a way to use qt4 instead of qt5?

No, all future builds will be qt5 only, particularly the upcoming Heimdall 2.0 release (once I finally get a chance to finish it).

I use macports' qt4-mac. Macports currently does not support parallel installation of qt4 and qt5, and lots of applications still depend on qt4.

I strongly recommend you use Homebrew instead of Macports. Simultaneous installation of Qt 4 and Qt 5 is supported using Homebrew in a non-disruptive manner.

I get a different error (issue #137) :

I'm not seeing this on my Yosemite machine (or in my Lion VM). Perhaps Homebrew is providing a newer version of libusb-1.0 than Macports..

Liontooth commented 9 years ago

OK, thanks. Homebrew is indeed using libusb 1.0.19, the latest, while macports has 1.0.18. However, after modifying the macports port file and installing 1.0.19, I still get the same issue #137 error.

Heimdall finds the macports version of libusb:

$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found libusb: /opt/local/lib/libusb-1.0.a
-- Checking if large (64-bit) file support is available...
-- Checking if large (64-bit) file support is available - yes
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/liontooth/software/git/heimdall/Heimdall-master/build

Yet from dtruss it looks to me like heimdall is using the built-in /usr/lib/libusb-1.0.dylib rather than the macports version:

Heimdall-master/build/bin$ sudo dtruss ./heimdall print-pit --no-reboot
Heimdall v1.4.1

Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

SYSCALL(args)        = return
open("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x0, 0x0)         = 3 0
pread(0x3, "\312\376\272\276\0", 0x1000, 0x0)        = 4096 0
pread(0x3, "\317\372\355\376\a\0", 0x1000, 0x1000)       = 4096 0
fcntl(0x3, 0x3D, 0x7FFF52FB3700)         = 0 0
mmap(0x10CC6B000, 0x2000, 0x5, 0x12, 0x3, 0x1000)        = 0x10CC6B000 0
mmap(0x10CC6D000, 0x1000, 0x3, 0x12, 0x3, 0x3000)        = 0x10CC6D000 0
mmap(0x10CC6E000, 0x2050, 0x1, 0x12, 0x3, 0x4000)        = 0x10CC6E000 0
close(0x3)       = 0 0
stat64("/usr/lib/libusb-1.0.dylib\0", 0x7FFF52FB5188, 0x7FFF52FB6020)        = 0 0
open("/usr/lib/libusb-1.0.dylib\0", 0x0, 0x0)        = 3 0
pread(0x3, "\317\372\355\376\a\0", 0x1000, 0x0)      = 4096 0
mmap(0x10CC78000, 0xF000, 0x5, 0x12, 0x3, 0x0)       = 0x10CC78000 0
mmap(0x10CC87000, 0x1000, 0x3, 0x12, 0x3, 0xF000)        = 0x10CC87000 0
mmap(0x10CC88000, 0x33C8, 0x1, 0x12, 0x3, 0x10000)       = 0x10CC88000 0
fcntl(0x3, 0x2C, 0x7FFF52FB33C8)         = 0 0
close(0x3)       = 0 0
stat64("/usr/lib/libc++.1.dylib\0", 0x7FFF52FB5188, 0x7FFF52FB6020)      = 0 0
stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF52FB5188, 0x7FFF52FB6020)       = 0 0
stat64("/usr/lib/libobjc.A.dylib\0", 0x7FFF52FB5058, 0x7FFF52FB5EF0)         = 0 0
stat64("/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit\0", 0x7FFF52FB5058, 0x7FFF52FB5EF0)      = 0 0
stat64("/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation\0", 0x7FFF52FB5058, 0x7FFF52FB5EF0)        = 0 0
stat64("/usr/lib/libauto.dylib\0", 0x7FFF52FB4F28, 0x7FFF52FB5DC0)       = 0 0
stat64("/usr/lib/libc++abi.dylib\0", 0x7FFF52FB4F28, 0x7FFF52FB5DC0)         = 0 0
stat64("/usr/lib/libDiagnosticMessagesClient.dylib\0", 0x7FFF52FB4E08, 0x7FFF52FB5CA0)       = 0 0
stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)       = 0 0
stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libcompiler_rt.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)         = 0 0
stat64("/usr/lib/system/libcopyfile.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libcorecrypto.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libdispatch.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libdyld.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libkeymgr.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/liblaunch.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libmacho.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)       = 0 0
stat64("/usr/lib/system/libquarantine.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libremovefile.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libsystem_asl.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libsystem_blocks.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)       = 0 0
stat64("/usr/lib/system/libsystem_c.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libsystem_configuration.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libsystem_dnssd.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libsystem_info.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)         = 0 0
stat64("/usr/lib/system/libsystem_kernel.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)       = 0 0
stat64("/usr/lib/system/libsystem_m.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libsystem_malloc.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)       = 0 0
stat64("/usr/lib/system/libsystem_network.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libsystem_notify.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)       = 0 0
stat64("/usr/lib/system/libsystem_platform.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)         = 0 0
stat64("/usr/lib/system/libsystem_pthread.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libsystem_sandbox.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libsystem_stats.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)        = 0 0
stat64("/usr/lib/system/libunc.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)         = 0 0
stat64("/usr/lib/system/libunwind.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)      = 0 0
stat64("/usr/lib/system/libxpc.dylib\0", 0x7FFF52FB4878, 0x7FFF52FB5710)         = 0 0
stat64("/usr/lib/libbsm.0.dylib\0", 0x7FFF52FB4F08, 0x7FFF52FB5DA0)      = 0 0
stat64("/usr/lib/libz.1.dylib\0", 0x7FFF52FB4F08, 0x7FFF52FB5DA0)        = 0 0
stat64("/usr/lib/system/libkxld.dylib\0", 0x7FFF52FB4F08, 0x7FFF52FB5DA0)        = 0 0
stat64("/usr/lib/libicucore.A.dylib\0", 0x7FFF52FB4DA8, 0x7FFF52FB5C40)      = 0 0
__sysctl(0x7FFF52FB5A98, 0x2, 0x7FFF52FB5AA8)        = 0 0
thread_selfid(0x7FFF7B17E310, 0x7FFF7B17E258, 0x10101)       = 498309 0
bsdthread_register(0x7FFF8B65DFBC, 0x7FFF8B65DFAC, 0x2000)       = 0 0
mprotect(0x10CC66000, 0x88, 0x1)         = 0 0
mprotect(0x10CC8C000, 0x1000, 0x0)       = 0 0
mprotect(0x10CCA2000, 0x1000, 0x0)       = 0 0
mprotect(0x10CCA3000, 0x1000, 0x0)       = 0 0
mprotect(0x10CCB9000, 0x1000, 0x0)       = 0 0
mprotect(0x10CC68000, 0x1000, 0x1)       = 0 0
mprotect(0x10CC66000, 0x88, 0x3)         = 0 0
mprotect(0x10CC66000, 0x88, 0x1)         = 0 0
issetugid(0x7FFF7B385480, 0x7FFFFFE00034, 0x7FFFFFE00036)        = 0 0
getpid(0x1, 0x10CC69000, 0x49656E69)         = 51755 0
__mac_syscall(0x7FFF928DAE47, 0x2, 0x7FFF52FB5918)       = 0 0
stat64("/AppleInternal\0", 0x7FFF52FB5998, 0x0)      = -1 Err#2
audit_session_self(0x7FFF52FB5850, 0x7FFF52FB5688, 0x4)      = 4099 0
geteuid(0x7FFF52FB5850, 0x7FFF52FB5688, 0x0)         = 0 0
getegid(0x7FFF52FB5850, 0x7FFF52FB5688, 0x0)         = 0 0
getaudit_addr(0x7FFF52FB5928, 0x30, 0x0)         = 0 0
csops(0xCA2B, 0x7, 0x7FFF52FB5510)       = -1 Err#22
getuid(0x7FFF52FB5AFC, 0x7FFF52FB5AF8, 0x7FFF52FB6BE0)       = 0 0
geteuid(0x103, 0x10000000100, 0x7FFF7CD7C198)        = 0 0
getuid(0x103, 0x10000000100, 0x0)        = 0 0
__sysctl(0x7FFF52FB4FA0, 0x4, 0x7FFF52FB4FB8)        = 0 0
issetugid(0x10000078C, 0x20000078C, 0x7FD499405EB8)      = 0 0
getuid(0x7FFF52FB52C4, 0x0, 0x7FFF52FB6BE0)      = 0 0
getrlimit(0x1008, 0x7FFF52FB5FC0, 0x7FFF95C6FE7C)        = 0 0
fstat64(0x1, 0x7FFF52FB5F88, 0x7FFF52FB604C)         = 0 0
ioctl(0x1, 0x4004667A, 0x7FFF52FB6014)       = 0 0
write_nocancel(0x1, "Heimdall v1.4.1\n\0", 0x10)         = 16 0
write_nocancel(0x1, "\n\0", 0x1)         = 1 0
write_nocancel(0x1, "Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna\n\0", 0x37)      = 55 0
write_nocancel(0x1, "http://www.glassechidna.com.au/\n\0", 0x20)         = 32 0
write_nocancel(0x1, "\n\0", 0x1)         = 1 0
write_nocancel(0x1, "This software is provided free of charge. Copying and redistribution is\n\0", 0x48)         = 72 0
write_nocancel(0x1, "encouraged.\n\0", 0xC)      = 12 0
write_nocancel(0x1, "\n\0", 0x1)         = 1 0
write_nocancel(0x1, "If you appreciate this software and you would like to support future\n\0", 0x45)        = 69 0
write_nocancel(0x1, "development please consider donating:\n\0", 0x26)       = 38 0
write_nocancel(0x1, "http://www.glassechidna.com.au/donate/\n\0", 0x27)      = 39 0
write_nocancel(0x1, "\n\0", 0x1)         = 1 0
getpid(0x7FFF52FB60A8, 0x10CC65004, 0xEA60)      = 51755 0
open("/dev/dtracehelper\0", 0x2, 0x7FFF52FB61A0)         = 3 0
close(0x3)       = 0 0
thread_selfid(0x0, 0x1DC0, 0x7FFF6D524550)       = 498309 0
open(".\0", 0x0, 0x1)        = 3 0
fstat64(0x3, 0x7FFF52FB6030, 0x0)        = 0 0
fcntl(0x3, 0x32, 0x7FFF52FB62F0)         = 0 0
close(0x3)       = 0 0
stat64("/Users/liontooth/software/git/heimdall/Heimdall-master/build/bin\0", 0x7FFF52FB5FA0, 0x0)        = 0 0
csops(0x0, 0x0, 0x7FFF52FB62B4)      = 0 0
issetugid(0x0, 0x0, 0x0)         = 0 0
shared_region_check_np(0x7FFF52FB41E8, 0x10CC49000, 0x4)         = 0 0
stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x7FFF52FB5398, 0x7FFF52FB62D0)         = 0 0
ioctl(0x3, 0x80086804, 0x7FFF52FB6128)       = 0 0
Initialising connection...
Detecting device...
Claiming interface...
__semwait_signal(0xC03, 0x0, 0x1)        = -1 Err#60
write_nocancel(0x1, "Initialising connection...\n\0", 0x1B)      = 27 0
bsdthread_create(0x10CC82FEC, 0x7FD499407570, 0x80000)       = 215199744 0
thread_selfid(0x10CD3B000, 0x7FFF7B17E258, 0x1010101)        = 498313 0
proc_info(0x5, 0xCA2B, 0x2)      = 0 0
guarded_kqueue_np(0x10CD3A688, 0x3, 0x7FFF8C36CA58)      = 3 0
kevent64(0x3, 0x7FFF8C37FC48, 0x1)       = 0 0
workq_kernreturn(0x10, 0x0, 0x58)        = 0 0
workq_open(0x10, 0x0, 0x0)       = 0 0
bsdthread_create(0x7FFF8C36CE5B, 0x7FFF7B385940, 0x10000)        = 215277568 0
kevent64(0x3, 0x10CD3A708, 0x1)      = 1 0
psynch_cvsignal(0x10CC87530, 0x100, 0x0)         = 257 0
open("/dev/dtracehelper\0", 0x2, 0x7FFF52FB62F0)         = 6 0
close(0x6)       = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
open_nocancel("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x1100004, 0x7FD49940C865)       = 6 0
__sysctl(0x7FFF52FB5118, 0x2, 0x7FFF7D1BD180)        = 0 0
fstatfs64(0x6, 0x7FFF52FB5168, 0x0)      = 0 0
getdirentries64(0x6, 0x7FD499808200, 0x1000)         = 88 0
getdirentries64(0x6, 0x7FD499808200, 0x1000)         = 0 0
close_nocancel(0x6)      = 0 0
open_nocancel("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle/Contents\0", 0x1100004, 0x7FD49940CF73)      = 6 0
fstatfs64(0x6, 0x7FFF52FB5138, 0x0)      = 0 0
getdirentries64(0x6, 0x7FD499808200, 0x1000)         = 240 0
getdirentries64(0x6, 0x7FD499808200, 0x1000)         = 0 0
close_nocancel(0x6)      = 0 0
open("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle/Contents/Info.plist\0", 0x0, 0x1B6)       = 6 0
fstat64(0x6, 0x7FFF52FB53F8, 0x0)        = 0 0
read(0x6, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>BuildMachineOSBuild</key>\n\t<string>13F17</string>\n\t<key>CFBundleDevelopmentRegi", 0x758)      = 1880 0
close(0x6)       = 0 0
stat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle/Contents/MacOS/IOUSBLib\0", 0x7FFF52FB5998, 0x7FFF52FB5EE6)         = 0 0
stat64("/usr/lib/libesp.dylib\0", 0x7FFF52FB4F58, 0x7FFF52FB5E00)        = -1 Err#2
stat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle/Contents/MacOS/IOUSBLib\0", 0x7FFF52FB4C18, 0x7FFF52FB5AC0)         = 0 0
stat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle/Contents/MacOS/IOUSBLib\0", 0x7FFF52FB58A8, 0xEDA90)        = 0 0
open("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle/Contents/MacOS/IOUSBLib\0", 0x0, 0x1FF)       = 6 0
read(0x6, "\312\376\272\276\0", 0x200)       = 512 0
lseek(0x6, 0x16000, 0x0)         = 90112 0
read(0x6, "\316\372\355\376\a\0", 0x20)      = 32 0
close(0x6)       = 0 0
stat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle/Contents/MacOS/IOUSBLib\0", 0x7FFF52FB4BF8, 0x7FFF52FB5AA0)         = 0 0
open("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle/Contents/MacOS/IOUSBLib\0", 0x0, 0x0)         = 6 0
pread(0x6, "\312\376\272\276\0", 0x1000, 0x0)        = 4096 0
pread(0x6, "\317\372\355\376\a\0", 0x1000, 0x1000)       = 4096 0
fcntl(0x6, 0x3D, 0x7FFF52FB2E00)         = 0 0
mmap(0x10CD50000, 0x9000, 0x5, 0x12, 0x6, 0x1000)        = 0x10CD50000 0
mmap(0x10CD59000, 0x1000, 0x3, 0x12, 0x6, 0xA000)        = 0x10CD59000 0
mmap(0x10CD5A000, 0xA560, 0x1, 0x12, 0x6, 0xB000)        = 0x10CD5A000 0
close(0x6)       = 0 0
__semwait_signal(0xC03, 0x0, 0x1)        = -1 Err#60
__semwait_signal(0xC03, 0x0, 0x1)        = -1 Err#60
__semwait_signal(0xC03, 0x0, 0x1)        = -1 Err#60
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
ioctl(0x6, 0x80086804, 0x7FFF52FB6278)       = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB6040, 0x7FFF52FB611C)        = 0 0
pipe(0x7FD49B000070, 0x30000000300, 0x7FD499407D38)      = 6 0
fcntl(0x7, 0x2, 0x4)         = 0 0
write(0x5, "\001\0", 0x1)        = 1 0
read(0x4, "\001\0", 0x1)         = 1 0
write_nocancel(0x1, "Claiming interface...\n\0", 0x16)       = 22 0
thread_selfid(0x10CD4E000, 0x7FFF7B17E258, 0x1010101)        = 498314 0
__pthread_sigmask(0x1, 0x10CD4DECC, 0x0)         = 0 0
kevent64(0x3, 0x10CD4D458, 0x1)      = 1 0
madvise(0x10D201000, 0x1000, 0x5)        = 0 0
madvise(0x10CE01000, 0x1000, 0x5)        = 0 0
kevent64(0x3, 0x10CD4D4F8, 0x1)      = 1 0
kevent64(0x3, 0x0, 0x0)      = 1 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
psynch_cvwait(0x10CC87530, 0x100000100, 0x0)         = 0 0
pipe(0x7FD499407578, 0x0, 0x1)       = 4 0
write_nocancel(0x1, "Detecting device...\n\0", 0x14)         = 20 0
stat64("/System/Library/PrivateFrameworks/CoreServicesInternal.framework/CoreServicesInternal\0", 0x7FFF52FB54E8, 0x7FFF52FB6390)        = 0 0
stat64("/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal\0", 0x7FFF52FB5358, 0x7FFF52FB54D8)         = 0 0
stat64("/System/Library/Frameworks/NetFS.framework/Versions/A/NetFS\0", 0x7FFF52FB5278, 0x7FFF52FB6110)      = 0 0
stat64("/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices\0", 0x7FFF52FB5278, 0x7FFF52FB6110)        = 0 0
stat64("/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration\0", 0x7FFF52FB5118, 0x7FFF52FB5FB0)      = 0 0
stat64("/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth\0", 0x7FFF52FB5118, 0x7FFF52FB5FB0)       = 0 0
stat64("/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration\0", 0x7FFF52FB5118, 0x7FFF52FB5FB0)      = 0 0
stat64("/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation\0", 0x7FFF52FB4FE8, 0x7FFF52FB5E80)        = 0 0
stat64("/usr/lib/libxml2.2.dylib\0", 0x7FFF52FB4DA8, 0x7FFF52FB5C40)         = 0 0
stat64("/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork\0", 0x7FFF52FB4DA8, 0x7FFF52FB5C40)      = 0 0
stat64("/System/Library/Frameworks/Security.framework/Versions/A/Security\0", 0x7FFF52FB4DA8, 0x7FFF52FB5C40)        = 0 0
stat64("/usr/lib/liblangid.dylib\0", 0x7FFF52FB4DA8, 0x7FFF52FB5C40)         = 0 0
stat64("/usr/lib/libCRFSuite.dylib\0", 0x7FFF52FB4DA8, 0x7FFF52FB5C40)       = 0 0
stat64("/usr/lib/libsqlite3.dylib\0", 0x7FFF52FB4BB8, 0x7FFF52FB5A50)        = 0 0
stat64("/usr/lib/libxar.1.dylib\0", 0x7FFF52FB49C8, 0x7FFF52FB5860)      = 0 0
stat64("/usr/lib/libpam.2.dylib\0", 0x7FFF52FB49C8, 0x7FFF52FB5860)      = 0 0
stat64("/usr/lib/libOpenScriptingUtil.dylib\0", 0x7FFF52FB49C8, 0x7FFF52FB5860)      = 0 0
stat64("/usr/lib/libbz2.1.0.dylib\0", 0x7FFF52FB4898, 0x7FFF52FB5730)        = 0 0
stat64("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore\0", 0x7FFF52FB4BE8, 0x7FFF52FB5A80)       = 0 0
stat64("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata\0", 0x7FFF52FB4BE8, 0x7FFF52FB5A80)   = 0 0
stat64("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices\0", 0x7FFF52FB4BE8, 0x7FFF52FB5A80)       = 0 0
stat64("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit\0", 0x7FFF52FB4BE8, 0x7FFF52FB5A80) = 0 0
stat64("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE\0", 0x7FFF52FB4BE8, 0x7FFF52FB5A80)       = 0 0
stat64("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices\0", 0x7FFF52FB4BE8, 0x7FFF52FB5A80)       = 0 0
stat64("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices\0", 0x7FFF52FB4BE8, 0x7FFF52FB5A80)       = 0 0
stat64("/System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore\0", 0x7FFF52FB4A28, 0x7FFF52FB58C0)       = 0 0
stat64("/System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC\0", 0x7FFF52FB4A28, 0x7FFF52FB58C0)       = 0 0
stat64("/System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory\0", 0x7FFF52FB49F8, 0x7FFF52FB5890)        = 0 0
stat64("/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement\0", 0x7FFF52FB4838, 0x7FFF52FB56D0)      = 0 0
stat64("/usr/lib/libxslt.1.dylib\0", 0x7FFF52FB49D8, 0x7FFF52FB5870)         = 0 0
lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB5F80, 0x7FFF52FB605C)        = 0 0
Setting up interface...
libusbx: error [get_endpoints] error getting pipe information for pipe 1: unknown error
libusbx: error [darwin_set_interface_altsetting] could not build endpoint table
ERROR: Setting up interface failed!
Releasing device interface...

lstat64("/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle\0", 0x7FFF52FB61E0, 0x7FFF52FB62BC)        = 0 0
write_nocancel(0x1, "Setting up interface...\n\0", 0x18)         = 24 0
thread_selfid(0x10CDE6000, 0x7FFF7B17E258, 0x1010101)        = 498359 0
__disable_threadsignal(0x1, 0x0, 0x7FD499407D18)         = 0 0
kevent64(0x3, 0x0, 0x0)      = -1 Err#4
close(0x7)       = 0 0
close(0x6)       = 0 0
close(0x4)       = 0 0
close(0x5)       = 0 0
workq_kernreturn(0x20, 0x0, 0x1)         = 0 0
__semwait_signal(0x1207, 0x0, 0x0)       = 0 0
write_nocancel(0x2, "libusbx: error [get_endpoints] \0", 0x1F)       = 31 0
write_nocancel(0x2, "error getting pipe information for pipe 1: unknown error\0", 0x38)      = 56 0
write_nocancel(0x2, "\n\0", 0x1)         = 1 0
workq_kernreturn(0x20, 0x0, 0x1)         = 0 0
write_nocancel(0x2, "libusbx: error [darwin_set_interface_altsetting] \0", 0x31)         = 49 0
write_nocancel(0x2, "could not build endpoint table\0", 0x1E)        = 30 0
write_nocancel(0x2, "\n\0", 0x1)         = 1 0
write_nocancel(0x2, "ERROR: \0", 0x7)        = 7 0
write_nocancel(0x2, "Setting up interface failed!\n\0", 0x1D)        = 29 0
write_nocancel(0x1, "Releasing device interface...\n\0", 0x1E)       = 30 0
write_nocancel(0x1, "\n\0", 0x1)         = 1 0
write(0x5, "\001\0", 0x1)        = 1 0
read(0x4, "\001\0", 0x1)         = 1 0

If I symlink to the macports version:

cd /usr/lib
sudo mv libusb-1.0.dylib libusb-1.0.dylib-orig
ln -s /opt/local/lib/libusb-1.0.0.dylib libusb-1.0.dylib

I still get the same error, but slightly more informative:

libusb: error [get_endpoints] error getting pipe information for pipe 1: unknown error (0xe0004061)
libusb: error [darwin_set_interface_altsetting] could not build endpoint table

Or with verbose usb:

Heimdall-master/build/bin$ ./heimdall print-pit --verbose --usb-log-level debug
Heimdall v1.4.1

Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
[ 0.133203] [00000507] libusb: debug [libusb_get_device_list] 
[ 0.133259] [00000507] libusb: debug [libusb_get_device_descriptor] 
[ 0.133271] [00000507] libusb: debug [libusb_open] open 253.4
[ 0.133424] [00000507] libusb: debug [usbi_add_pollfd] add fd 8 events 1
[ 0.133446] [00000507] libusb: debug [darwin_open] device open for access
[ 0.133485] [00000507] libusb: debug [libusb_get_device_descriptor] 
[ 0.133580] [00000507] libusb: debug [libusb_get_next_timeout] no URB with timeout or all handled by OS; no timeout!
[ 0.133602] [00000507] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.133614] [00000507] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.133819] [0000100f] libusb: debug [darwin_async_io_callback] an async io operation has completed
[ 0.133900] [00000507] libusb: debug [handle_events] poll() returned 1
[ 0.133921] [00000507] libusb: debug [op_handle_events] checking fd 4 with revents = 0
[ 0.133932] [00000507] libusb: debug [op_handle_events] checking fd 6 with revents = 0
[ 0.133941] [00000507] libusb: debug [op_handle_events] checking fd 8 with revents = 1
[ 0.133952] [00000507] libusb: debug [darwin_handle_callback] handling control completion with kernel status 0
[ 0.133963] [00000507] libusb: debug [usbi_handle_transfer_completion] transfer 0x7fa6e9d01758 has callback 0x10a6b5564
[ 0.133973] [00000507] libusb: debug [sync_transfer_cb] actual_length=4
[ 0.134065] [00000507] libusb: debug [libusb_get_next_timeout] no URB with timeout or all handled by OS; no timeout!
[ 0.134081] [00000507] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.134092] [00000507] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.134158] [0000100f] libusb: debug [darwin_async_io_callback] an async io operation has completed
[ 0.134193] [00000507] libusb: debug [handle_events] poll() returned 1
[ 0.134207] [00000507] libusb: debug [op_handle_events] checking fd 4 with revents = 0
[ 0.134215] [00000507] libusb: debug [op_handle_events] checking fd 6 with revents = 0
[ 0.134222] [00000507] libusb: debug [op_handle_events] checking fd 8 with revents = 1
[ 0.134231] [00000507] libusb: debug [darwin_handle_callback] handling control completion with kernel status 0
[ 0.134238] [00000507] libusb: debug [usbi_handle_transfer_completion] transfer 0x7fa6e9f015b8 has callback 0x10a6b5564
[ 0.134243] [00000507] libusb: debug [sync_transfer_cb] actual_length=18
      Manufacturer: "Sasmsung"
[ 0.134317] [00000507] libusb: debug [libusb_get_next_timeout] no URB with timeout or all handled by OS; no timeout!
[ 0.134330] [00000507] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.134341] [00000507] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.134411] [0000100f] libusb: debug [darwin_async_io_callback] an async io operation has completed
[ 0.134444] [00000507] libusb: debug [handle_events] poll() returned 1
[ 0.134459] [00000507] libusb: debug [op_handle_events] checking fd 4 with revents = 0
[ 0.134466] [00000507] libusb: debug [op_handle_events] checking fd 6 with revents = 0
[ 0.134475] [00000507] libusb: debug [op_handle_events] checking fd 8 with revents = 1
[ 0.134485] [00000507] libusb: debug [darwin_handle_callback] handling control completion with kernel status 0
[ 0.134494] [00000507] libusb: debug [usbi_handle_transfer_completion] transfer 0x7fa6e9e07d38 has callback 0x10a6b5564
[ 0.134503] [00000507] libusb: debug [sync_transfer_cb] actual_length=4
[ 0.134580] [00000507] libusb: debug [libusb_get_next_timeout] no URB with timeout or all handled by OS; no timeout!
[ 0.134598] [00000507] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.134608] [00000507] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.134777] [0000100f] libusb: debug [darwin_async_io_callback] an async io operation has completed
[ 0.134815] [00000507] libusb: debug [handle_events] poll() returned 1
[ 0.134834] [00000507] libusb: debug [op_handle_events] checking fd 4 with revents = 0
[ 0.134842] [00000507] libusb: debug [op_handle_events] checking fd 6 with revents = 0
[ 0.134851] [00000507] libusb: debug [op_handle_events] checking fd 8 with revents = 1
[ 0.134861] [00000507] libusb: debug [darwin_handle_callback] handling control completion with kernel status 0
[ 0.134871] [00000507] libusb: debug [usbi_handle_transfer_completion] transfer 0x7fa6e9e07d38 has callback 0x10a6b5564
[ 0.134880] [00000507] libusb: debug [sync_transfer_cb] actual_length=16
           Product: "MSM8x60"

            length: 18
      device class: 2
               S/N: 0
           VID:PID: 04E8:685D
         bcdDevice: 0100
   iMan:iProd:iSer: 1:2:0
          nb confs: 1
[ 0.134939] [00000507] libusb: debug [libusb_get_config_descriptor] index 0

interface[0].altsetting[0]: num endpoints = 1
   Class.SubClass.Protocol: 02.02.01
       endpoint[0].address: 82
           max packet size: 0010
          polling interval: 09

interface[1].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 0A.00.00
       endpoint[0].address: 81
           max packet size: 0200
          polling interval: 00
       endpoint[1].address: 01
           max packet size: 0200
          polling interval: 00
Claiming interface...
[ 0.135040] [00000507] libusb: debug [libusb_claim_interface] interface 1
[ 0.135091] [00000507] libusb: info [darwin_claim_interface] no interface found; setting configuration: 2
[ 1.291103] [00000507] libusb: debug [get_endpoints] building table of endpoints.
[ 1.291136] [00000507] libusb: debug [get_endpoints] interface: 1 pipe 1: dir: 1 number: 1
[ 1.291149] [00000507] libusb: debug [get_endpoints] interface: 1 pipe 2: dir: 0 number: 1
[ 1.291196] [00000507] libusb: debug [darwin_claim_interface] interface opened
Setting up interface...
[ 1.291222] [00000507] libusb: debug [libusb_set_interface_alt_setting] interface 1 altsetting 0
[ 1.327747] [00000507] libusb: debug [darwin_reset_device] darwin/reset_device: checking if device descriptor changed
[ 1.328015] [00000507] libusb: debug [darwin_reset_device] darwin/reset_device: checking if configuration descriptor 0 changed
[ 1.328240] [00000507] libusb: debug [darwin_reset_device] darwin/reset_device: device reset complete
[ 1.328258] [00000507] libusb: debug [get_endpoints] building table of endpoints.
[ 1.328282] [00000507] libusb: error [get_endpoints] error getting pipe information for pipe 1: unknown error (0xe0004061)
[ 1.328547] [00000507] libusb: error [darwin_set_interface_altsetting] could not build endpoint table
ERROR: Setting up interface failed!
Releasing device interface...
[ 1.328584] [00000507] libusb: debug [libusb_release_interface] interface 1

[ 1.328600] [00000507] libusb: debug [libusb_close] 
[ 1.328668] [00000507] libusb: debug [usbi_remove_pollfd] remove fd 8
[ 1.328703] [00000507] libusb: debug [libusb_exit] 
[ 1.328712] [00000507] libusb: debug [libusb_exit] destroying default context

Candidate fix: https://github.com/libimobiledevice/libirecovery/pull/14/files?diff=split (history).

Cheers, David

Benjamin-Dobell commented 9 years ago

This certainly looks like a bug in libusb-1.0 (or perhaps even lower level), and isn't an issue with Heimdall. Nonetheless, the bug clearly does affect Heimdall, so I'd still like to try debug the issue. However, in order to do so I need to be able to recreate the problem.

What are the specs of your Mac?

What Android device(s) are you using?

Liontooth commented 9 years ago

That would be great, thanks! This is a MacBook Pro 13-inch, Late 2011 2.8 GHz Intel Core i7 Intel HD Graphics 3000 512 MB running OS X 10.9.5 (13F34). I'm using the USB ports in the Mac. The Android phone is a Samsung Galaxy II S T989 (t-mobile). It started out as a stock release, 4.1.2; I've since flashed it using Odin 2.6 in Parallels to run twrp 2.5 and various ROMs, currently Techniqcality. They all run into the same problem with Heimdall.

If we can formulate what exactly is going wrong we could also report it to libusb; it seems to be affecting a good number of people.

wattsteve commented 7 years ago

Was there ever any resolution to this issue? I'm running into the same thing.