Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX Crash on certain games #6

Closed
zach-morris opened this issue Sep 7, 2018 · 3 comments
Closed

OSX Crash on certain games #6

zach-morris opened this issue Sep 7, 2018 · 3 comments

Comments

@zach-morris
Copy link

Issue:
Launching certain games crashes Kodi. Example: Pitfall works just fine, Dig Dug will crash Kodi

Version tested:

07:55:54.946 T:140735204044800  NOTICE: -----------------------------------------------------------------------
07:55:54.946 T:140735204044800  NOTICE: Starting Kodi (18.0-BETA2 Git:20180906-59cae3bb29). Platform: OS X x86 64-bit
07:55:54.946 T:140735204044800  NOTICE: Using Debug Kodi x64 build
07:55:54.946 T:140735204044800  NOTICE: Kodi compiled Sep  6 2018 by Clang 9.0.0 (clang-900.0.37) for OS X x86 64-bit version 10.9.0 (1090)
07:55:54.947 T:140735204044800  NOTICE: Running on Apple Inc. MacBookPro12,1 with OS X 10.11.6, kernel: Darwin x86 64-bit version 15.6.0
07:55:54.947 T:140735204044800  NOTICE: FFmpeg version/source: 4.0.2-Kodi
07:55:54.947 T:140735204044800  NOTICE: Host CPU: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz, 4 cores available

To Recreate:
Play Dig Dug from IAGL best of Atari list

Log:

