News:

Precision Simulator update 10.184 (15 September 2025) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

Apple Silicon

Started by United744, Sun, 3 Nov 2024 19:53

United744

Hi,

Currently looking at picking up a MBP 16" M4 Max, and wondered what the current state of PSX was on Apple silicon?

I have run PSX in the past on Mac, but that was on Intel hardware.

Hardy Heinlin

Hi, there are currently no news on this subject.

andmiz

I run it on a M1 Mac. It's fine.

United744

Hi,

I finally received my Mac Mini earlier this week!! I opted for the Mini as the MBP doesn't seem to have adequate cooling for the M4 Pro.

I have Aerowinx mostly running, seemingly native to Apple Silicon (I installed the ARM version of Java).

I don't have any sound. I need to disable sound in the .prefs file to get Aerowinx to load. I'm guessing this is related to the fact I have the Arm version of Java installed??

Do I need to install the Intel version and run it under Rosetta?

I have macOS 15.2, JDK 1.8u431 installed.


United744

I just tried to install the x64 build and it complained about the wrong architecture, so I guess there is no way to install Java and run it under Rosetta??

Hardy Heinlin

Regrettably, this might be the point where the support for PSX-on-Apple ends, at least for a while. Unfortunately, I cannot guarantee that the support will continue forever ...

You may check if you can start PSX with sound while headphones are plugged in your Mac, so that the speakers are off. This trick works sometimes on iMacs.


Regards,

|-|ardy

FlyItLikeYouStoleIt

I have both Arm and Intel versions of Java installed on a ARM Macbook Pro:

george@MacBook-Pro-Max ~ % /usr/libexec/java_home -V

Matching Java Virtual Machines (2):
    11.0.20 (arm64) "Oracle Corporation" - "Java SE 11.0.20" /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
    1.8.431.10 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home

PSX works with either, though as stated before audio should be disabled before starting the Arm version.

To start the Arm version I go (from the Aerowinx directory):

JAVA_HOME=`/usr/libexec/java_home -v 11` java -jar AerowinxStart.jar
To start the Intel version I go:

JAVA_HOME=`/usr/libexec/java_home -v 1.8` java -jar AerowinxStart.jar
You can go to https://www.oracle.com/uk/java/technologies/downloads/ and scroll down, then choose an Arm build for Java 8 and an Intel build for Java 11 (or vice versa) and install both.

To make sure you have Rosetta 2 installed scroll to /Applications/Utilities and then right click on the Terminal app and Get Info, tick "Open with Rosetta" and then start Terminal. It will prompt you to install Rosetta if it is not already installed. Remember to untick the box once this is done.

MFarhadi

Quote from: FlyItLikeYouStoleIt on Wed,  8 Jan 2025 15:00PSX works with either, though as stated before audio should be disabled before starting the Arm version.


Once PSX is booted with audio off, can it be reselected using an external headphone plugged to an audio jack? or the whole audio is not available while using the ARM version?
Mohammadreza Farhadi
Ex-pilot, turned Ex-aerospace student, turned pilot again.

FlyItLikeYouStoleIt

No audio at all with Arm.

United744

Quote from: Hardy Heinlin on Wed,  8 Jan 2025 12:11Regrettably, this might be the point where the support for PSX-on-Apple ends, at least for a while. Unfortunately, I cannot guarantee that the support will continue forever ...

You may check if you can start PSX with sound while headphones are plugged in your Mac, so that the speakers are off. This trick works sometimes on iMacs.


Regards,

|-|ardy

Using the ARM build, I don't get any audio via any method. :(

Your support of PSX over the last 11 years, and Aerowinx since its inception, has been nothing short of outstanding!

United744

@FlyItLikeYouStoleIt: I installed the Intel version of JDK 11, and installed Rosetta 2 via the method you suggested, and I now have audio in the sim! Thank you!!!

@Hardy: I will try USB and see if it works, but so far, so good!! Looks like PSX will run on Apple Silicon after all! :D

United744

#11
For others wanting to run PSX on Apple Silicon, there are a few steps to perform:

* Install the ARM version of either 1.8 or 11.0 using disk image installer (this gets a basic Java install working easily)

* Get the Intel version of JDK .tar archive and extract to /Library/Java/JavaVirtualMachines

