mSparks43 / XPlane-11-AutoATC-plugin

C/C++ Source code for Xplane AutoATC plugin
GNU Lesser General Public License v3.0
16 stars 7 forks source link

MacOS M1/X ARM64 Support #97

Closed WilliamHiggs closed 2 years ago

WilliamHiggs commented 2 years ago

I'm guessing it's a long shot, but are there any plans to move this project up to the new M1 Apple chips.

I've spent a good few hours today trying to implement this project on macOS Monterey 12.0.1 with the Apple M1 Max chip but never got it working, I only ever see the error "JVM Offline" & "Update JVM location".

If anyone has got this plugin working with x-plane-11 on one of these machines I'd love to know how!

Once exhausting all the adoptOpenJDK options I moved to ARM64 ready Zulu JDK with Zulu JRE, pointing the jvmsettings file to that, still no luck.

mSparks43 commented 2 years ago

you should be able to use it with the M1 JVM from Liberica https://bell-sw.com/announcements/2021/03/12/Liberica-on-Apple-Silicon/ https://bell-sw.com/pages/downloads/#/java-11-lts

If you've got as far as getting the plugin built, it should just need the jvmsettings.txt pointing to the location of a working (not quarantined) version of libjvm.dylib (can check all is good with java -version in the jvm folder)

I'm not sure if "m1" build of the jvm will work or not, or if it needs the x86_64 version (because aiui, XP 11 is only x86_64, and m1 native is an all or nothing thing)

WilliamHiggs commented 2 years ago

Thanks for the reply!

I'll give the Liberica JVM a go this evening and let you know how I get on.

You're right about XP11 only being x86_64, I must be running it with Rosetta.

Building the original project on the M1 machine, all works fine using Rosetta2 to build using arch x86_64, I still get the JVM offline message on the plugin though, even when I use the ready built version(0.9.6.1), I rarely use Java (only what i need to get Android apps to run) so i might have my settings all wrong.

mSparks43 commented 2 years ago

pointing the jvmsettings file to that, still no luck.

Just in case, the jvm it points to is in the "mac" object in that file, thats chosen by https://github.com/mSparks43/XPlane-11-AutoATC-plugin/blob/58c782146640ad20b50db9df19fa96bf8b61f42c/src/jvm.cpp#L285

is it correctly printing to the right place in "JVM library is "

WilliamHiggs commented 2 years ago

I've created a fresh install of AutoATC & XP11 on my Intel Core i7 machine running macOS Big Sur with Oracle-16.0.1 & got the plugin working fine & dandy after accepting the security preferences & using sudo xattr -rc jdk-11.0.7+10-jre

I did the exact same thing on the M1 & tried several different installs of Java: Zulu-11 & 8, (arm64), Liberica-16 (arm64), Oracle-16.0.1 (x86_64). Still no luck, I still see "Update JVM Location" everytime, I wonder if jvm.cpp is printing out __APPLE__ is there a way to see this as it runs? Not ever used C++ before so not sure if I can put the plugin in verbose mode or something?

mSparks43 commented 2 years ago

if you run Xplane from the command line it should print out the "JVM library is " line as xplane starts

For this mac mini that is ./X-Plane.app/Contents/MacOS/X-Plane X-Plane.app

and gives JVM library is Resources/plugins/AutoATC/macjre/jdk-11.0.7+10-jre/Contents/Home/lib/server/libjvm.dylib AutoATC: Using option: -Xdump:none AutoATC: Using option: -Xgc:scvNoAdaptiveTenure AutoATC: Using option: -Xdisableexplicitgc AutoATC: Using option: -Xgcpolicy:balanced AutoATC: Using option: -Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar AutoATC: Using option: -Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache AutoATC: Initialising the JVM

< HTTP/1.1 200 OK

WilliamHiggs commented 2 years ago

Big log time:

AutoATC: Settings are {"lin":{"library":"Resources/plugins/AutoATC/linuxjre/jdk-11.0.7+10-jre/lib/server/libjvm.so","options":["-Xdump:none","-Xgc:scvNoAdaptiveTenure","-Xdisableexplicitgc","-Xgcpolicy:balanced","-Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar","-Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache"]},"mac":{"library":"Resources/plugins/AutoATC/macjre/jdk-11.0.7+10-jre/Contents/Home/lib/server/libjvm.dylib","options":["-Xdump:none","-Xgc:scvNoAdaptiveTenure","-Xdisableexplicitgc","-Xgcpolicy:balanced","-Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar","-Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache"]},"win":{"library":"Resources/plugins/AutoATC/windowsjre/jdk-11.0.7+10-jre/bin/server/jvm.dll","options":["-Xdump:none","-Xgc:scvNoAdaptiveTenure","-Xdisableexplicitgc","-Xgcpolicy:balanced","-Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar","-Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache"]}}
JVM library is Resources/plugins/AutoATC/macjre/jdk-11.0.7+10-jre/Contents/Home/lib/server/libjvm.dylib
AutoATC: Using option: -Xdump:none
AutoATC: Using option: -Xgc:scvNoAdaptiveTenure
AutoATC: Using option: -Xdisableexplicitgc
AutoATC: Using option: -Xgcpolicy:balanced
AutoATC: Using option: -Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar
AutoATC: Using option: -Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache
AutoATC: Initialising the JVM 
< HTTP/1.1 302 Moved Temporarily
* Server nginx/1.10.0 (Ubuntu) is not blacklisted
< Server: nginx/1.10.0 (Ubuntu)
< Date: Thu, 25 Nov 2021 19:55:04 GMT
< Content-Type: text/html
< Content-Length: 170
< Connection: keep-alive
< Location: http://lookup-a.x-plane.com/_lookup_11_/server_list_11.txt
< 
* Ignoring the response-body
* Connection #0 to host lookup.x-plane.com left intact
* Issue another request to this URL: 'http://lookup-a.x-plane.com/_lookup_11_/server_list_11.txt'
* Hostname was NOT found in DNS cache
*   Trying 134.122.112.129...
< HTTP/1.1 200 OK
* Server nginx/1.10.0 (Ubuntu) is not blacklisted
< Server: nginx/1.10.0 (Ubuntu)
< Date: Thu, 25 Nov 2021 19:55:04 GMT
< Content-Type: text/plain
< Content-Length: 5143
< Last-Modified: Wed, 16 Jun 2021 16:17:05 GMT
< Connection: keep-alive
< ETag: "60ca2401-1417"
< Accept-Ranges: bytes
< 
* Connection #1 to host lookup.x-plane.com left intact
AutoATC: Initialised the JVM 
AutoATC: Java Version 10.0 
AutoATC active!
* Connected to lookup-a.x-plane.com (134.122.112.129) port 80 (#2)
> GET /_lookup_11_/server_list_11.txt HTTP/1.1
User-Agent: X-Plane 11.55r2-1-APL10.16(21A559)_64bit
Host: lookup-a.x-plane.com
Accept: */*

* Hostname was NOT found in DNS cache
*   Trying 159.203.95.158...
< HTTP/1.1 200 OK
* Server nginx/1.14.0 (Ubuntu) is not blacklisted
< Server: nginx/1.14.0 (Ubuntu)
< Date: Thu, 25 Nov 2021 19:55:04 GMT
< Content-Type: text/plain
< Content-Length: 694
< Last-Modified: Tue, 03 Aug 2021 20:14:49 GMT
< Connection: keep-alive
< ETag: "6109a3b9-2b6"
< Accept-Ranges: bytes
< 
* Connection #2 to host lookup-a.x-plane.com left intact
* Connected to lookup.x-plane.com (159.203.95.158) port 80 (#3)
> GET /_lookup_11_/server_features_11.txt HTTP/1.1
User-Agent: X-Plane 11.55r2-1-APL10.16(21A559)_64bit
Host: lookup.x-plane.com
Accept: */*

enable tcasNAVT: Airspace: 125164 usec
< HTTP/1.1 200 OK
* Server nginx/1.10.0 (Ubuntu) is not blacklisted
< Server: nginx/1.10.0 (Ubuntu)
< Date: Thu, 25 Nov 2021 19:55:04 GMT
< Content-Type: text/plain
< Content-Length: 688
< Last-Modified: Tue, 28 Jul 2020 16:24:57 GMT
< Connection: keep-alive
< ETag: "5f205159-2b0"
< Accept-Ranges: bytes
< 
* Connection #3 to host lookup.x-plane.com left intact
* Hostname was NOT found in DNS cache
*   Trying 142.250.179.238...
* Connected to www.google-analytics.com (142.250.179.238) port 80 (#4)
> POST /collect HTTP/1.1
User-Agent: X-Plane 11.55r2-1-APL10.16(21A559)_64bit
Host: www.google-analytics.com
Accept: */*
Content-Type: application/json
Content-Length: 323

* upload completely sent off: 323 out of 323 bytes
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Date: Thu, 25 Nov 2021 19:55:06 GMT
< Pragma: no-cache
< Expires: Fri, 01 Jan 1990 00:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Last-Modified: Sun, 17 May 1998 03:00:00 GMT
< X-Content-Type-Options: nosniff
< Content-Type: image/gif
< Cross-Origin-Resource-Policy: cross-origin
* Server Golfe2 is not blacklisted
< Server: Golfe2
< Content-Length: 35
< 
* Connection #4 to host www.google-analytics.com left intact
* Hostname was NOT found in DNS cache
*   Trying 142.250.179.238...
* Connected to www.google-analytics.com (142.250.179.238) port 80 (#5)
> POST /collect HTTP/1.1
User-Agent: X-Plane 11.55r2-1-APL10.16(21A559)_64bit
Host: www.google-analytics.com
Accept: */*
Content-Type: application/json
Content-Length: 351

* upload completely sent off: 351 out of 351 bytes
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Date: Thu, 25 Nov 2021 19:55:06 GMT
< Pragma: no-cache
< Expires: Fri, 01 Jan 1990 00:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Last-Modified: Sun, 17 May 1998 03:00:00 GMT
< X-Content-Type-Options: nosniff
< Content-Type: image/gif
< Cross-Origin-Resource-Policy: cross-origin
* Server Golfe2 is not blacklisted
< Server: Golfe2
< Content-Length: 35
< 
* Connection #5 to host www.google-analytics.com left intact
* Hostname was NOT found in DNS cache
*   Trying 142.250.179.238...
* Connected to www.google-analytics.com (142.250.179.238) port 80 (#6)
> POST /collect HTTP/1.1
User-Agent: X-Plane 11.55r2-1-APL10.16(21A559)_64bit
Host: www.google-analytics.com
Accept: */*
Content-Type: application/json
Content-Length: 381

* upload completely sent off: 381 out of 381 bytes
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Date: Thu, 25 Nov 2021 19:55:07 GMT
< Pragma: no-cache
< Expires: Fri, 01 Jan 1990 00:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Last-Modified: Sun, 17 May 1998 03:00:00 GMT
< X-Content-Type-Options: nosniff
< Content-Type: image/gif
< Cross-Origin-Resource-Policy: cross-origin
* Server Golfe2 is not blacklisted
< Server: Golfe2
< Content-Length: 35
< 
* Connection #6 to host www.google-analytics.com left intact
* Hostname was NOT found in DNS cache
*   Trying 142.250.179.238...
* Connected to www.google-analytics.com (142.250.179.238) port 80 (#7)
> POST /collect HTTP/1.1
User-Agent: X-Plane 11.55r2-1-APL10.16(21A559)_64bit
Host: www.google-analytics.com
Accept: */*
Content-Type: application/json
Content-Length: 475

* upload completely sent off: 475 out of 475 bytes
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Date: Thu, 25 Nov 2021 19:55:07 GMT
< Pragma: no-cache
< Expires: Fri, 01 Jan 1990 00:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Last-Modified: Sun, 17 May 1998 03:00:00 GMT
< X-Content-Type-Options: nosniff
< Content-Type: image/gif
< Cross-Origin-Resource-Policy: cross-origin
* Server Golfe2 is not blacklisted
< Server: Golfe2
< Content-Length: 35
< 
* Connection #7 to host www.google-analytics.com left intact
NAVT: NavData: 3692091 usec
NAVT: Navaids: 163723 usec
NAVT: Fixes: 300559 usec
NAVT: Airways: 428612 usec
disable tcasstopPlanes
AutoATC:stopping sound.
AutoATC: simulation thread woke up

FYI The last 3 lines are me closing the application. So on the preface, the logs looks like it's found the right JRE in the correct place, initialised the JVM. Getting a 302 & saying Hostname was NOT found in DNS cache, not sure what would cause this, hopefully you can advise.

Thank you for the help BTW

WilliamHiggs commented 2 years ago

So just did same command on the intel i7 machine, got some different log outs including in no particular order:

* Connection #2 to host lookup-a.x-plane.com left intact
AutoATC: Initialised the JVM 
AutoATC: Java Version 10.0 
AutoATC active!
AutoATC: Listening for broadcast packets on 53784
AutoATC active!
AutoATC: java.lang.StringIndexOutOfBoundsException: String index out of range: 9
AutoATC:    at java.base/java.lang.String.substring(Unknown Source)
AutoATC:    at jni.Commands.getData(Commands.java:267)
AutoATC: built af index
AutoATC: read latest af index
AutoATC: Initialised Airframes
AutoATC: obj cleaner done
----------------
enable tcasAutoATC: Threaded jvm joining
AutoATC: Threaded jvm joined
----------------
AutoATC: ISO-8859-1
AutoATC: 2021/11/25 21:13:40:325 GMT [WARN] HttpMethodBase - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
AutoATC: https://load1.zem-solutions.com/PokePost.AutoATCBeta
AutoATC: Got API
AutoATC: VoiceSetting now:FIRFilter+jetPilot+Volume(amount:0.95)
AutoATC: [dfki-obadiah-hsmm, cmu-rms-hsmm, dfki-poppy-hsmm, cmu-bdl-hsmm, dfki-spike-hsmm, dfki-prudence-hsmm, cmu-slt-hsmm]
AutoATC: 1 1=dfki-obadiah-hsmm
AutoATC: 2 2=cmu-rms-hsmm
AutoATC: 3 3=dfki-poppy-hsmm
AutoATC: 4 4=cmu-bdl-hsmm
AutoATC: 5 5=dfki-prudence-hsmm
AutoATC: 6 0=cmu-slt-hsmm
AutoATC: AI Controller started
AutoATC: PlaneData server started
AutoATC: AutoATC Radio warmed up
AutoATC: DataCollector starting
AutoATC: Phone server started
----------------
NAVT: NavData: 5954807 usec
AutoATC: Reading Resources/plugins/AutoATC/voice commands/defaultCommands.json
AutoATC: Read voice commands:[{"recognise":"gear up","command":"sim/flight_controls/landing_gear_up"},{"recognise":"disarm guns","commandArray":[{"command":"sim/cockpit2/weapons/weapon_selected=0","say":"guns disarmed"}]},{"recognise":"arm guns","commandArray":[{"command":"sim/cockpit2/weapons/weapon_selected=1"},{"command":"sim/weapons/armed[0]=1","say":"guns armed"}]},{"recognise":"emergency frequency","command":"sim/cockpit/radios/com1_freq_hz=12150"},{"recognise":"gear down","command":"sim/flight_controls/landing_gear_down"},{"recognise":"ok startup","commandArray":[{"say":"Throttle off","pause":7},{"command":"sim/magnetos/magnetos_both","pause":1,"say":"magnetos both"},{"command":"sim/engines/engage_starters","say":"engage starter"},{"command":"sim/engines/engage_starters"},{"command":"sim/engines/engage_starters"},{"command":"sim/engines/engage_starters"},{"command":"sim/engines/engage_starters"},{"command":"sim/engines/engage_starters"},{"command":"sim/engines/engage_starters"},{"command":"sim/engines/engage_starters","say":"mixture rich"},{"command":"sim/engines/engage_starters"},{"command":"sim/engines/engage_starters","pause":10},{"command":"sim/engines/clutch_on","say":"clutch on"}]}]
AutoATC: DataCollector run
NAVT: Navaids: 161260 usec

The M1 machine doesn't ever get this far unfortunately.

mSparks43 commented 2 years ago

So on the preface, the logs looks like it's found the right JRE in the correct place, initialised the JVM.

Yeah, something else is going on, could you drop in the xplane log for the m1, there should be more detail in that.

Getting a 302 & saying Hostname was NOT found in DNS cache, not sure what would cause this, hopefully you can advise.

This is just X-Plane seeing if there is an update in http://lookup-a.x-plane.com/_lookup_11_/server_list_11.txt

WilliamHiggs commented 2 years ago
log.txt for X-Plane 11.55r2 (build 115501 64-bit c22f0eb21d049f66fcba233c37e65c845605fc40)
 compiled on Jun 22 2021 17:22:25
X-Plane started on Fri Nov 26 19:48:43 2021

This log file is generated automatically by Laminar Research applications and contains diagnostics about your graphics hardware, installation, and any error conditions.
If you need to contact tech support or file a bug, please send us this file. NOTE: this file is rewritten every time you start ANY of your X-System applications.

macOS: Version 10.16 (Build 21A559)
CPU type: Apple M1 Max CPU speed (mhz): 2400 Bus speed (mhz): 100 RAM (MB): 32768

X-System folder:'/Users/xplaneuser/Applications/X-Plane 11/', case sensitive=0

-------------------------------------------------------------------
Application was launched with the following command line options...
    'X-Plane.app'
-------------------------------------------------------------------

OpenGL Vendor       : Apple
OpenGL Render       : Apple M1 Max
OpenGL Version      : 2.1 Metal - 76.1 (210/0)
OpenGL Extensions   : GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_draw_buffers2 GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_rectangle GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_APPLE_aux_depth_stencil GL_APPLE_client_storage GL_APPLE_element_array GL_APPLE_fence GL_APPLE_float_pixels GL_APPLE_flush_buffer_range GL_APPLE_flush_render GL_APPLE_packed_pixels GL_APPLE_pixel_buffer GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_specular_vector GL_APPLE_texture_range GL_APPLE_transform_hint GL_APPLE_vertex_array_object GL_APPLE_vertex_point_size GL_APPLE_vertex_program_evaluators GL_APPLE_ycbcr_422 GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_IBM_rasterpos_clip GL_NV_blend_square GL_NV_conditional_render GL_NV_depth_clamp GL_NV_fog_distance GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_SGI_color_matrix GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod 

sync/fence          : 1 
pbo_avail           : 1 frameblit_avail     : 1 framebuffer_msaa    : 1
gpu_shad4_avail     : 1 shad_lod_avail      : 1 array_tex_avail     : 1 texture_rg          : 1
tex_float_avail     : 1 seamless_avail      : 1 drawbuf2_avail      : 1 packed_stencil      : 1
framebuffer_srgb    : 1 copy_buf_avail      : 0 ubo_avail           : 0 gshader_avail       : 0
base_vert_avail     : 1 tex_multi_avail     : 0 depth_float_avail   : 1
instance_avail      : 1 tess_avail          : 0 viewport_arr        : 0 tex_storage         : 0
buf_storage         : 0 multi_bind          : 0 clip_control        : 0 program_binary      : 0
idx in vram         : 1
GLSL version        : 1.20/120
(16/4096/124/16/16/4096/4096/0)

anisotropic_avail   : 1 timer_avail         : 1 tess_avail          : 0 geom_avail          : 0 
viewport_arr        : 0 layer_arr           : 0 native_reverse_z    : 0 has_reverse_z       : 0 
max iso filtering   : 16
max samples         : 2
max texture size    : 16384 (hardware limit)
max tex units       : 16

This video card is: DX10 or 11 - With instancing
Diagnostics         : none

CPU count        : 10
0:00:00.000 I/wmgr: Monitor 0: { 0, 0, 1728, 1117 }
0:00:00.000 I/wmgr: Re-building fbos for window 0x7fdaa7f6d090
0:00:00.000 I/GFX: Loaded mapping Resources/shaders/bin/legacy_flat_mapping.xsv with hash: f66a30a2d61b481172cc9df214b4135
0:00:00.000 I/GFX: Loaded archive Resources/shaders/bin/glsl120/legacy_flat.xsa with hash: 6a20e89f8d46eedc94aa40552ce81bd1
0:00:00.000 I/GFX: Loaded mapping Resources/shaders/bin/legacy_depth_mapping.xsv with hash: 44a33f1dcbf5f8d640112a20f696f5aa
0:00:00.000 I/GFX: Loaded archive Resources/shaders/bin/glsl120/legacy_depth.xsa with hash: 2aff615ce5cd4c534910f7a674a839
0:00:00.000 I/GFX: Loaded mapping Resources/shaders/bin/blit_mapping.xsv with hash: 6de0044b74657692166a316fdaaf721
0:00:00.000 I/GFX: Loaded archive Resources/shaders/bin/glsl120/blit.xsa with hash: 83e8c15d55d4d17f12127da6747599
0:00:00.000 I/GFX: Loaded mapping Resources/shaders/bin/font_mapping.xsv with hash: eb35e8f4bd6f87f1d98c64b8714aee2
0:00:00.000 I/GFX: Loaded archive Resources/shaders/bin/glsl120/font.xsa with hash: 93eac9ed88ff759afe4e2ad722c8ad35
0:00:00.000 I/GFX: Loaded mapping Resources/shaders/bin/line3d_mapping.xsv with hash: 957265e534485ae3e5acef3ca12c48dd
0:00:00.000 I/GFX: Loaded archive Resources/shaders/bin/glsl120/line3d.xsa with hash: 7c51cbde8ccc8fc4ebcf48587e14b6
0:00:00.000 I/GFX: Loaded mapping Resources/shaders/bin/terrain_mapping.xsv with hash: ab61276aa4bfad3c02343ea5e539d
0:00:00.000 I/GFX: Loaded archive Resources/shaders/bin/glsl120/terrain.xsa with hash: 29c1a4c54e2c7c99940b2af2fca5c45
OpenAL devices: MacBook Pro Speakers
Open AL default device:MacBook Pro Speakers
OpenAL vendor   : Apple Computer Inc.
OpenAL renderer  : Software
OpenAL version   : 1.1
OpenAL hardware  : MacBook Pro Speakers
OpenAL extensions: ALC_EXT_CAPTURE ALC_ENUMERATION_EXT ALC_EXT_MAC_OSX ALC_EXT_ASA ALC_EXT_ASA_DISTORTION ALC_EXT_ASA_ROGER_BEEP AL_EXT_OFFSET AL_EXT_LINEAR_DISTANCE AL_EXT_EXPONENT_DISTANCE AL_EXT_float32 AL_EXT_STATIC_BUFFER AL_EXT_SOURCE_NOTIFICATIONS AL_EXT_SOURCE_SPATIALIZATION

Fetching plugins for /Users/xplaneuser/Applications/X-Plane 11/Resources/plugins

Loaded: /Users/xplaneuser/Applications/X-Plane 11/Resources/plugins/PluginAdmin/mac.xpl (xpsdk.examples.pluginadmin).

a simple notepad in Resources/plugins/AutoATC
AutoATC: Settings are {"lin":{"library":"Resources/plugins/AutoATC/linuxjre/jdk-11.0.7+10-jre/lib/server/libjvm.so","options":["-Xdump:none","-Xgc:scvNoAdaptiveTenure","-Xdisableexplicitgc","-Xgcpolicy:balanced","-Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar","-Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache"]},"mac":{"library":"Resources/plugins/AutoATC/macjre/jdk-11.0.7+10-jre/Contents/Home/lib/server/libjvm.dylib","options":["-Xdump:none","-Xgc:scvNoAdaptiveTenure","-Xdisableexplicitgc","-Xgcpolicy:balanced","-Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar","-Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache"]},"win":{"library":"Resources/plugins/AutoATC/windowsjre/jdk-11.0.7+10-jre/bin/server/jvm.dll","options":["-Xdump:none","-Xgc:scvNoAdaptiveTenure","-Xdisableexplicitgc","-Xgcpolicy:balanced","-Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar","-Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache"]}}
AutoATC:Loading jvm dylib 'Resources/plugins/AutoATC/macjre/jdk-11.0.7+10-jre/Contents/Home/lib/server/libjvm.dylib' 
AutoATC: Successfully loaded the jvm .so
AutoATC: Using option: -Xdump:none
AutoATC: Using option: -Xgc:scvNoAdaptiveTenure
AutoATC: Using option: -Xdisableexplicitgc
AutoATC: Using option: -Xgcpolicy:balanced
AutoATC: Using option: -Djava.class.path=Resources/plugins/AutoATC_java/AutoATCPlugin.jar
AutoATC: Using option: -Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache
AutoATC: Initialising the JVM 
AutoATC: Initialised the JVM 
AutoATC: Java Version 10.0 
AutoATC: ERROR - Commands not found!
Loaded: /Users/xplaneuser/Applications/X-Plane 11/Resources/plugins/AutoATC/64/mac.xpl (zem.AutoATC.RadioTransciever).

a simple notepad in Resources/plugins/AutoATC
AutoATC: Active!
TCAS test plugin now has the AI planes!
0:00:00.000 I/PLG: The plugin AutoATC is setting global TCAS override to 1.
I found the following scenery packages (prioritized in this order):
  0 Custom Scenery/Southern_UK_scenery/
  1 Custom Scenery/Aerosoft - EBBR Brussels/
  2 Custom Scenery/Aerosoft - LSGG Genf/
  3 Custom Scenery/Aerosoft - EDDF Frankfurt/
  4 Custom Scenery/Aerosoft - EDLP Paderborn-Lippstadt/
  5 Custom Scenery/Aerosoft - EGLL Heathrow/
  6 Custom Scenery/Aerosoft - LFMN Nice Cote d Azur X/
  7 Custom Scenery/Aerosoft - LFPO Paris Orly/
  8 Custom Scenery/Aerosoft - LPFR Faro/
  9 Custom Scenery/LOWI Demo Area/
 10 Custom Scenery/Global Airports/
 11 Custom Scenery/KSEA Demo Area/
 12 Custom Scenery/X-Plane Landmarks - Chicago/
 13 Custom Scenery/X-Plane Landmarks - Dubai/
 14 Custom Scenery/X-Plane Landmarks - Las Vegas/
 15 Custom Scenery/X-Plane Landmarks - London/
 16 Custom Scenery/X-Plane Landmarks - New York/
 17 Custom Scenery/X-Plane Landmarks - Sydney/
 18 Custom Scenery/X-Plane Landmarks - Washington DC/
 19 Global Scenery/X-Plane 11 Demo Areas/
 20 Global Scenery/X-Plane 11 Global Scenery/
 21 Resources/default scenery/1000 autogen/
 22 Resources/default scenery/1000 decals/
 23 Resources/default scenery/1000 forests/
 24 Resources/default scenery/1000 roads/
 25 Resources/default scenery/1000 urban terrain/
 26 Resources/default scenery/1000 world terrain/
 27 Resources/default scenery/700 roads/
 28 Resources/default scenery/900 beaches/
 29 Resources/default scenery/900 europe objects/
 30 Resources/default scenery/900 forests/
 31 Resources/default scenery/900 roads/
 32 Resources/default scenery/900 us objects/
 33 Resources/default scenery/900 world object placeholders/
 34 Resources/default scenery/airport decals/
 35 Resources/default scenery/airport scenery/
 36 Resources/default scenery/default apt dat/
 37 Resources/default scenery/default atc dat/
 38 Resources/default scenery/sim objects/
 39 Resources/tutorials/tutorials_Alaska/
 40 Resources/tutorials/tutorials_Hawaii/
 41 Resources/tutorials/tutorials_Seattle/

0:00:00.000 D/HID: HID Bridge Running
0:00:00.336 I/NAVT: Airspaces are done loading async...
0:00:00.336 I/GFX: Loaded mapping Resources/shaders/bin/cube_filter_mapping.xsv with hash: 33a101719a461739a854b3b91e2e8fb
0:00:00.336 I/GFX: Loaded archive Resources/shaders/bin/glsl120/cube_filter.xsa with hash: 92fee438aad0b937b1c3dddcb04dc6a7
0:00:00.336 I/GFX: Loaded mapping Resources/shaders/bin/ground_lights_mapping.xsv with hash: efcb9dd432f7b8f41e1e501691f38a6
0:00:00.336 I/GFX: Loaded archive Resources/shaders/bin/glsl120/ground_lights.xsa with hash: d1af3224601a8c70bdbbacb5869af58
0:00:00.336 I/GFX: Loaded mapping Resources/shaders/bin/light_mapping.xsv with hash: a33261499add38908e4edee55486b85
0:00:00.336 I/GFX: Loaded archive Resources/shaders/bin/glsl120/light.xsa with hash: 18b72e498acca13951e8909ef356f
0:00:00.336 I/REN: Setting texture resolution read from prefs as 4
0:00:00.336 I/REN: Setting |draw view indicator read from prefs as 1.
0:00:00.336 I/REN: Setting |dim under high G-load or hypoxia read from prefs as 1.
0:00:00.336 I/REN: Setting |draw hi-res planet textures from orbit read from prefs as 1.
0:00:00.336 I/REN: Setting |draw forest fires and balloons read from prefs as 0.
0:00:00.336 I/REN: Setting |draw birds and deer in nice weather read from prefs as 1.
0:00:00.336 I/REN: Setting |draw aircraft carriers and frigates read from prefs as 1.
0:00:00.336 I/REN: Setting |draw Aurora Borealis read from prefs as 0.
0:00:00.336 I/REN: Setting |runways follow terrain contours read from prefs as 1.
0:00:00.336 I/REN: Setting |3-d drawing detail read from prefs as 3.
0:00:00.336 I/REN: Setting |water reflection detail read from prefs as 3.
0:00:00.336 I/REN: Setting |draw parked aircraft at airports read from prefs as 1.
0:00:00.336 I/REN: Setting compress textures to save VRAM read from prefs as 1.
0:00:00.336 I/REN: Setting |Effects read from prefs as 3.
0:00:00.336 I/REN: Setting |3-d shadows read from prefs as 0.
0:00:00.336 I/REN: Setting |HDR anti-aliasing read from prefs as 3.
0:00:00.336 I/REN: Setting |draw volumetric fog read from prefs as 1.
0:00:00.336 I/REN: Setting |draw per pixel lighting read from prefs as 1.
0:00:00.336 I/REN: Setting |atmospheric scattering read from prefs as 1.
0:00:02.613 I/NET: No IPv6 addresses available
0:00:02.613 I/NET: en0 (Wi-Fi) 192.168.0.23
0:00:02.613 I/NET: (RakNet) Init: Successful!
0:00:02.613 I/NAVT: NavData is done loading async...
0:00:02.613 I/NAVT: Navaids are done loading async...
0:00:02.613 I/NAVT: Fixes are done loading async...
0:00:02.613 I/NAVT: Airways are done loading async...
0:00:02.613 I/NAVT: All navt data is done loading async...
0:00:02.613 I/NET: UPnP-capable gateway found: http://192.168.0.14:65199/dd.xml
0:00:02.613 I/NET: UPnP init OK: gateway accepting UPnP requests
0:00:02.613 W/NET: UPnP add redirect failed: port 49010 for 192.168.0.23 (Action Failed)
0:00:12.319 D/STM: Transitioning from state state_InitialLoading to state_QuickFlightWizard
0:00:12.319 I/WIN: Showing subscreen Main Menu
0:00:12.319 I/OVR: User is entering the holodeck.
0:00:12.319 I/WIN: Opened window Primary V11 UI
0:00:16.876 I/SIM: Exiting the sim without confirmation
0:00:16.878 D/STM: Transitioning from state state_QuickFlightWizard to state_ShuttingDown
AUTOATC: XPluginDisable
0:00:16.878 I/PLG: The plugin AutoATC is setting global TCAS override to 0.
The plugin AutoATC is releasing control of AI aircraft.
0:00:16.878 I/PLG: The plugin AutoATC is setting global TCAS override to 0.
AUTOATC: XPluginStop
AUTOATC: deactivateJVM
AutoATC: JVM Stop!
AutoATC: plane thread stopped
AutoATC: simulation thread stopped
Clean exit from threads.
0:00:16.878 D/HID: HID Bridge Shutdown
0:00:16.878 W/NET: UPnP remove redirect failed: port 49010
0:00:16.878 W/NET: UPnP remove redirect failed: port 49000
----- X-Plane has shut down -----

The "AutoATC: ERROR - commands not found!" looks like its from jvm.cpp line: 430

    commandsClass = env->FindClass("jni/Commands");
    if(commandsClass == NULL) {
        hasjvm=false;
        loadedLibrary=true;
->      sprintf(gBob_debstr2,"AutoATC: ERROR - Commands not found!\n");
        XPLMDebugString(gBob_debstr2);
        return;
    }
mSparks43 commented 2 years ago

The "AutoATC: ERROR - commands not found!" looks like its from jvm.cpp line: 430

Exactly that, the jvm is actually loading, but its not finding the code in the jar. the actual line that fails is the one just before it https://github.com/mSparks43/XPlane-11-AutoATC-plugin/blob/58c782146640ad20b50db9df19fa96bf8b61f42c/src/jvm.cpp#L426

could you try putting the absolute path to the jar in the settings.

WilliamHiggs commented 2 years ago

Tried with absolute path & still no commands unfortunately.

-Xshareclasses:cacheDir=Resources/plugins/AutoATC_java/cache seems to work fine, I've been deleting the cache after each run so it'll bring in the new settings.

I tried adding some more debugging to jvm.cpp & built + ran last night but still couldn't find much.

Stumbled across this while looking for why its returning null but not sure if relevant or not as seems to be about multi-threading: https://stackoverflow.com/questions/26100902/jni-findclass-returns-null

mSparks43 commented 2 years ago

Stumbled across this while looking for why its returning null but not sure if relevant or not as seems to be about multi-threading:

FindClass failing means the jvm doesnt have the code in AutoATCPlugin.jar loaded (hence suggesting using a full path to it). Did have a similar issue already which is why there some that have two references to the classes, but reasonably sure this is before it gets that far.

This is definitely looking like its going to need code changes. Ill probably be getting an M1 macbook air sometime in the next week or so. I also want to move everything to java 17 - better performance and memory management, the AI Server moved over a month or two back.

WilliamHiggs commented 2 years ago

Thought that it might be irrelevant! If you need any more logs/debug stuff before you get an M1 Mac let me know I'll try help out where I can, as I said, my Java & C++ are limited to mainly Android Studio development but I've got enough general knowledge to get most things up and running if you need it.

mSparks43 commented 2 years ago

Thought that it might be irrelevant!

More relevant than anything I had found.

If you need any more logs/debug stuff before you get an M1 Mac let me know I'll try help out where I can

The chances seem fair that migrating to java 17 will fix it, the lack of other projects having this issue suggests its probably something to do with "the old way" of packaging stuff. I should get a new version up sometime in the next week, java 17 breaks lots of things that I will need to fix.

mSparks43 commented 2 years ago

using sudo xattr -rc jdk-11.0.7+10-jre

I downloaded the release zip. extracted it moved the two folders inside the zip file name into xplanes Resources/plugins directory from one finder window to the other then from the console: cd X-Plane\ 11 sudo xattr -dr com.apple.quarantine *

All seems to work (posted from my new M1 macbook air)

WilliamHiggs commented 2 years ago

followed the instructions above & still got the same error. What version Java do you get when doing java --version?

mSparks43 commented 2 years ago

followed the instructions above & still got the same error. What version Java do you get when doing java --version?

I'll have a look in a minute, but it was untouched from the factory, first thing I did was download the XP demo and the AutoATC plugin mac release.

What I think has happened is that -rc is different from -dr and only stripping the quarantine attributes from jdk-11.0.7+10-jre wouldn't strip it from all the jar files in the AutoATC_Java folder (AutoATCPlugin.jar and all the mary tts etc files in lib) - that would explain why the jvm can't open AutoATCPlugin.jar

__ EDIT:no system level java is installed, so just the jvm its bundled with and specified in jvmsettings.txt.

mSparks43 commented 2 years ago

Can you try the new release and see if that resolves it https://github.com/mSparks43/XPlane-11-AutoATC-plugin/releases/tag/v0.9.7

WilliamHiggs commented 2 years ago

Sorry for the delay -

I can confirm the new version works straight away on the M1x Machine.

Thank you very much for your help, I will enjoy this application thoroughly :)