07:57:26.046 T:140735204044800   DEBUG: AddOnLog: Atari - 2600 (Stella): ------------------------------------------------------------
07:57:26.046 T:140735204044800   DEBUG: AddOnLog: Atari - 2600 (Stella): Setting libretro pixel format "XRGB8888"
07:57:26.063 T:140735204044800    INFO: GAME: ---------------------------------------
07:57:26.063 T:140735204044800    INFO: GAME: Game loop:      true
07:57:26.064 T:140735204044800    INFO: GAME: FPS:            59.919998
07:57:26.064 T:140735204044800    INFO: GAME: Sample Rate:    31400.000000
07:57:26.064 T:140735204044800    INFO: GAME: Region:         NTSC
07:57:26.064 T:140735204044800    INFO: GAME: Savestate size: 512
07:57:26.064 T:140735204044800    INFO: GAME: ---------------------------------------
07:57:26.064 T:140735204044800   DEBUG: AddOnLog: Atari - 2600 (Stella): Setting port "1" (libretro port 0) to controller "game.controller.atari.2600" (libretro device ID 257)
07:57:26.064 T:140735204044800   DEBUG: PERIPHERALS: Event lock handle registered
07:57:26.064 T:140735204044800   DEBUG: PERIPHERALS: Event lock handle released
07:57:26.065 T:140735204044800   DEBUG: AddOnLog: Atari - 2600 (Stella): Setting port "2" (libretro port 1) to controller "game.controller.atari.2600" (libretro device ID 257)
07:57:26.065 T:140735204044800   DEBUG: PERIPHERALS: Event lock handle registered
07:57:26.065 T:140735204044800   DEBUG: PERIPHERALS: Event lock handle released
07:57:26.065 T:140735204044800   DEBUG: GAME: No in-game saves (save ram) to load
07:57:26.066 T:140735204044800   DEBUG: GAME: No in-game saves (rtc) to load
07:57:26.066 T:140735204044800   DEBUG: RetroPlayer[PLAYER]: Using game client game.libretro.stella
07:57:26.066 T:140735204044800   DEBUG: Loading savestate from /Users/xxx/Library/Application Support/Kodi/userdata/addon_data/plugin.program.iagl/temp_iagl/digdug.sav
07:57:26.066 T:140735204044800   ERROR: Failed to open savestate file /Users/xxx/Library/Application Support/Kodi/userdata/addon_data/plugin.program.iagl/temp_iagl/digdug.sav
07:57:26.067 T:140735204044800   DEBUG: RetroPlayer[SAVE]: Loading savestate
07:57:26.067 T:140735204044800   DEBUG: Loading savestate from /Users/xxx/Library/Application Support/Kodi/userdata/addon_data/plugin.program.iagl/temp_iagl/digdug.sav
07:57:26.067 T:140735204044800   ERROR: Failed to open savestate file /Users/xxx/Library/Application Support/Kodi/userdata/addon_data/plugin.program.iagl/temp_iagl/digdug.sav
07:57:26.067 T:140735204044800   ERROR: RetroPlayer[SAVE]: Failed to load savestate
07:57:26.067 T:140735204044800   DEBUG: PERIPHERALS: Event poll handle activated
07:57:26.067 T:123145302839296   DEBUG: Thread GameLoop start, auto delete: false
07:57:26.067 T:140735204044800   DEBUG: RetroPlayer[PLAYER]: Closing OSD via speed change (1.000000)
07:57:26.067 T:140735204044800   DEBUG: ------ Window Deinit () ------
07:57:26.068 T:140735204044800   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
07:57:26.068 T:140735204044800   DEBUG: ------ Window Deinit (/Users/xxx/Library/Application Support/Kodi/addons/plugin.program.iagl/resources/skins/Default/1080i/script-IAGL-infodialog.xml) ------
07:57:26.068 T:140735204044800   DEBUG: OnPlayBackStarted: CApplication::OnPlayBackStarted
07:57:26.068 T:140735204044800   DEBUG: OnAVStarted: CApplication::OnAVStarted
07:57:26.068 T:140735204044800   DEBUG: RetroPlayer[SAVE]: Initializing autosave
07:57:26.068 T:123145307209728   DEBUG: CAnnouncementManager - Announcement: OnAVStart from xbmc
07:57:26.069 T:123145302839296   DEBUG: RetroPlayer[VIDEO]: Initializing video
07:57:26.069 T:123145303453696   DEBUG: Thread CRetroPlayerAutoSave start, auto delete: false
07:57:26.069 T:123145307209728   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnAVStart
07:57:26.069 T:123145302839296   DEBUG: RetroPlayer[RENDER]: Initializing render manager
07:57:26.069 T:123145303453696   DEBUG: RetroPlayer[SAVE]: Autosave thread started
07:57:26.069 T:123145302839296   DEBUG: RetroPlayer[VIDEO]: Creating video stream - format 0RGB32, nominal 320x210, max 320x256
07:57:26.069 T:123145302839296    INFO: RetroPlayer[RENDER]: Configuring format 0RGB32, nominal 320x210, max 320x256
07:57:26.070 T:123145302839296   DEBUG: RetroPlayer[AUDIO]: Initializing audio
07:57:26.070 T:123145302839296    INFO: RetroPlayer[AUDIO]: Creating audio stream, format = AE_FMT_S16NE, sample rate = 31400, channels = 2
07:57:26.073 T:140735204044800   DEBUG: ------ Window Init () ------
07:57:26.073 T:140735204044800   DEBUG: Alloc resources: 0.00ms  (0.00 ms skin load)
07:57:26.074 T:140735204044800    INFO: RetroPlayer[RENDER]: Renderer configured on first frame
07:57:26.079 T:140735204044800   DEBUG: CPlayerGUIInfo::InitCurrentItem(/Users/xxx/Library/Application Support/Kodi/userdata/addon_data/plugin.program.iagl/temp_iagl/digdug.bin)
07:57:26.080 T:140735204044800   DEBUG: CGamesGUIInfo::InitCurrentItem(/Users/xxx/Library/Application Support/Kodi/userdata/addon_data/plugin.program.iagl/temp_iagl/digdug.bin)
07:57:26.080 T:123145307209728   DEBUG: CAnnouncementManager - Announcement: OnChanged from xbmc
07:57:26.080 T:123145307209728   DEBUG: GOT ANNOUNCEMENT, type: 1024, from xbmc, message OnChanged
07:57:26.080 T:123145307209728   DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc
07:57:26.080 T:123145307209728   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPlay
07:57:26.092 T:123145308282880    INFO: CActiveAESink::OpenSink - initialize sink
07:57:26.166 T:123145319628800   DEBUG: Skin Helper Widgets --> Kodi_Monitor: sender xbmc - method: Player.OnAVStart  - data: {"item":{"type":"unknown"},"player":{"playerid":-1,"speed":1}}
07:57:26.170 T:123145318555648   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: Player.OnAVStart  - data: {"item":{"type":"unknown"},"player":{"playerid":-1,"speed":1}}
07:57:26.171 T:123145318555648   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: Info.OnChanged  - data: null
07:57:26.171 T:123145318555648   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: Player.OnPlay  - data: {"item":{"type":"unknown"},"player":{"playerid":-1,"speed":1}}
07:57:26.172 T:123145319628800   DEBUG: Skin Helper Widgets --> Kodi_Monitor: sender xbmc - method: Info.OnChanged  - data: null
07:57:26.173 T:123145319628800   DEBUG: Skin Helper Widgets --> Kodi_Monitor: sender xbmc - method: Player.OnPlay  - data: {"item":{"type":"unknown"},"player":{"playerid":-1,"speed":1}}
07:57:26.181 T:140735204044800   DEBUG: ------ Window Init (DialogBusy.xml) ------
07:57:26.181 T:140735204044800   DEBUG: Window DialogBusy.xml was already loaded
07:57:26.181 T:140735204044800   DEBUG: Alloc resources: 0.04ms
07:57:26.183 T:140735204044800   DEBUG: Activating window ID: 12906
07:57:26.183 T:140735204044800   DEBUG: ------ Window Deinit (MyVideoNav.xml) ------
07:57:26.183 T:140735204044800   DEBUG: FreeVisualisation() done
07:57:26.184 T:140735204044800   DEBUG: ------ Window Init (VideoFullScreen.xml) ------
07:57:26.184 T:140735204044800    INFO: Loading skin file: VideoFullScreen.xml, load type: KEEP_IN_MEMORY
07:57:26.186 T:140735204044800   DEBUG: Skin file /Applications/Kodi_Retroplayer.app/Contents/Resources/Kodi/addons/skin.estuary/xml/VideoFullScreen.xml loaded in 1.51ms
07:57:26.186 T:140735204044800   DEBUG: Alloc resources: 1.71ms  (1.71 ms skin load)
07:57:26.186 T:140735204044800   DEBUG: Inhibiting OS screen saver
07:57:26.192 T:140735204044800   ERROR: RetroPlayer[RENDER]: Creating renderer for OpenGL
07:57:26.193 T:140735204044800   DEBUG: RetroPlayer[RENDER]: Configuring buffer pool
07:57:26.197 T:140735204044800   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
07:57:26.240 T:123145308282880   DEBUG: CCoreAudioStream::Close: Restoring original physical format for stream 0x0033. ([lpcm] Mixable Interleaved 2 Channel 32-bit Floating Point LE (44100Hz))
07:57:26.281 T:123145311043584   DEBUG: CCurlFile::GetMimeType - https://i.imgur.com/VSwqEcv.jpg -> image/jpeg
07:57:26.282 T:123145311043584   DEBUG: CurlFile::Open(0x7fc0235f9440) https://i.imgur.com/VSwqEcv.jpg
07:57:26.288 T:123145302839296   DEBUG: RetroPlayer[RENDER]: Creating render buffer of size 160x210 for buffer pool
07:57:26.395 T:123145311043584   DEBUG: Caching image 'https://i.imgur.com/VSwqEcv.jpg' to 'f/f5bedf1a.jpg':
07:57:26.396 T:123145311043584   DEBUG: ffmpeg[700000854000]: [swscaler] Warning: data is not aligned! This can lead to a speed loss
@garbear
Copy link
Member

