jaboles / DVA5

CityRail DVA/Plasma Screen Emulator
58 stars 4 forks source link

No Sound on M1/Apple Silicon #16

Closed kurisubrooks closed 2 years ago

kurisubrooks commented 3 years ago

Hi there, I just recently got an M1 Macbook Pro and copied my DVA 5 build from my old Intel Macbook Pro to it and decided to try out some sounds to see how things were going, but it appears that something's broken along the way.

I've included the error log below, but I thought I'd point out some things here, in case it's helpful.

I'm using the Zulu JDK 17 (amd64), as is logged on the 2nd line, but further down it appears the program is having trouble finding/loading the sound library (xuggle) from the System Java libraries path.

Is xuggle something that I need to install manually? Perhaps it's not included with this build of the JDK, etc.

Do let me know if I can help in any way.

30/10/2021 11:10:43.813 [jb.dvacommon.DVA.main] [INFO] - argc: 0
30/10/2021 11:10:43.844 [jb.dvacommon.DVA.<init>] [INFO] - DVA 5.3.22, Java 17.0.1 aarch64
30/10/2021 11:10:43.844 [jb.dvacommon.DVA.<init>] [INFO] - OS Mac OS X 12.0.1
30/10/2021 11:10:43.844 [jb.dvacommon.DVA.<init>] [INFO] - Temp is /var/folders/m5/z6f47_052pgd9h221fq_73nm0000gn/T/
SwixML 1.2 (#140)
30/10/2021 11:10:43.995 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/start4-CHIME.mp3
30/10/2021 11:10:43.995 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/start4-D.f.mp3
30/10/2021 11:10:43.995 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/start4-V.f.mp3
30/10/2021 11:10:43.995 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/start4-A.f.mp3
30/10/2021 11:10:43.995 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/start4-5.f.mp3
30/10/2021 11:10:44.039 [com.xuggle.ferry.JNILibraryLoader.loadLibrary0] [SEVERE] - Could not load library: xuggle; version: 5; Visit http://www.xuggle.com/xuggler/faq/ to find common solutions to this problem
Exception in thread "Thread-1" java.lang.UnsatisfiedLinkError: no xuggle in java.library.path: /Users/kurisu/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2429)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
    at java.base/java.lang.System.loadLibrary(System.java:1989)
    at com.xuggle.ferry.JNILibraryLoader.loadLibrary0(JNILibraryLoader.java:268)
    at com.xuggle.ferry.JNILibraryLoader.loadLibrary(JNILibraryLoader.java:171)
    at com.xuggle.ferry.JNILibrary.load(JNILibrary.java:161)
    at com.xuggle.ferry.FerryJNI.<clinit>(FerryJNI.java:16)
    at com.xuggle.ferry.Ferry.<clinit>(Ferry.java:25)
    at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19)
    at com.xuggle.xuggler.IAudioSamples$Format.<clinit>(IAudioSamples.java:412)
    at jb.common.sound.xuggle.MediaConcatenator2.concat(MediaConcatenator2.java:35)
    at jb.common.sound.Player.run2(Player.java:127)
    at jb.common.sound.Player.run(Player.java:85)
30/10/2021 11:10:44.502 [jb.plasma.TimetableManager.loadFrom] [INFO] - Loaded timetable: 15 lines, 36 directions, 3501 trains
30/10/2021 11:10:44.532 [jb.plasma.TimetableManager.loadFrom] [INFO] - Loaded timetable: 14 lines, 32 directions, 2358 trains
30/10/2021 11:10:44.807 [jb.dvacommon.Updater.updateAvailable] [INFO] - Checking available updaters for a version newer than 5.3.22, suppressed version 
30/10/2021 11:10:44.808 [jb.dvacommon.Updater.updateAvailable] [INFO] - Jar folder: /Applications/DVA.app/Contents/MacOS
30/10/2021 11:10:45.394 [jb.dvacommon.Updater.updateAvailable] [INFO] - No new version
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/3 ascending chimes.mp3
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/silence200msec.wav
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/Attention.mp3
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/silence50msec.wav
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/defective.mp3
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/announcements.mp3
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/and.mp3
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/young children.mp3
30/10/2021 11:10:48.814 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/are causing delays to the CityRail system.mp3
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/silence200msec.wav
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/We are unable to continue this.mp3
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/defective.mp3
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/announcement.mp3
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/silence200msec.wav
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/Please move towards the centre of the.mp3
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/tulip festival.mp3
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/as we rectify the problem.mp3
30/10/2021 11:10:48.815 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/silence200msec.wav
30/10/2021 11:10:48.816 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/the CityRail system.mp3
30/10/2021 11:10:48.816 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Users/Shared/Library/Application%20Support/DVA/Sydney-Male.jar!/thanks you for your co-operation.mp3
30/10/2021 11:10:48.816 [jb.common.sound.Player.<init>] [INFO] - jar:file:/Applications/DVA.app/Contents/MacOS/DVA.jar!/resources/silence200msec.wav
Exception in thread "Thread-4" java.lang.NoClassDefFoundError: Could not initialize class com.xuggle.xuggler.IAudioSamples$Format
    at jb.common.sound.xuggle.MediaConcatenator2.concat(MediaConcatenator2.java:35)
    at jb.common.sound.Player.run2(Player.java:127)
    at jb.common.sound.Player.run(Player.java:85)
jaboles commented 2 years ago

Thank you for the detailed info and logs.

Xuggler is a java library used to play sound and as you have found the effect of not being able to load it on Arm64 is not getting any sound. Though it's a Java library it uses Ffmpeg under the hood and has native bindings to that. The existing version used by DVA has native libraries for i386 and x86_64 (ie. 32- and 64-bit Intel) but not Arm64. Unfortunately it's been deprecated by its original owner, though someone appears to have forked it (https://github.com/olivierayache/xuggle-xuggler) and is actively updating it. I'm going to contact them and see if I can build a new version of it for Arm64.

jaboles commented 2 years ago

This is now fixed (by migrating from Xuggle to FFmpeg, which Xuggle used under the hood anyway) and will be in the upcoming release.

While I have no way to test this right now, there is no Apple M1 silicon build of FFmpeg but as a static binary it should run under Rosetta with no problems. Not sure if Xuggle's .dylib would have worked, the Java code did not try to load a native library because it was written before 'aarch64' was a possible value.