tangobattle / tango

Play Mega Man Battle Network online with rollback netcode!
https://tango.n1gp.net
GNU Affero General Public License v3.0
85 stars 15 forks source link

Tango keeps crashing on open when Switch joycons are connected to Macbook #156

Open btruhand opened 1 year ago

btruhand commented 1 year ago

MacOS version: Ventura 13.0 Processor: Quad-Core Intel Core i7 Tango: 4.0.23

I saw that support for Switch Joycons is available for Tango. But whenever I try to open Tango while my Macbook is connected to my Switch joycons it would crash. The log outputs are always the same (pasting just the crash reason):

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SdlError("Couldn't open Bluetooth_057e_2006_0x7fe5e8704080")', tango/src/main.rs:253:54
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result<T,E>::unwrap
   4: tango::child_main
   5: tango::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

The program doesn't crash when Tango is already open and I connect my Switch joycons, but the program wouldn't pick up the inputs from the joycons (didn't check the logs for thesee, but can try and replicate if needed)

I also noticed that my Switch joycon bluetooth connection identifier (the green lights) would be at 2 green lights whenever I have it connected with Tango open, which I think means that it is connected as the second device to the bluetooth interface. But I checked and there were no other bluetooth devices connected to my Macbook

btruhand commented 1 year ago

I also noticed that my Switch joycon bluetooth connection identifier (the green lights) would be at 2 green lights

This SDL issue ticket might be relevant https://github.com/libsdl-org/SDL/issues/6367

[2022-11-04T03:54:26Z INFO  tango] welcome to tango 4.0.23!
[2022-11-04T03:54:26Z INFO  tango::graphics::glutin] GL version: 4.1 ATI-4.9.48, extensions: {"GL_ARB_vertex_type_2_10_10_10_rev", "GL_ARB_texture_rgb10_a2ui", "GL_ARB_gpu_shader5", "GL_ARB_blend_func_extended", "GL_EXT_depth_bounds_test", "GL_EXT_texture_compression_s3tc", "GL_EXT_texture_filter_anisotropic", "GL_ARB_explicit_attrib_location", "GL_EXT_texture_sRGB_decode", "GL_APPLE_texture_range", "GL_ARB_separate_shader_objects", "GL_EXT_texture_mirror_clamp", "GL_NV_texture_barrier", "GL_ARB_vertex_attrib_64bit", "GL_ARB_transform_feedback2", "GL_ARB_tessellation_shader", "GL_ARB_texture_gather", "GL_APPLE_client_storage", "GL_APPLE_rgb_422", "GL_ARB_texture_cube_map_array", "GL_ARB_shader_bit_encoding", "GL_EXT_debug_label", "GL_ARB_texture_query_lod", "GL_APPLE_container_object_shareable", "GL_ARB_draw_buffers_blend", "GL_ARB_texture_buffer_object_rgb32", "GL_ARB_transform_feedback3", "GL_ARB_instanced_arrays", "GL_ARB_shading_language_include", "GL_ARB_viewport_array", "GL_ARB_sampler_objects", "GL_ARB_occlusion_query2", "GL_ARB_gpu_shader_fp64", "GL_ARB_ES2_compatibility", "GL_ARB_internalformat_query", "GL_ARB_sample_shading", "GL_APPLE_flush_render", "GL_APPLE_object_purgeable", "GL_ARB_shader_subroutine", "GL_ATI_texture_mirror_once", "GL_ARB_draw_indirect", "GL_ARB_timer_query", "GL_ARB_texture_storage", "GL_APPLE_row_bytes", "GL_ARB_texture_swizzle", "GL_EXT_debug_marker"}
[2022-11-04T03:54:27Z INFO  tango::updater] current version is already latest: 4.0.23 vs 4.0.23
[2022-11-04T03:54:27Z INFO  tango::audio::sdl2] sdl2 audio spec: AudioSpec { freq: 48000, format: S16LSB, channels: 2, silence: 0, samples: 512, size: 2048 }
[2022-11-04T03:54:28Z INFO  tango] controller added: Nintendo Switch Joy-Con (L/R)
[2022-11-04T03:54:28Z INFO  tango::game] /Users/btaratruhandarien/Documents/Tango/roms/Megaman Battle Network 6 - Cybeast Gregar (U).gba: ("bn6", 0)
[2022-11-04T03:54:28Z INFO  tango::save] /Users/btaratruhandarien/Documents/Tango/saves/BN6 Gregar.sav: ("bn6", 0)
[2022-11-04T03:54:28Z INFO  tango::save] /Users/btaratruhandarien/Documents/Tango/saves/Gregar fresh.sav: ("bn6", 0)
[2022-11-04T03:54:28Z INFO  tango::patch] starting patch autoupdater
[2022-11-04T03:54:28Z INFO  tango] controller added: Nintendo Switch Joy-Con (L/R)
[2022-11-04T03:54:28Z INFO  tango::gui] language was changed to en-US
[2022-11-04T03:54:28Z INFO  tango] controller added: Nintendo Switch Joy-Con (L/R)
[2022-11-04T03:54:28Z INFO  tango::discord] connected to discord RPC
[2022-11-04T03:54:29Z INFO  tango::patch] patch autoupdate completed

^ multiple Switch joycon addition in succession