garbear commented Sep 7, 2018

I can't reproduce. But you stumbled on a general issue:

DEBUG: ffmpeg[700000854000]: [swscaler] Warning: data is not aligned! This can lead to a speed loss

We should definitely allocate aligned video memory for performance reasons. I'll pursue this, and in the meantime try a bunch of atari games to see if I can repro.

I also hit an unrelated bug on game close:

2018-09-07 16:08:43.217316-0700 kodi.bin[93823:45548386] Debug Print: AddOnLog: Joystick Support: Loaded device "Wireless 360 Controller" with 58 controller profiles and 534 total features
kodi.bin(93823,0x108edb3c0) malloc: *** error for object 0x124c1b498: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
(lldb) 

Reminder for future me to look into this.

@garbear
Copy link
Member

garbear commented Sep 8, 2018

OK, found the issue: xbmc/xbmc#14404

@zach-morris
Copy link
Author

I can no longer reproduce this with the latest version:

-----------------------------------------------------------------------
09:00:11.223 T:140735098916864  NOTICE: Starting Kodi (18.0-BETA2 Git:20180911-84925cfc94). Platform: OS X x86 64-bit
09:00:11.223 T:140735098916864  NOTICE: Using Debug Kodi x64 build
09:00:11.223 T:140735098916864  NOTICE: Kodi compiled Sep 11 2018 by Clang 9.0.0 (clang-900.0.37) for OS X x86 64-bit version 10.9.0 (1090)
09:00:11.223 T:140735098916864  NOTICE: Running on Apple Inc. MacBookPro12,1 with OS X 10.11.6, kernel: Darwin x86 64-bit version 15.6.0
09:00:11.223 T:140735098916864  NOTICE: FFmpeg version/source: 4.0.2-Kodi
09:00:11.223 T:140735098916864  NOTICE: Host CPU: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz, 4 cores available

Just a note that this general error is still present in the logs that you noted:

DEBUG: ffmpeg[7000002A0000]: [swscaler] Warning: data is not aligned! This can lead to a speed loss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants