george-norton / headphones-toolbox

A UI for configuring Ploopy Headphones
GNU General Public License v3.0
24 stars 4 forks source link

MacOS build unable to locate `libusb-1.0.0.dylib` #1

Closed 13tales closed 1 year ago

13tales commented 1 year ago

I've been unable to run this on MacOS; it crashes on start with an error message bout not being able to find libusb.

I have a 2021 14" Macbook pro with an M1 chip.

I've confirmed that libusb is installed via homebrew, and tried reinstalling it, and sym-linking it to one of the paths where the app seems to be looking. No joy, however.

Example crash report included below. Would love to know if anyone has any suggestions on how to get it working.

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Ploopy Headphones Toolbox [10815]
Path:                  /Applications/Ploopy Headphones Toolbox.app/Contents/MacOS/Ploopy Headphones Toolbox
Identifier:            app.ploopy.headphones
Version:               0.0.0 (20230607.215455)
Code Type:             X86-64 (Translated)
Parent Process:        launchd [1]
User ID:               502

Date/Time:             2023-06-11 15:16:43.1550 +1000
OS Version:            macOS 13.3.1 (22E772610a)
Report Version:        12
Anonymous UUID:        A2E93EB3-48C5-F8F2-1490-AA78D6604530

Sleep/Wake UUID:       5C90BB71-0F75-4CFA-B0C7-BB2BF0D2B14D

Time Awake Since Boot: 580000 seconds
Time Since Wake:       2648 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
Referenced from: <39F72E80-AB63-3C9E-86C1-EC4AF0AFDFCB> /Applications/Ploopy Headphones Toolbox.app/Contents/MacOS/Ploopy Headphones Toolbox
Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file, not in dyld cache)
(terminated at launch; ignore backtrace)

Thread 0 Crashed:
0   Rosetta Runtime Routines           0x10364d9a8 ???
1   <translation info unavailable>         0x1036cfaec ???
2   dyld                                   0x20325dfd7 abort_with_payload_wrapper_internal + 82
3   dyld                                   0x20325e009 abort_with_payload + 9
4   dyld                                   0x2031e28f0 dyld4::halt(char const*) + 375
5   dyld                                   0x2031dfb71 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 4526
6   dyld                                   0x2031de3bd start + 1805

Thread 1:: com.apple.rosetta.exceptionserver
0   runtime                             0x7ff7ffdc0694 0x7ff7ffdbc000 + 18068

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000001   x2: 0x0000000309b348c0   x3: 0x0000000000000096
    x4: 0x0000000309b344c0   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000002090ed57d0
    x8: 0x0000000309b344c0   x9: 0x0000000000000000  x10: 0x0000000000000096  x11: 0x0000000309b344c0
   x12: 0x0000000000000096  x13: 0x0000000309b348c0  x14: 0x0000000000000001  x15: 0x0000000000000006
   x16: 0x0000000000000209  x17: 0x0000000000000000  x18: 0x800000010b6b2b80  x19: 0x0000000103643000
   x20: 0x00000000000007ff  x21: 0x000000010b6b7fa0  x22: 0xffffffffffffffff  x23: 0x000000010364d97c
   x24: 0x000000020325dfd7  x25: 0x000000010364d248  x26: 0x00000001036cdbb8  x27: 0x0000000000000000
   x28: 0x0000000203243c42   fp: 0x000000002c000000   lr: 0x00000001036cfaec
    sp: 0x000000010b6b2b80   pc: 0x000000010364d9a8 cpsr: 0x80001000
   far: 0x000000010bbcf010  esr: 0x56000080  Address size fault

