Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hid problem - even demo examples don't work (tried on two different machines) #368

Open
mhzareei opened this issue Sep 18, 2023 · 11 comments
Labels
bug help wanted macOS pr-lab chuck team pull-request lab

Comments

@mhzareei
Copy link

Hello,
I'm not able to run any of the basic hid demo examples on miniAudicle. The various connected devices are detected but there's no hid event being triggered / recognised when pressing keys or clicking. I've tried this on two different macs (a 2017 and a 2021 model) both running Ventura (13.3.1), and I have noticed this after installing the latest update (though it had been a long time since I tried to work with hid - so not sure if the issue is related to this particular update). Neither the internal keyboard, or an external USB keyboard / mouse seem to generate a hid event...

BTW, the terminal example (kbhit.ck) runs totally ok on Terminal.

Also, just before updating one of the 2021 mac to 1.5.1.3, I tried running the examples on an earlier version (1.3. something) and that worked ok. But I don't seem to be able to get it to work even after deleting and re-installing 1.3.5.1.

Thanks for looking into this.

@gewang
Copy link
Member

gewang commented Sep 18, 2023

could this be related to macOS input monitoring permission?
https://support.apple.com/guide/mac-help/control-access-to-input-monitoring-on-mac-mchl4cedafb6/mac

mine looks something like this:
Screenshot 2023-09-18 at 11 16 06 AM

@mhzareei
Copy link
Author

mhzareei commented Sep 18, 2023

I don't think so. I have both miniAudicle and Terminal enabled (though I don't have "chuck" exec versions).

I've just realised that miniAudicle crashes every time I stop the virtual machine after running the kb demo example.

So in short: I run the kb demo example in miniAudicle, and I do get the print command "keyboard 'Apple Internal Keyboard / Trackpad' ready", but no keyboard hits are detected. Then when I remove the shred and stop the virtual machine, miniAudicle crashes with the attached error message:

error.txt

I can run the same code (kb demo) using terminal and that works just fine.

@gewang
Copy link
Member

gewang commented Sep 18, 2023

thanks for the update! which kb demo are you running? this one?
https://chuck.stanford.edu/doc/examples/hid/kb.ck

cc @spencersalazar (anything jump out at you?)

@mhzareei
Copy link
Author

Yes that's the one (I've tried all the other ones too).
And I get the same issue on two different macbook pros (I'm planning on try it on a mac mini and and older mac later today).

@mhzareei
Copy link
Author

update: the hid examples work fine using external keyboard and mouse and a 2018 mac mini running Catalina (10.15.7) (same/latest miniaudicle/chuck version: 1.5.1.3).

@mhzareei
Copy link
Author

another update: just upgraded to the latest macOs (Ventura 13.5.2) on the macbook pro and still getting the same issue. In the while true loop in the hid examples (regardless of the type keyboard/mouse), the Hid event is never detected:

while( true ){
// wait on HidIn as event
hi => now;
// it never reaches the this line:
<<<"here?">>>;
50::ms => now;
. . .

And always crashes after removing the shred and stopping the virtual machine (with the error message attached earlier).

@mhzareei
Copy link
Author

Another update: A colleague just tried on his machine and ran into the same issue (no hid event detected from keyboard):
He's running an older version (1.3.5.2) on a Mackboor Pro 2020, Catalina (10.15.7). Seems like a mystery...

@gewang gewang added help wanted bug macOS pr-lab chuck team pull-request lab labels Sep 19, 2023
@gewang
Copy link
Member

gewang commented Sep 19, 2023

Thank you @mhzareei for all the different testing! Although I cannot repo this on my machines here (running Monterey and Ventura), I have definitely seen this issue crop up before, and always on mac. we may need to revisit our time-honored HID implementation (by @spencersalazar) which has stood the test of time but could use an update to more recent APIs.

flagging this issue for further chuck team review! @spencersalazar @nshaheed @marisevzyl

@gewang
Copy link
Member

gewang commented Sep 19, 2023

I wish there was a way to reliably manifest the issue here, would make it much easier to debug.
@mhzareei if you find any further information, please feel free to let us know using this thread!

@mhzareei
Copy link
Author

@gewang yes I bet that makes it tricky. Is there anything specific you'd like me to try and report back? Alternatively, happy to organise a Zoom session and give you remote access to my machine to try things out, but I'm not sure if that'd be particularly helpful?

@gewang
Copy link
Member

gewang commented Oct 5, 2023

potentially related
ccrma/miniAudicle#72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted macOS pr-lab chuck team pull-request lab
Projects
None yet
Development

No branches or pull requests

2 participants