rickomax / psxprev

PSXPREV - Playstation (PSX) Files Previewer/Extractor
BSD 2-Clause "Simplified" License
193 stars 10 forks source link

Linux support #36

Open konsumer opened 3 years ago

konsumer commented 3 years ago

I'd love to be able to use this on Linux.

It appears to run in mono:

Screenshot from 2021-06-21 16-17-41

But crashes if I press "Select Folder" or try to run it on a bin (from Crash Bandicoot bin/cue) file. Maybe I am running it wrong?

Linux: Pop!_OS 20.10 (similar to Ubuntu)
Mono JIT compiler version 6.8.0.105
konsumer commented 3 years ago

I converted the files like this:

bchunk -p Crash\ Bandicoot\ \(USA\).bin Crash\ Bandicoot\ \(USA\).cue crash

and ran the latest release on crash.iso with only "Scan for TMD" selected, and it seemed to get a little further, but then crashed with this error (a bunch of times):

at PSXPrev.Classes.Logger.WriteErrorLine (System.Object text) [0x00000] in <66677807bd8143cfa9d90c7e2558e2c0>:0 

I'm happy to do any troubleshooting that would help track down the issue. If I enable logging, it creates an empty log file.

konsumer commented 3 years ago

I got further!

The file from above command couldn;t be mounted, so I tried another way to convert the bin/cue to iso:

iat Crash\ Bandicoot\ \(USA\).bin crash.iso

The resulting iso was mountable. When I ran it, I still get a crash, but it outputted this, which seems slightly more helpful, but still empty log:

=================================================================
        Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
        Native stacktrace:
=================================================================
        0x560b367b2eb5 - mono : (null)
        0x560b367b3250 - mono : (null)
        0x560b36760129 - mono : (null)
        0x560b367ac9c1 - mono : (null)

=================================================================
        Telemetry Dumper:
=================================================================
Pkilling 0x7f9b62087640 from 0x7f9b58eef640
Pkilling 0x7f9b658fe740 from 0x7f9b58eef640
Pkilling 0x7f9b594fc640 from 0x7f9b58eef640
Entering thread summarizer pause from 0x7f9b58eef640
Finished thread summarizer pause from 0x7f9b58eef640.

Waiting for dumping threads to resume
Scanning for TIM at file S0000003.NSD;1
TIM - Reached file end: S0000003.NSD;1
Scanning for Croc at file S0000003.NSD;1
konsumer commented 3 years ago

I tried on command-line too, where psx/ is the mounted iso:

mono PSXPrev.exe ../Crash\ Bandicoot/Crash\ Bandicoot\ \(USA\)/psx/
Scan begin 06/21/2021 17:49:18
Scanning for TIM at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for Croc at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for BFF at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for PSX at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for TMD at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for VDF at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for AN at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for PMD at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for HMD at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
Scanning for TOD at file ../Crash Bandicoot/Crash Bandicoot (USA)/psx/scus_949.00
OpenTK.Graphics.GraphicsModeException: Invalid or unsupported GraphicsMode.
  at OpenTK.X11GLControl..ctor (OpenTK.Graphics.GraphicsMode mode, System.Windows.Forms.Control control) [0x0003d] in <8c45862163054cc5ad6708a9f8ab7330>:0 
  at OpenTK.GLControlFactory.CreateGLControl (OpenTK.Graphics.GraphicsMode mode, System.Windows.Forms.Control control) [0x00050] in <8c45862163054cc5ad6708a9f8ab7330>:0 
  at OpenTK.GLControl.OnHandleCreated (System.EventArgs e) [0x00046] in <8c45862163054cc5ad6708a9f8ab7330>:0 
  at System.Windows.Forms.Control.WmCreate (System.Windows.Forms.Message& m) [0x00000] in <a3daa9b84fd241a497578a25f68bc3c7>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x001d7] in <a3daa9b84fd241a497578a25f68bc3c7>:0 
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <a3daa9b84fd241a497578a25f68bc3c7>:0 
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message& m) [0x0003c] in <a3daa9b84fd241a497578a25f68bc3c7>:0 
  at System.Windows.Forms.UserControl.WndProc (System.Windows.Forms.Message& m) [0x00036] in <a3daa9b84fd241a497578a25f68bc3c7>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <a3daa9b84fd241a497578a25f68bc3c7>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x0000b] in <a3daa9b84fd241a497578a25f68bc3c7>:0 
  at System.Windows.Forms.NativeWindow.WndProc (System.IntPtr hWnd, System.Windows.Forms.Msg msg, System.IntPtr wParam, System.IntPtr lParam) [0x0008e] in <a3daa9b84fd241a497578a25f68bc3c7>:0 

