backslash-f / ShockEmu

Keyboard support for Dualshock emulation for PS Remote Play (macOS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[M1 related?] SyntaxError: invalid syntax

paulosigales opened this issue · comments

paulosigales@Paulos-Mac-mini ShockEmu % ./build.sh example.se
  File "shockemu.py", line 49
    print('{v} = {k};'.format(v=v,k=k),file=fp)
                                           ^
SyntaxError: invalid syntax
iohid_wrap.m:64:35: warning: cast to smaller integer type 'unsigned int' from 'IOHIDDeviceRef _Nonnull' (aka 'struct __IOHIDDevice *') [-Wpointer-to-int-cast]
        printf("IOHIDDeviceOpen %08x\n", (unsigned int) device);
                                         ^~~~~~~~~~~~~~~~~~~~~
1 warning generated.
paulosigales@Paulos-Mac-mini ShockEmu % 
paulosigales@Paulos-Mac-mini ShockEmu % csrutil status
System Integrity Protection status: disabled.

Command line tools - version: 12.5.0.0.1.1617976050
Big Sour 11.3 - Mac Mini M1
Bluetooth keyboard - Logitech K380

Some idea?

Which Python version are you in? python --version

Which Python version are you in? python --version

Python 2.7.16

@backslash-f
I changed to python3 and the error persist.
*** I think that I changed, at least when I run python --version now:

python --version
Python 3.9.4

That looks correct.

I'm also on Python 3.9.4 and I cannot reproduce the issue.
But I'm not using a M1 processor, so I wonder if that plays a role...

Out of curiosity, what happens when you do ./build.sh only_keyboard.se?

(Before doing that, please run which python and double check if it's coming from the correct path.
If you installed it using Homebrew, then it should be /usr/local/opt/python/libexec/bin/python.)

(BTW: to simplify things, I just removed the example.se file from this repo.)

Here's my output (I get a warning, but no errors):

terminal

Last login: Sun May  2 15:27:39 on ttys000
paulosigales@Paulos-Mac-mini ShockEmu % python --version
Python 3.9.4
paulosigales@Paulos-Mac-mini ShockEmu % which python
python: aliased to /opt/homebrew/bin/python3
paulosigales@Paulos-Mac-mini ShockEmu % ./build.sh only_keyboard.se
  File "shockemu.py", line 49
    print('{v} = {k};'.format(v=v,k=k),file=fp)
                                           ^
SyntaxError: invalid syntax
iohid_wrap.m:64:35: warning: cast to smaller integer type 'unsigned int' from 'IOHIDDeviceRef _Nonnull' (aka 'struct __IOHIDDevice *') [-Wpointer-to-int-cast]
        printf("IOHIDDeviceOpen %08x\n", (unsigned int) device);
                                         ^~~~~~~~~~~~~~~~~~~~~
1 warning generated.
paulosigales@Paulos-Mac-mini ShockEmu % 

Thanks for the extra info.

I still can't reproduce this one... It may have to do with M1. ¯\_(ツ)_/¯
I'll keep this open so others may jump in and help out. 🐛

Maybe when you try to "build" it uses python2 instead of python3. Try to make Symlink like I did

ls -l /usr/local/bin/python*

it worked for me

commented

I'm having the same issue with my m1 MacBook Pro - running python3 and getting the same errors. Can't figure out a way to get this to correctly run :(

The 1st error is related to python - I'd suggest to change in build.sh the line to:

python3 shockemu.py $1

The second error is ObjectiveC. The following worked for me:

printf("IOHIDDeviceOpen %08lx\n", (unsigned long int) device);

Worked... well, it compiles. Now I have to test it.

commented

It compiled like you said - I get an error when running run.sh however... Any ideas?

Process: RemotePlay [57749]
Path: /Applications/RemotePlay.app/Contents/MacOS/RemotePlay
Identifier: RemotePlay
Version: 4.1.0 (4.1.0)
Code Type: X86-64 (Translated)
Parent Process: ??? [57748]
Responsible: Terminal [50406]
User ID: 502

Date/Time: 2021-07-21 20:47:02.899 -0400
OS Version: macOS 11.4 (20F71)
Report Version: 12
Anonymous UUID:

Sleep/Wake UUID:

Time Awake Since Boot: 270000 seconds
Time Since Wake: 1700 seconds

System Integrity Protection: disabled

Crashed Thread: 0

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

Termination Reason: DYLD, [0x9]

Application Specific Information:
dyld: launch, loading dependent libraries
DYLD_FORCE_FLAT_NAMESPACE=1
DYLD_INSERT_LIBRARIES=iohid_wrap.dylib

Dyld Error Message:
could not load inserted library 'iohid_wrap.dylib' because no suitable image found. Did find:
iohid_wrap.dylib: mach-o, but wrong architecture
iohid_wrap.dylib: stat() failed with errno=1

Binary Images:
0x104025000 - 0x1043acfff +com.playstation.RemotePlay (4.1.0 - 4.1.0) <30626901-2825-3E1E-9324-1AEF9738FF19> /Applications/RemotePlay.app/Contents/MacOS/RemotePlay
0x2044ef000 - 0x20458afff dyld (852) <1AC76561-4F9A-34B1-BA7C-4516CACEAED7> /usr/lib/dyld
0x7ffdffc28000 - 0x7ffdffc9bfff +runtime (203.46) /Library/Apple/*/runtime

Model: MacBookPro17,1, BootROM 6723.120.36, proc 8:4:4 processors, 16 GB, SMC
Graphics: kHW_AppleM1Item, Apple M1, spdisplays_builtin
Memory Module: LPDDR4
AirPort: spairport_wireless_card_type_airport_extreme, wl0: Apr 28 2021 19:53:33 version 18.50.40.7.7.8.119 FWID 01-e6894c69
Bluetooth: Version 8.0.5d7, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB 3.1 Bus
USB Device: USB 3.1 Bus
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.

The original issue reported here is fixed (python 2 vs python 3) as well as the generated warning.

If other issues are still happening, please open a new bug.