Binary Images:
       0x2031d8000 -        0x203273fff dyld (*) <f22a1143-9732-3e23-a8b7-cbade6bb8301> /usr/lib/dyld
    0x7ff7ffdbc000 -     0x7ff7ffdebfff runtime (*) <baf9136b-e1ff-3661-ad17-0f4ca7ce58f9> /usr/libexec/rosetta/runtime
       0x10b64d000 -        0x10b6a0fff libRosettaRuntime (*) <73cd5d0d-71d4-353e-9740-af3964d9a4ae> /Library/Apple/*/libRosettaRuntime
       0x10285e000 -        0x102d39fff app.ploopy.headphones (0.0.0) <39f72e80-ab63-3c9e-86c1-ec4af0afdfcb> /Applications/Ploopy Headphones Toolbox.app/Contents/MacOS/Ploopy Headphones Toolbox
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=8344K resident=0K(0%) swapped_out_or_unallocated=8344K(100%)
Writable regions: Total=157.1M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=157.1M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Rosetta Arena                     4096K        2 
Rosetta Generic                    916K      226 
Rosetta IndirectBranch              32K        1 
Rosetta JIT                      128.0M        1 
Rosetta Return Stack                20K        2 
Rosetta Thread Context              20K        2 
Stack                             8176K        1 
Stack Guard                       56.0M        1 
VM_ALLOCATE                       15.9M        7 
VM_ALLOCATE (reserved)               8K        1         reserved VM address space (unallocated)
__DATA                             368K        6 
__DATA_CONST                        32K        1 
__DATA_DIRTY                        16K        1 
__LINKEDIT                        2240K        7 
__TEXT                            6128K        4 
dyld private memory                260K        2 
mapped file                        6.8G       34 
===========                     =======  ======= 
TOTAL                              7.0G      299 
TOTAL, minus reserved VM space     7.0G      299 

-----------
Full Report
-----------

{"app_name":"Ploopy Headphones Toolbox","timestamp":"2023-06-11 15:16:43.00 +1000","app_version":"0.0.0","slice_uuid":"39f72e80-ab63-3c9e-86c1-ec4af0afdfcb","build_version":"20230607.215455","platform":1,"bundleID":"app.ploopy.headphones","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 13.3.1 (22E772610a)","roots_installed":0,"name":"Ploopy Headphones Toolbox","incident_id":"C1B989C8-54D0-4FEB-8DB4-4EC3E5CC49C8"}
{
  "uptime" : 580000,
  "procRole" : "Default",
  "version" : 2,
  "userID" : 502,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro18,3",
  "coalitionID" : 82700,
  "osVersion" : {
    "train" : "macOS 13.3.1",
    "build" : "22E772610a",
    "releaseType" : "User"
  },
  "captureTime" : "2023-06-11 15:16:43.1550 +1000",
  "incident" : "C1B989C8-54D0-4FEB-8DB4-4EC3E5CC49C8",
  "pid" : 10815,
  "translated" : true,
  "cpuType" : "X86-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2023-06-11 15:16:43.0910 +1000",
  "procStartAbsTime" : 13920379793342,
  "procExitAbsTime" : 13920381318577,
  "procName" : "Ploopy Headphones Toolbox",
  "procPath" : "\/Applications\/Ploopy Headphones Toolbox.app\/Contents\/MacOS\/Ploopy Headphones Toolbox",
  "bundleInfo" : {"CFBundleShortVersionString":"0.0.0","CFBundleVersion":"20230607.215455","CFBundleIdentifier":"app.ploopy.headphones"},
  "storeInfo" : {"deviceIdentifierForVendor":"6F20B899-5D50-58AC-82FF-7C650A4DD4F1","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "app.ploopy.headphones",
  "crashReporterKey" : "A2E93EB3-48C5-F8F2-1490-AA78D6604530",
  "throttleTimeout" : 2147483647,
  "codeSigningID" : "",
  "codeSigningTeamID" : "",
  "codeSigningValidationCategory" : 0,
  "codeSigningTrustLevel" : 0,
  "wakeTime" : 2648,
  "sleepWakeUUID" : "5C90BB71-0F75-4CFA-B0C7-BB2BF0D2B14D",
  "sip" : "enabled",
  "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
  "termination" : {"code":1,"flags":518,"namespace":"DYLD","indicator":"Library missing","details":["(terminated at launch; ignore backtrace)"],"reasons":["Library not loaded: \/usr\/local\/opt\/libusb\/lib\/libusb-1.0.0.dylib","Referenced from: <39F72E80-AB63-3C9E-86C1-EC4AF0AFDFCB> \/Applications\/Ploopy Headphones Toolbox.app\/Contents\/MacOS\/Ploopy Headphones Toolbox","Reason: tried: '\/usr\/local\/opt\/libusb\/lib\/libusb-1.0.0.dylib' (no such file), '\/System\/Volumes\/Preboot\/Cryptexes\/OS\/usr\/local\/opt\/libusb\/lib\/libusb-1.0.0.dylib' (no such file), '\/usr\/local\/opt\/libusb\/lib\/libusb-1.0.0.dylib' (no such file), '\/usr\/local\/lib\/libusb-1.0.0.dylib' (no such file), '\/usr\/lib\/libusb-1.0.0.dylib' (no such file, not in dyld cache)"]},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":8471410,"threadState":{"x":[{"value":6},{"value":1},{"value":13047646400},{"value":150},{"value":13047645376},{"value":0},{"value":0},{"value":139870427088},{"value":13047645376},{"value":0},{"value":150},{"value":13047645376},{"value":150},{"value":13047646400},{"value":1},{"value":6},{"value":521},{"value":0},{"value":9223372041341315968},{"value":4351864832},{"value":2047},{"value":4486561696},{"value":18446744073709551615},{"value":4351908220},{"value":8642748375,"symbolLocation":82,"symbol":"abort_with_payload_wrapper_internal"},{"value":4351906376},{"value":4352433080},{"value":0},{"value":8642640962,"symbolLocation":10,"symbol":"__abort_with_payload"}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4352441068},"cpsr":{"value":2147487744},"fp":{"value":738197504},"sp":{"value":4486540160},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":4351908264,"matchesCrashFrame":1},"far":{"value":4491898896}},"frames":[{"imageOffset":4351908264,"region":"Rosetta Runtime Routines","symbolLocation":10664,"imageIndex":4},{"imageOffset":4352441068,"region":"<translation info unavailable>","imageIndex":4},{"imageOffset":548823,"symbol":"abort_with_payload_wrapper_internal","symbolLocation":82,"imageIndex":0},{"imageOffset":548873,"symbol":"abort_with_payload","symbolLocation":9,"imageIndex":0},{"imageOffset":43248,"symbol":"dyld4::halt(char const*)","symbolLocation":375,"imageIndex":0},{"imageOffset":31601,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":4526,"imageIndex":0},{"imageOffset":25533,"symbol":"start","symbolLocation":1805,"imageIndex":0}]},{"id":8471422,"name":"com.apple.rosetta.exceptionserver","frames":[{"imageOffset":18068,"imageIndex":1}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 8642199552,
    "size" : 638976,
    "uuid" : "f22a1143-9732-3e23-a8b7-cbade6bb8301",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 140703126241280,
    "size" : 196608,
    "uuid" : "baf9136b-e1ff-3661-ad17-0f4ca7ce58f9",
    "path" : "\/usr\/libexec\/rosetta\/runtime",
    "name" : "runtime"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4486123520,
    "size" : 344064,
    "uuid" : "73cd5d0d-71d4-353e-9740-af3964d9a4ae",
    "path" : "\/Library\/Apple\/*\/libRosettaRuntime",
    "name" : "libRosettaRuntime"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4337295360,
    "CFBundleShortVersionString" : "0.0.0",
    "CFBundleIdentifier" : "app.ploopy.headphones",
    "size" : 5095424,
    "uuid" : "39f72e80-ab63-3c9e-86c1-ec4af0afdfcb",
    "path" : "\/Applications\/Ploopy Headphones Toolbox.app\/Contents\/MacOS\/Ploopy Headphones Toolbox",
    "name" : "Ploopy Headphones Toolbox",
    "CFBundleVersion" : "20230607.215455"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 140703412338688,
  "size" : 21474836480,
  "uuid" : "b81581ae-ff6f-3644-8c21-c969ac66f1fa"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=8344K resident=0K(0%) swapped_out_or_unallocated=8344K(100%)\nWritable regions: Total=157.1M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=157.1M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nRosetta Arena                     4096K        2 \nRosetta Generic                    916K      226 \nRosetta IndirectBranch              32K        1 \nRosetta JIT                      128.0M        1 \nRosetta Return Stack                20K        2 \nRosetta Thread Context              20K        2 \nStack                             8176K        1 \nStack Guard                       56.0M        1 \nVM_ALLOCATE                       15.9M        7 \nVM_ALLOCATE (reserved)               8K        1         reserved VM address space (unallocated)\n__DATA                             368K        6 \n__DATA_CONST                        32K        1 \n__DATA_DIRTY                        16K        1 \n__LINKEDIT                        2240K        7 \n__TEXT                            6128K        4 \ndyld private memory                260K        2 \nmapped file                        6.8G       34 \n===========                     =======  ======= \nTOTAL                              7.0G      299 \nTOTAL, minus reserved VM space     7.0G      299 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "logWritingSignature" : "4d4f574d9b20d2aa9ad2d46de0e2edb7b4c0235f",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "62c74108bcb0435c2153f963",
      "factorPackIds" : {
        "SIRI_TEXT_TO_SPEECH" : "6477d3dc6e7c8966f6d75bc2"
      },
      "deploymentId" : 240000205
    },
    {
      "rolloutId" : "60f8ddccefea4203d95cbeef",
      "factorPackIds" : {

      },
      "deploymentId" : 240000025
    }
  ],
  "experiments" : [
    {
      "treatmentId" : "d28d100b-301c-49ae-b6c9-57930102d4d4",
      "experimentId" : "64466b09a3b9440a82a18c34",
      "deploymentId" : 400000004
    },
    {
      "treatmentId" : "6dd670af-0633-45e4-ae5f-122ae4df02be",
      "experimentId" : "64406ba83deb637ac8a04419",
      "deploymentId" : 900000005
    }
  ]
}
}

Model: MacBookPro18,3, BootROM 8422.100.650, proc 8:6:2 processors, 16 GB, SMC 
Graphics: Apple M1 Pro, Apple M1 Pro, Built-In
Display: X38 S, 3840 x 1600 (Ultra-wide 4K), Main, MirrorOff, Online
Memory Module: LPDDR5, Hynix
AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x4387), wl0: Mar  8 2023 18:27:05 version 20.96.27.0.8.7.144 FWID 01-ec2ac09e
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB31Bus
USB Device: Ploopy Headphones
USB Device: USB31Bus
USB Device: USB3.1 Hub
USB Device: USB3.1 Hub
USB Device: USB2.0 Hub
USB Device: USB2.0 Hub
USB Device: USB2.1 Hub
USB Device: GameBall
USB Device: USB2.1 Hub
USB Device: Blue Snowball
USB Device: Atreus
USB Device: USB-C Digital AV Multiport Adapter
USB Device: USB31Bus
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.
george-norton commented 1 year ago

Thanks for the feedback, I don't have a Mac to test on, but the GitHub build action automatically produces Mac builds so I was just kinda hoping they would work out of the box like the Windows and Linux builds. I will take a look and see if there is anything in the build logs.

george-norton commented 1 year ago

I see references to Rosetta, seems like I am building for x86 and it is running under the translation layer. Probably there is no x86 libusb installed.

I see some instructions for enabling universal targets: https://tauri.app/v1/guides/building/macos/#binary-targets. I will give it a go later on when I have some time.

george-norton commented 1 year ago

@13tales if you get a chance, can you give these new binaries a try: https://github.com/george-norton/headphones-toolbox/releases/tag/test_mac_universal

13tales commented 1 year ago

That seems to have done it, thanks! Brilliant work.

FYI, since the binaries aren't signed with an Apple developer account or any of that jazz, they currently cause scary warnings to appear and require some mild hoop-jumping to actually run. Can't fault you for not wanting to go to the hassle of getting them signed, though.

george-norton commented 1 year ago

Thanks for the feedback, seems like getting them signed would require getting a Mac and paying $100 per year.. Any idea what open source projects generally do here? Are unsigned binaries unusual?