* Install Rosetta using the method described by FlyItLikeYouStoleIt, above:

To make sure you have Rosetta 2 installed scroll to /Applications/Utilities and then right click on the Terminal app and
Get Info, tick "Open with Rosetta" and then start Terminal. It will prompt you to install Rosetta if it is not already installed.
Remember to untick the box once this is done.

* Copy the following script to launch PSX. Place it in the PSX root folder:

#!/bin/zsh

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.25.jdk/Contents/Home

echo $JAVA_HOME

/Library/Java/JavaVirtualMachines/jdk-11.0.25.jdk/Contents/Home/bin/java -jar AerowinxStart.jar

* The first time you run the sim the .prefs file needs to have Sound=0 set

* Once PSX has loaded, go to preferences and enable audio. You will get a warning about the .dylib not being signed. Allow it to run. You should hear audio from the sim.

* Go to System Settings -> Privacy and Security -> Add exception for the dylib.

* Enable USB, and repeat the steps as completed for the audio.

Using the script enables multiple versions of Java to be installed, while selecting the earlier compatible version for PSX. Either 1.8 or 11 works. Later builds are not tested and may not work.

United744

I don't hold much stock in FPS counters, but they are useful for relative performance testing.

I noticed an interesting thing with the FPS counter on the Mac Mini. No matter what FPS limit I set, the FPS counter is a solid 10 FPS lower.

If I set 73, it shows 63; if I set 48/2; it shows 38. 48/3 makes no difference.

It seems to be solid and smooth though, which is all I care about. Just an interesting observation. Not sure how FPS is being counted to know whether the FPS counter is lying or not.

I don't see this behavior on Windows. I set 48; it shows 48.

Hardy Heinlin

The FPS counter indicates the number of actual frames in the past 1000 ms.

The FPS checkboxes on the Preferences page set the time delay for the highspeed loop in the Java code. For the highest frame rate it sets the time delay to 14 ms.

United744

Quote from: Hardy Heinlin on Thu,  9 Jan 2025 19:16The FPS counter indicates the number of actual frames in the past 1000 ms.

The FPS checkboxes on the Preferences page set the time delay for the highspeed loop in the Java code. For the highest frame rate it sets the time delay to 14 ms.

Interesting. I wonder why it is showing consistently 10 FPS less than selected?

Jeroen Hoppenbrouwers

Different 1000 ms.   😀

Hardy Heinlin

When the individual OS gets a delay instruction of, say, 14 ms, it's not guaranteed that it will always be exactly 14 as the CPU may have other tasks to do at the time of the instruction. So it may become 13 or 15 ms sometimes. Also note that these are integers, which adds to the deviation accumulation.

1000 / 13 = 76
1000 / 14 = 71
1000 / 15 = 67

You see, a fluctuation of just 1 ms can vary the FPS by over 5 %.

But it doesn't matter. The important thing is that the FPS doesn't oscillate too much.

United744

Quote from: Hardy Heinlin on Fri, 10 Jan 2025 19:48When the individual OS gets a delay instruction of, say, 14 ms, it's not guaranteed that it will always be exactly 14 as the CPU may have other tasks to do at the time of the instruction. So it may become 13 or 15 ms sometimes. Also note that these are integers, which adds to the deviation accumulation.

1000 / 13 = 76
1000 / 14 = 71
1000 / 15 = 67

You see, a fluctuation of just 1 ms can vary the FPS by over 5 %.

But it doesn't matter. The important thing is that the FPS doesn't oscillate too much.

I understand that. :)

It doesn't appear to be an issue and the sim is nice and smooth. Just a curious observation, and not expected. 10 FPS is, IMHO, far beyond a rounding error.


Jeroen Hoppenbrouwers

My guess here is that the Intel simulator isn't exactly tuned or is smooth but has regular interrupts that escape PSX's attention. This is why the 1000 ms (which comes from a clock of some sort, not from PSX counting events) may be off a bit. Especially if on ARM (sans sound) the reported performance is spot on.

It all depends on how the 1000 ms information gets to PSX. And, of course, whether PSX gets the sleep it asks for. If there is a consistent 2 ms extra sleep because the Intel simulator also needs to wait on the ARM to honour its request, you get there. As Hardy said, as long as it is smooth and steady, it's fine.

Hoppie