=================================================================
        Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
        Native stacktrace:
=================================================================
        0x559af1c04eb5 - mono : (null)
        0x559af1c05250 - mono : (null)
        0x559af1bb2129 - mono : (null)
        0x559af1bfe9c1 - mono : (null)

=================================================================
        Telemetry Dumper:
=================================================================
Pkilling 0x7f8bef1f8640 from 0x7f8bf497b640
Pkilling 0x7f8c014a8740 from 0x7f8bf497b640
Pkilling 0x7f8bf4730640 from 0x7f8bf497b640
Pkilling 0x7f8bf432e640 from 0x7f8bf497b640
Pkilling 0x7f8bfdc87640 from 0x7f8bf497b640
Pkilling 0x7f8beffff640 from 0x7f8bf497b640
Pkilling 0x7f8befbfd640 from 0x7f8bf497b640
Pkilling 0x7f8bef7fb640 from 0x7f8bf497b640
Pkilling 0x7f8bef3f9640 from 0x7f8bf497b640
Pkilling 0x7f8bf452f640 from 0x7f8bf497b640
Pkilling 0x7f8befdfe640 from 0x7f8bf497b640
Pkilling 0x7f8bef9fc640 from 0x7f8bf497b640
Pkilling 0x7f8bef5fa640 from 0x7f8bf497b640
Entering thread summarizer pause from 0x7f8bf497b640
Finished thread summarizer pause from 0x7f8bf497b640.

Waiting for dumping threads to resume

=================================================================
        External Debugger Dump:
=================================================================
mono_gdb_render_native_backtraces not supported on this platform, unable to find gdb or lldb

=================================================================
        Basic Fault Address Reporting
=================================================================
instruction pointer is NULL, skip dumping
=================================================================
        Managed Stacktrace:
=================================================================

According to error, looks liek ti could be OpenTK.Graphics.GraphicsModeException: Invalid or unsupported GraphicsMode. but I'm really not sure.

konsumer commented 3 years ago

I also tried running via wine-mono, and got this error with same ISO:

