question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pulseio library is broken on Apple Silicon hosts

See original GitHub issue

I’ve checked two boards on Apple Silicon platform:

  • Adafruit MCP2221A Breakout - pulseio is not supported. Hmm, why not?
  • u2if firmware on RPI Pico - pulseio doesn’t work while rip pico obviously supports it! Below I’m trying to fix the issue but the library is broken because it includes invalid binaries.
  1. Fix /opt/homebrew/lib/python3.10/site-packages/pulseio.py
...
if detector.board.any_raspberry_pi or detector.board.pico_u2if:
    from adafruit_blinka.microcontroller.bcm283x.pulseio.PulseIn import PulseIn
...
  1. Load the library and try to use it
import pulseio
pulses = pulseio.PulseIn(board.GP0, maxlen=200, idle_state=True)
OSError: [Errno 8] Exec format error: '/opt/homebrew/lib/python3.10/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64'

Opa - the library is broken completely. So it doesn’t work for any board.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
caternusoncommented, Dec 14, 2022

Ideally the PR would be submitted to: https://github.com/execuc/u2if

The Adafruit repo is a fork. It was forked to allowing PRing changes back upstream to execuc. I don’t think we’d want to maintain a separate fork.

0reactions
makermelissacommented, Dec 14, 2022

@caternuson wrote this. He’ll have to speak more about why it isn’t supported in u2if.

See @Neradoc 's comment above. u2if does not have support for pulseio.

The u2if firmware is 3rd party.

Ah, I didn’t realize. Closing here for now. Perhaps somebody could submit a PR to https://github.com/adafruit/u2if to add pwmio support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Alexey Pechnikov mobigroup - GitHub
pulseio library is broken on Apple Silicon hosts Dec 10. Show more activity. Seeing something unexpected? Take a look at the GitHub profile...
Read more >
Apple Silicon app builds but cannot launch
I thought it could be a signing issue and have tried automatic, manual, codesign and every option I can find for the app...
Read more >
Can't build to simulator on Apple Silicon
It only popped up when trying to build on my new M1 MacBook Air and Xcode 12. I've tried everything that's been reported...
Read more >
Repair your library in Photos on Mac - Apple Support
If the Photos app on your Mac is open, choose Photos > Quit Photos. Press Option-Command and double-click the Photos icon in the...
Read more >
Porting Your macOS Apps to Apple Silicon
Port your existing macOS app to Apple silicon by creating a universal binary and modifying your code to handle architectural differences.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found