See the end of this message for details on invoking \njust-in-time (JIT) debugging instead of this dialog box.\n\n************** Exception Text **************\nSystem.IndexOutOfRangeException: Index was outside the bounds of the array.
  at System.Windows.Forms.PropertyGrid.UpdateSelection () [0x00028] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.PropertyGrid.RefreshProperties (System.Boolean clearCached) [0x00075] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.PropertyGrid.Refresh (System.Boolean clearCached) [0x00045] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.PropertyGrid.OnViewSortButtonClick (System.Object sender, System.EventArgs e) [0x000dc] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.PropertyGrid.set_PropertySort (System.Windows.Forms.PropertySort value) [0x0006f] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.PropertyGrid.set_PropertySort(System.Windows.Forms.PropertySort)
  at PSXPrev.PreviewForm.InitializeComponent () [0x00538] in <66677807bd8143cfa9d90c7e2558e2c0>:0 
  at PSXPrev.PreviewForm..ctor (System.Action`1[T] refreshAction) [0x0005a] in <66677807bd8143cfa9d90c7e2558e2c0>:0 
  at (wrapper remoting-invoke-with-check) PSXPrev.PreviewForm..ctor(System.Action`1<PSXPrev.PreviewForm>)
  at PSXPrev.Program.DoScan (System.String path, System.String filter, System.Boolean checkTmd, System.Boolean checkVdf, System.Boolean checkTim, System.Boolean checkPmd, System.Boolean checkTod, System.Boolean checkHmd, System.Boolean log, System.Boolean noVerbose, System.Boolean debug, System.Boolean checkCroc, System.Boolean checkPsx, System.Boolean checkAn, System.Boolean ignoreTmdVersion, System.Boolean checkBff) [0x000f0] in <66677807bd8143cfa9d90c7e2558e2c0>:0 
  at PSXPrev.Forms.LauncherForm.ScanButton_Click (System.Object sender, System.EventArgs e) [0x000b0] in <66677807bd8143cfa9d90c7e2558e2c0>:0 
  at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x0001f] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00037] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x0009a] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.Control.WmMouseUp (System.Windows.Forms.Message& m, System.Windows.Forms.MouseButtons button, System.Int32 clicks) [0x001c3] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x005a0] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x0011f] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00056] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.OnMessage (System.Windows.Forms.Message& m) [0x00001] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x000b3] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 
  at System.Windows.Forms.NativeWindow.Callback (System.Windows.Forms.Message& m) [0x00025] in <02ed5f68085b4dd1ac63faf07ee12aa5>:0 

\n************** Loaded Assemblies **************\nmscorlib\n    Assembly Version: 4.0.0.0\n    Win32 Version: 4.6.57.0\n    CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/4.5/mscorlib.dll\n----------------------------------------\nPSXPrev\n    Assembly Version: 1.0.0.0\n    Win32 Version: 1.0.0.0\n    CodeBase: file:///Z:/home/konsumer/Downloads/PSXPrev.exe\n----------------------------------------\nSystem.Windows.Forms\n    Assembly Version: 4.0.0.0\n    Win32 Version: 4.6.57.0\n    CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll\n----------------------------------------\nSystem\n    Assembly Version: 4.0.0.0\n    Win32 Version: 4.6.57.0\n    CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll\n----------------------------------------\nSystem.Drawing\n    Assembly Version: 4.0.0.0\n    Win32 Version: 4.6.57.0\n    CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll\n----------------------------------------\nAccessibility\n    Assembly Version: 4.0.0.0\n    Win32 Version: \n    CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/Accessibility/4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll\n----------------------------------------\nI18N\n    Assembly Version: 4.0.0.0\n    Win32 Version: 4.0.0.0\n    CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/I18N/4.0.0.0__0738eb9f132ed756/I18N.dll\n----------------------------------------\nI18N.West\n    Assembly Version: 4.0.0.0\n    Win32 Version: 4.0.0.0\n    CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/I18N.West/4.0.0.0__0738eb9f132ed756/I18N.West.dll\n----------------------------------------\nSystem.Configuration\n    Assembly Version: 4.0.0.0\n    Win32 Version: 4.6.57.0\n    CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll\n----------------------------------------\nOpenTK.GLControl\n    Assembly Version: 1.1.0.0\n    Win32 Version: 1.1.2349.61993\n    CodeBase: file:///Z:/home/konsumer/Downloads/OpenTK.GLControl.dll\n----------------------------------------\nOpenTK\n    Assembly Version: 2.0.0.0\n    Win32 Version: 2.0.0\n    CodeBase: file:///Z:/home/konsumer/Downloads/OpenTK.dll\n----------------------------------------\n\n************** JIT Debugging **************\n
rickomax commented 2 years ago

I'm sorry. There is a long time I don't work on this project. I will investigate how I could make it work on Linux.

konsumer commented 2 years ago

No prob, totally understand being busy. I can reboot and run it in windows, too.

oxr463 commented 2 years ago

Did you try running in Wine?

trigger-segfault commented 10 months ago

The WriteErrorLine crash specifically was solved by PR #51. It's still likely there are other hiccups with running on Linux, but that crash in particular is no longer one of them.