TASEmulators/BizHawk

[🐧] GNU+Linux compatibility progress

YoshiRulz opened this issue · 253 comments

jump to known bugs

Overview:

  • Nothing on this page applies to the (discontinued) macOS port.
    • Also, EmuHawk is only for x86-64 machines for the time being. If you have an x86 or AArch64 machine, you should have no trouble installing the rundeps, but EmuHawk will crash on start; see #3687. Contributions welcome.
  • Build instructions are in the readme. tl;dr: run Dist/BuildRelease.sh.
  • "Installation" instructions are also in the readme. tl;dr: run output/EmuHawkMono.sh.
    • No WINE required! If you get it working in WINE, good for you, but I'm going to ignore you and hide any counter-productive comments.
  • 35-ish of 40-ish systems can be emulated, with the notable exception of N64 (Mupen64Plus isn't available, and the experimental Ares64 core is too slow).
  • For casual players, most things work as they would on Windows.
  • For TASers, most things work as they would on Windows.
  • For glitch hunters and romhackers, everything sucks and I'm sorry. But if a core is available on Linux, and the core implements the necessary services for a tool, then it should be at least functional.
  • Before 2.9.2:
    • Command-line flags to EmuHawkMono.sh are passed through as expected. The single exception is if you pass --mono-no-redirect as the first flag, which disables redirecting stdout/stderr to EmuHawkMono_last*.txt (the default behaviour is to write to disk instead of the terminal).
    • When it inevitably crashes, some errors go to the terminal/EmuHawkMono_last*.txt, some appear in dialog boxes, some both. Most of these error dialogs will either have a "Copy" button, or will allow Ctrl+C.

As of 2.9.1, the following systems can be emulated:

  • Apple II with Virtu
  • Arcades with MAME
  • Atari 2600 with Atari2600Hawk
  • Atari 7800 with A7800Hawk
  • Atari Jaguar with VirtualJaguar
  • Atari Lynx with Handy
  • ColecoVision with ColecoHawk
  • Commodore 64 with C64Hawk (loads to BASIC prompt, at least --yoshi)
  • Game Boy and GBC with Gambatte, GBHawk, or SameBoy
  • GBA with mGBA
  • Intellivision with IntelliHawk
  • Magnavox Odyssey² with O2Hawk
  • MSX with MSXHawk
  • N64 with Ares64
  • Neo Geo Pocket / Color with NeoPop
  • NES/Famicom plus FDS with NesHawk or QuickNes
  • Nintendo DS with melonDS
  • Nintendo Virtual Boy with Virtual Boyee
  • PC Engine / TG-16 and SuperGrafx plus CD with HyperNyma, PCEHawk, or TurboNyma
  • PC-FX with T.S.T.
  • PSX with Nymashock
  • Sega 32X with PicoDrive
  • Sega CD with Genplus-gx
  • Sega Game Gear with SMSHawk
  • Sega Genesis / Mega Drive with Genplus-gx
  • Sega Master System with SMSHawk
  • Sega Saturn with Saturnus (see "Issues with Saturnus" below)
  • Sega SG-1000 SMSHawk
  • SNES/SFC with BSNES, Faust, or Snes9x
  • Super Game Boy with Gambatte or BSNES
  • TI-83 with Emu83 or TI83Hawk
  • TIC-80 fantasy console with TIC-80 reference implementation
  • Uzebox fantasy console with Uzem
  • Vectrex with VectrexHawk
  • WonderSwan / Color with Cygne
  • ZX Spectrum with ZXHawk
  • Anything else via Libretro cores (provided they don't crash)

These systems haven't been tested or aren't finished:

  • 3DS with Encore (I don't have roms --yoshi)
  • Amiga with PUAE (unreleased core)
  • Amstrad CPC with CPCHawk (unreleased core)
  • Channel F with ChannelFHawk (unreleased core)
  • N64DD with Ares64 (I don't have roms --yoshi)
  • Sega Pico with Genplus-gx (I don't have roms --yoshi)

These features/subsystems work:

  • The core lifecycle i.e. loading roms (for the systems noted above)
  • Savestates
  • Virtual Pad
  • Tool Box
  • Lua Console (scripts can load, YMMV)
  • Config > Controllers... and Config > Hotkeys...
    • Keyboard, mouse, and gamepad inputs, and from 2.9.2, haptic feedback
  • Config > Display...
  • Config > Sound...
  • Config > Paths...
  • Config > Firmwares...
  • Config > Autofire...
  • Config > Customize...
  • Config > Profiles...
  • Core selector (Config > Cores)
  • View > Window Size
  • Misc. OSD layers under View
  • Lua (from 2.9, same as Windows, before 2.9 see #2951)
  • External tools (ApiHawk)
  • Movie playback, "traditional" movie recording
  • TAStudio (basic functionality is good)
  • Tools > RAM Watch
  • Hex Editor (works as of 625c657)
  • RAM Search
  • Tools > Cheats (does not crash)
  • Basic Bot (opens as of 1dbcdcd)
  • RetroAchievements

Issues with EmuHawk

Startup issues:

  • An InvalidOperationException with "Error compiling shader", "syntax error, unexpected KW_SAMPLER_STATE" (stacktrace will include the IGL_SlimDX9.CreateVertexShader method, which has since been removed): Seems to be a bug in WINE's GPU drivers. WINE is not supported, so just stop using it and you won't hit this.

Misc. issues:

  • Mono seemingly ignores the GTK theme... on my machine >:( Meaning everything is ugly and there's nothing we can do about it. TBH it's kinda ugly on Win10 too. band-aid applied 62f90f1
    • ...though with Nix you can see Gtk not found (missing LD_LIBRARY_PATH to libgtk-x11-2.0.so.0?), using built-in colorscheme in stderr which implies it's looking for a GTK theme??? And several users have complained about their system-wide dark theme being partially applied, to bad results, so it's at least sometimes finding one. (Bad results because my band-aid fix is light theme. Without that, EmuHawk would be mostly dark theme, but still ugly, and it may have a lot of unreadable text.)
    • with b967e60, either all or none of the menubar colours come from the GTK theme, so if you're lucky enough to have your dark theme detected, it doesn't have ugly gradients! Some of our icons have white crusts on them, but oh well. Eventually, they'll all be replaced. If you're lucky enough to have your dark theme applied, and you notice one of the menubars or one specific UI element is light theme, please report it as I'm now classing that as a bug. --yoshi
      • In the Lua Console, the background is beige making the GroupBox' white label illegible. The ListView's header text is unreadable.
      • RAM Search and RAM Watch are likely the same, sans the ListView problem since they use InputRoll.
    • As a result, some icons in e.g. open file dialogs are missing. Hope you remember which is the parent directory button!
    • NEW LIGHT/DARK THEME WORKAROUND 2024-09: I'm told GTK_DATA_PREFIX='' ./EmuHawkMono.sh prevents GTK+ from loading your theme, meaning it will be fully light-theme as intended.
  • I think file extensions are case-sensitive on Mono. The rom loader dialog doesn't recognise my .32X file as a rom. fixed in f8a688d
  • (unthrottled) FPS triples when window unfocused. Is input slowing it down? who knows --yoshi
    • actually I can't repro this --yoshi at 25a5449
    • dwango repro'd this on stream. still no idea why it happens. --yoshi
    • Still can't repro, no change when swapping out OpenTKInputAdapter for a DummyInputAdapter --yoshi at 24f69eb
    • Repro'd on NixOS, both on 2.9.1 and at ebe3cad, though it's a very small difference in Release config. --yoshi
  • Keyboard shortcuts in RAM Watch don't work. ToolStripMenuItem.ShortcutKeys isn't working at all.
    • Just looked into this again with TAStudo and ProcessCmdKey isn't even being called. --yoshi at 681ef72
  • Menubar mnemonics are disabled. Past me did it to prevent a crash, needs retesting. --yoshi at 03d10ce
    • enabled on MainForm as of 28d62e6
    • not working on other Forms --yoshi at 28d62e6
    • probably same cause as ShortcutKeys --yoshi at 681ef72
  • Some file open dialogs cause a ArgumentOutOfRangeException in System.DateTimeOffset.FromUnixTimeSeconds(long). --yoshi at 03d10ce
    • tracked as mono/mono#21213
    • note Paths config uses FolderBrowserDialog which seems to crash regardless of the timestamps' validity
  • In IToolFormAutoConfigs, Settings > Stay on Top correctly writes Window.KeepAbove = !item.Checked, but does not read the actual value i.e. toggling keep-above via the WM does not change the checkbox's state. I suggest this menu item be disabled on Linux (and macOS?). --yoshi at 03d10ce
    • Fixed in 329a7de (by hiding the menu item).
  • Defaults for Config > Paths... could be changed to standards like $XDG_CONFIG_HOME. Making this change to system-global dirs would break from the "portable app" precedent. --yoshi
    • Sorta done in NixHawk
  • Users with only an Intel iGPU (i.e. no discrete GPU) may get i965: Failed to submit batchbuffer: Invalid argument. Try LIBGL_ALWAYS_SOFTWARE=1 ./EmuHawkMono.sh or otherwise setting that environment variable. (workaround found by @InfamousKnight)
  • Dialogs which pause emulation should cause the current frame to be redrawn to MainForm, but instead drawing stops and you get the solitaire effect. --yoshi at 268ab96
  • Possibly related, under Plasma Wayland on NixOS: "open file" dialogs sometimes result in empty black windows, which then become "infectious" and result in even the main window only showing black, which persists until user logout / compositor shutdown. --bugQ
  • Dropdowns not closing: mono/mono#12644 --yoshi at 42fc895
    • workaround added in 653844e (sorry I didn't do that sooner --yoshi)
  • Controls in RecordMovie (dialog asking for filename and author for new movie) are misplaced, making keyboard navigation a requirement for recording movies (without TAStudio) --yoshi at 9e60927
  • If you get an error like "GDI+ status: InvalidParameter" at System.Drawing.Image.get_FrameDimensionsList, try updating libgdiplus.
  • Hard crash when clicking+dragging scrollbar in OpenFileDialog. Nothing in stdout or stderr. ¯\_(ツ)_/¯
    • Similarly, random hard crashes when clicking+dragging scrollbar in core settings dialogs, then moving cursor over the button of a dropdown menu without releasing the mouse button.
  • In Hex Editor, opening context menu causes scroll wheel and arrow keys to have no effect until the window is unfocused and refocused.
  • Log Window threading is fragile, see #2741.
  • Starting Mono while the solution is being rebuild will, rather than hitting the version check in EmuHawk.Program, cause Mono to segfault. (Not before init'ing GTK, though. I swear it's taunting me.)
  • May be NixOS-specific, but it seems idling with Lua scripts running+drawing but emulation paused causes the Lua Console (possible all WinForms UI?) to freeze, and unpausing emulation fixes it immediately...
    • It also seems to unpause for no reason? Does it think I closed a menu and it was only temp. paused?
  • RetroAchievements dialogs aren't great, but they are technically usable
  • From 2.9.2, SDL2 handles sleep prevention, but while it's implemented for Linux (X11), it's not working in practice. See #3644 (comment).
  • PictureBox applies anti-aliasing/interpolation to pixel graphics: #3764
  • Buttons in some windows and dialogs are missing their labels. Possibly related to Japanese locale. Initially reported by @miyakut on Discord, running Mint. 404f28f didn't work and was reverted.

Cores

Issues with Mupen

System.InvalidOperationException: got null pointer from dlopen, error: libmupen64plus.so.2: cannot open shared object file: No such file or directory (or, if standalone Mupen64Plus is installed, System.InvalidOperationException: got null pointer from dlopen, error: /usr/lib/mupen64plus: cannot read file data: Is a directory) from mupen64plusApi ctor --yoshi at 25a5449
fixed in 6e46cb5

Issues with TI83Hawk

  • IndexOutOfRangeException at BizHawk.Emulation.Cores.Calculators.TI83.ReadMemory(ushort) --yoshi at 25a5449

Building and packaging

Dependencies are being recorded (so build scripts can be made) in the GitLab mirror's snippets. On multi-arch distros, target x86_64/amd64.

For the record I've mostly focused on Manjaro (which I use), Nix/NixOS, Linux Mint, and Ubuntu. --yoshi

Bus error (core dumped) when building may be because you're out of disk space.

libblip_buf works as intended on both OSes, but the Makefile for Linux builds was hacked together (see libblip_buf issue tracker) and using the library in BizHawk was intended to be a temporary hack. The library has been rewritten as noted in #1312. Sappharad has previously attempted moving it to managed C#. It may be possible to use libspeex instead. they serve different purposes according to #3207 (comment) --yoshi

Don't know where else to leave these:

  • Debug P/Invokes (.dll/.so loading) with MONO_LOG_LEVEL=debug MONO_LOG_MASK=dll ./EmuHawkMono.sh --mono-no-redirect.
  • It seems libgdiplus.so doesn't support whatever the "PNG 256x256" mode of .icos is.

For Gambatte et al, I do not think it will be that difficult to compile these cores for Bizhawk. The source code for the version that is used in Bizhawk is in the Bizhawk repo, and most/all of them are compiled with mingw right now, so don't have too many MSVCisms in them. You should give one a try.

For the waterbox cores, I think it shouldn't be too hard to write a version of MemoryBlock that works with linux APIs. I'm willing to give it a try if no one else is.

@Sappharad Could you please verify that A7800Hawk, C64Hawk, ColecoHawk, GBHawk, IntelliHawk, NesHawk, PCEHawk, SMSHawk, and ZXHawk work on macOS?

As of the last time I pulled changes from master, (January 1st) A7800, ColecoHawk, GBHawk, Gambatte, NESHawk, QuickNES, PCEHawk & SMS Hawk are currently working on macOS. I have not tested any other cores at this time, some will require preparations for me to use them as I have never used them. If you're asking about the latest code, I'll have to rebase tomorrow. Note that I also have a bunch of changes that differ from yours, but nothing on in the backend should be different so I'm not worried about C# cores not working.

Honestly, I can probably just remove the BG color setting from Atari2600. That BG color is outside of the frame, if anything it should be a global setting. Most other cores just set it to black with no option to change it.

@Sappharad So you had no issues building libblip_buf? And how did you get Gambatte and QuickNES working? Re: ZX Spectrum Asnivor told me how to use it

@alyosha-tas Changing background colour to a global setting may be problematic for the cores that do enable the user to set the colour. For example, ZXHawk has the ability to set this colour through it's options (as this was a feature request by someone in the past). However, the reflection related problems are not present as the choice of colours is limited to only the ones that the emulated machine can display (and it makes its journey through Settings as a simple integer lookup into the core's palette array)

image

Obviously cores that specifically manage this setting will automatically (and invisibly) override any new global background colour implementation. As long everyone is happy with this (somewhat counter-intuitive from a user-perspective) behavior, global should work.

@Asnivor to add to that, I suggested in #1380 to use an integer everywhere except actually drawing the background (which ZXHawk already does?), using Color.FromArgb(int) (MSDN).

@YoshiRulz yup, that will solve the issues. Unfortunately a lot of the cores use the auto-generated settings menus, so passing a Color reference gives you an easy color picker
image

I guess the auto generated settings dialog can be modified to accept int values and then use Color.FromArgb. Thats probably the easiest solution (after removing the setting from problem cores entirely). ZXHawk is slightly different in that the integer it passes is never more than 15 (as this is the max number of colours that computer had and this is used to lookup a colour palette array in-core). But integer representations argb should work if someone wants to make that change.

Has anyone looked into the DefaultValue Color crash in detail? It doesn't seem like something that should be broken, and I've confirmed that [DefaultValue(typeof(Color), "Black")] does work in a basic mono repro.

@Sappharad So you had no issues building libblip_buf? And how did you get Gambatte and QuickNES working? Re: ZX Spectrum Asnivor told me how to use it

I had already ported them a couple years ago in the mono-portable branch. It was just a matter of copying the old Xcode projects from the mono-portable branch and switching them to x64. Anything I've done before I've been slowly grabbing pieces from the branch and re-implementing in my fork. In some cases it differs from your approach and I've just been keeping mine. Keyboard for example, you built a massive mapping between SlimDX and OpenTK, but I don't even reference SlimDX in mine because that reference is conditional to Windows so the mono build acts like it's not even there. Then I just use the OpenTK Keyboard enum directly. (And there's a separate default mappings file for OpenTK where I just did a find/replace on the key names that differ like Keys.Return becomes Keys.Enter instead)

I'll try to rebase later today and test again, but I'd say don't worry about it too much because if it works for you I'm not worried about it working for me.

Oh, actually, there's one thing you need to change once you have a QuickNES build for Linux if you want it to work. You need to conditionally take out the calls for the Windows floating point mode hack. I tested it several years ago, natt or someone explained what bug that was there to fix and I found the bug didn't occur at all macOS. So there wasn't a need to replicate whatever that does. Example is here:
Sappharad@2bcc546#diff-a9975d57b1522ccb872d9e6dc6f1f171
Note that this won't work for you as-is, because you've been using runtime checks everywhere for platform while I do it as preprocessor directives, but you can do something similar your way. Note that if you'd rather use the preprocessor directives for this case that some of the projects like BizHawk.Client.Common have a WINDOWS define hard-coded in the project settings instead of being conditionally defined for Windows only. Those are also fixed on my end and I can probably do a diff and tell you which ones are broken.

@nattthebear

Has anyone looked into the DefaultValue Color crash in detail? It doesn't seem like something that should be broken, and I've confirmed that [DefaultValue(typeof(Color), "Black")] does work in a basic mono repro.

So i've had a rum ol' time time of spinning up a linux vm, installing mono, building bizhawk and attempting to debug in the buggy shitshow that IS MonoDevelop.

The line where it all goes wrong is here: https://github.com/TASVideos/BizHawk/blob/7ff08fb63e4f96cb55ba4c481d59c2dc0a6fbde9/BizHawk.Common/SettingsUtil.cs#L65

In Windows, PropertyInfo.GetCustomAttributes(true) successfully returns the System.Drawing.Color value:

image

In Mono however, the same PropertyInfo method fails to return the System.Drawing.Color value:

image

To my untrained eye, both PropertyInfo objects appears to have much of the correct info:

image

image

However the locals window in monodevelop doesn't provide a lookup into the CustomAttributes IEnumerable (for whatever IDE-centric reason).

I suspect this is all some issue/edge case with the way Mono handles reflection, but I really don't know enough to go much deeper. .GetCustomAttributes() is working fine in Mono for attribute values that do not involve the possible 'double reflection' that this BackgroundColor property does.

So yeah, not sure what else I can try...

I tried the following small example against mono and .net and it worked against both of them. I wonder what's different in the full case? Not sure what you mean about "double reflection".

class Foo
{
    [System.ComponentModel.DefaultValue(typeof(System.Drawing.Color), "Black")]
    public System.Drawing.Color Bar { get; set; }
    static void Main()
    {
        var prop = typeof(Foo).GetProperty("Bar");
        var attr = (System.ComponentModel.DefaultValueAttribute)prop.GetCustomAttributes(true)[0];
        var value = attr.Value;
        if (value == null)
        {
            System.Console.WriteLine("value is null");
        }
        else if (value.GetType() != typeof(System.Drawing.Color))
        {
            System.Console.WriteLine("type is " + value.GetType());    
        }
        else
        {
            System.Console.WriteLine("color is `" + value + "`");
        }
    }
}

Hmmm.

image

Issue is there for me with your code. Are you running Mono on windows or linux?

If it matters, I am running:

  • Debian Stretch
  • latest stable mono-devel & mono-dbg
  • latest stable monodevelop

IIRC, @YoshiRulz was seeing the same issue on Arch linux

@nattthebear I'm also getting "value is null" on Manjaro w/ Mono, Mono VB.NET:
o noes

~$> mono --version
Mono JIT compiler version 5.16.0 (makepkg/bb3ae37d71a Sat Dec  8 13:21:35 CET 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        Interpreter:   yes
        LLVM:          supported, not enabled.
        GC:            sgen (concurrent by default)
~$> yay -Qi mono-basic | head -n2
Name            : mono-basic
Version         : 4.7-1
~$> lsb_release -a
LSB Version:    n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:        18.0.2
Codename:       Illyria

Right @nattthebear is going to check his end again today, but if there is a discrepancy lets maybe lets get some version details in here just in case this is something we think about raising with Mono.

For me:

~$ mono --version
Mono JIT compiler version 5.18.0.255 (tarball Wed Jan  2 21:21:16 UTC 2019)
	TLS:		__thread
	SIGSEGV:	altstack
	Notifications:	epoll
	Architecture:	amd64
	Disabled:	none
	Misc:		softdebug
	Interpreter:	yes
	LLVM:		yes(600)
	Suspend:	preemptive
	GC:		sgen (concurrent by default)
~$ lsb_release -a
No LSB modules are available
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.6 (stretch)
Release:	9.6
Codename:	stretch

Ok. So i guess LVVM could be the difference here. Or the older version of mono. Or both. I'll see whether i can disable lvvm tomorrow and test again.

@YoshiRulz had LLVM supported but not enabled and got the same issue; so I'm betting on a classlib regression in the later mono.

@YoshiRulz Hi All. I figure that I owe some form of explanation for the work that I completed about a year ago. My motivation for porting the lua interface to Mono compatible systems was to replicate the MarI/O experiment on my MacBook. The main compatibility issue arose from the use of a Managed C++ (a now-deprecated Embrace Extend Extinguish ploy from Microsoft to provide C# interoperability) DLL that contained the Lua engine.

My solution was to keep the C based lua implementation but switch the Managed C++ interface to the platform agnostic P/INVOKE interface. I automated this process by using SWIG to generate the interface, and modified other portions within bizhawk itself.

As a matter of practice, I don't like to release software without having it adequately tested. All of my manual testing cases succeeded, but I could not find a way to automate the testing in a way that worked with the core software. (Further, I could not resist the scope creep of trying to find a line coverage mechanism, but Microsoft has recently added that capability to DotNet Core).

Ultimately, I found that there were no performant GBA cores available for MacOs at the time. Further I had to abandon the project in lieu of degree/job/etc.

As of now, I cannot reasonably commit to a timeline, but if somebody does have time sensitive needs, I would be willing to sync up with them on how to go forward.

Virtu may or may not work in branch unix_morecompat_temp (= MoreUnixMonoCompatWork) if you know how to use an Apple II (because we don't).

edit: changed branch name

Edit: had kill $(ps ...) one-liner here, no longer necessary

I worked out how to kill EmuHawk (and mono) dead from within BizHawk the other day, but this happened before the disposal processes had started/completed. We should be able to track down where exactly to do this (with a bit more work) so that we can kill it if running on linux. I'll keep you updated.

*edit: Yup, seems to be working now as per 64b9e50

image

@Sappharad Have you had any experience with MoltenVK? If I get Vulkan working it might be easier to start over with that than to continue maintaining OpenGL, which I understand to be hard because of WinForms.

@Sappharad Have you had any experience with MoltenVK? If I get Vulkan working it might be easier to start over with that than to continue maintaining OpenGL, which I understand to be hard because of WinForms.

I do not, but it's supposed to be easy. OpenGL will still be easier, because with that I already had a reference implementation to borrow code for. With either one I still need to do a custom fork of the OpenTK WinForms control to use it on 64-bit macOS, so Vulkan ends up being more work. Either way, if you support it I'll probably end up trying to do an implementation anyway, since there are supposed to be benefits to Vulkan.

@Sappharad

Current progress is #1438 in case you missed it. Hopefully you can magic up your custom GLControl and it will just drop in.

In IRC, Sappharad mentioned the refactoring is finally done. edit: as of posting on 2019-04-30

The DefaultValueAttribute on Color nonsense seems to be resolved, mono --version gives 5.20.1 on my machine (previously broken on 5.16.0).

Testing on my part, and Record movie crashes when using Gbhawk: url edit: backwards --yoshi

I do like where this is going though!

That looks like this, which might mean it's unrelated to the input recording feature. Still don't know what the actual problem is though.

Also markdown cheetsheet, I'm guessing you hit the link button in the comment box.

this button
Screenshot_20190816_152304
unhelpfully writes [](url), links in Markdown are [label](anchor-or-address)


I don't know where the actual error is, let alone the solution. I haven't actually tried debugging since my distro updated Mono, the new version might not crash immediately. If that works (and I can fix the problem) I'll @ you.

Don't worry, notarization is the least of my problems. I've been notarizing my apps for the last year.
WinForms is still not officially supported on 64-bit macOS, and I'm still busy working around bugs in the alternate implementation that I've been using.

I'm still having troube loading anything:

this error occured after following this
I did append the 4th line with x86_64-linux-gnu as I'm running ubuntu 19.10 and this error showed up when loading a gbc rom with gbhawk:
Gtk-Message: 11:08:18.992: Failed to load module "canberra-gtk-module" i965: Failed to submit batchbuffer: Invalid argument AL lib: (EE) alc_cleanup: 1 device not closed

And after that it just closes

Halfway through downloading Ubuntu image... In the meantime, could you check if the bug you reported above is still present (recording input movie causes NRE in MainForm)?

Further testing tonight, I tried running EmuHawk.exe from the terminal, and a long list of things showed up on the terminal and bizhawk opened with a blank black screen and eventually crashed. I also can't test record movie unless I have a rom loaded(which is what I'm having trouble with so far).

Before I was runnning the shell script, and that seems the most functional right now. If I try to change the display option and press ok, it crashes bizhawk.

Have you found anything?

I think I've reproduced everything. In the process I learned how out-of-date our Linux docs are...

Rename (or use symlinks) /usr/lib/x86_64-linux-gnu/libblip_buf.so.1.1.1 to /usr/lib/x86_64-linux-gnu/libblip_buf.so - tested NesHawk, GBHawk, and VBA-Next. This needs to be looked into because both names should work.
Install libcanberra-gtk-module - only hides the "Gtk-Message" warning, does not appear to affect rendering.
I think the bug that broke recording was since fixed, probably by #1438.

I looked for libbluff.so.1.1.1 to rename it but it seems it was already libbluff.so . Hower in usr/lib there also exist a libbluff.so so Im not sure if that duplicate is causing the issue.

Btw, gbhawk is still not loading anything.
its still giving me the same errors.

Does dpkg --verify libc6-dev libopenal1 mono-devel mono-vbnc nvidia-cg-toolkit print anything?

i965: Failed to submit batchbuffer: Invalid argument might be caused by iGPU drivers? Try changing the Config > Display... > Display Method, updating your ucode (intel-microcode), or DRI_PRIME=0 ./EmuHawkMono.sh if you have an NVIDIA GPU.

Another update: If I load gamebatte or vbanext, it will claim the dlls are not there and when I press ok, it doesn't crash bizhawk.

And where do I find this ucode at?

Few updates over, I tried updating my intel-micro, but it said it ws up to date. And I also took another screenshot of what happens when I load a gba game like stuntman.

This is really weird. The libraries just sit in output/dll from when you clone. Does sha1sum output/dll/libvbanext.dll print 1c599e4b4e6a1740e962641ffe95b63175ffb974?

BTW the Gambatte port isn't actually finished.

All as root:

echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" >/etc/apt/sources.list.d/mono-official-stable.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
apt update && apt install msbuild

Maybe there's a mono-devel in the official repos and it's conflicting?

nuget restore BizHawk.sln

Well, I got it to compile. By running BizhawkRelease.sh twice. And when I run EmuHawkMono.sh this shows up.. And I press ok and it kills the application.

I'll be honest, I have no idea how resources work. Last time they broke I had to clone the repo again.

Meanwhile I've just tried VBA-Next on an AppVeyor build, and I get the same DllNotFoundException.

Ok, so testing on latest commit, I compile just fine on first try. I read the readme, and on that part where it says find d3dx9_43.dll.so and update script accordingly, does that mean to change line 14?

I changed it to libpath="/usr/lib/x86_64-linux-gnu/wine" and I still can't load anything.With gambatte, it gives me an error regarding loading bios. Even though I have the bios setup before hand. If I didn't, it will give the message asking to change it and that works fine. There is no Firmware folder, so you just have to make one.

When loading GBHAWK or NESHAWK, this shows up for those HAWK cores: i965: Failed to submit batchbuffer: Invalid argument
AL lib: (EE) alc_cleanup: 1 device not closed

On latest commit as of writing this.

Now its giving me errors upon building:

"/home/sean/BizHawk_master/BizHawk.sln" (default target) (1) ->
"/home/sean/BizHawk_master/BizHawk.Client.DBMan/BizHawk.Client.DBMan.csproj" (default target) (6) ->
"/home/sean/BizHawk_master/BizHawk.Client.Common/BizHawk.Client.Common.csproj" (default target) (7:2) ->
(CoreCompile target) ->
CSC : error CS2001: Source file '/home/sean/BizHawk_master/BizHawk.Client.Common/movie/import/PjmImport.cs' could not be found. [/home/sean/BizHawk_master/BizHawk.Client.Common/BizHawk.Client.Common.csproj]
CSC : error CS2001: Source file '/home/sean/BizHawk_master/BizHawk.Client.Common/movie/import/PxmImport.cs' could not be found. [/home/sean/BizHawk_master/BizHawk.Client.Common/BizHawk.Client.Common.csproj]

Has anyone had any success with this?

I now can load HAWK cores after running this command: export LIBGL_ALWAYS_SOFTWARE=1

But VBA-next and lynx and whatever isnt a hawk core, still doesn't load. Oh well. I was right about to go back to windows, but I was bound and determined to find a solution.

@YoshiRulz Would It be possible to package BizHawk in a Flatpak, Appimage, or .deb file to make it more accessible to linux users?

Debian package is planned, Flatpak or similar is not becuase it probably won't work.

Lua script crashes bizhawk.

Nonetheless, I am still very grateful I can tas again with anything. I am planning on restarting FFVII NES. Hopefully bizhawk fixes some of the problems FCEUX had with it that affected gameplay big time.

[Edit] I have tested both Appveyor build and built it manually. And they both give the same result.

Another thing about encodes, I understand that FFmpeg is the only thing works right now, and when I make an avi unconpressed video, the video outputs nothing when I play it under VLC. To get around this, I use shotcut to convert it to make it work(if that makes sense).

It isn't emulation that makes things hard, it's .net and overall windowsiness. Find an example of a .net program on flathub (not an emulator necessarily) and that would be more valuable.

I found this webpage assuming it is a .NET Core Application.
https://www.phillipsj.net/posts/packaging-dotnet-core-with-flatpak/

If we used .NET Core this issue wouldn't exist... it's Framework 4.5 (4.6.1) as the readme says. At least you tried. tangent convo hidden

Back on the topic of .deb packages, if you know how to make them I'd appreciate the help. When Ubuntu Bionic came out I tried making one only to find it was disabled on live boots.

@YoshiRulz I do know a good example of a Windows application bundled in a deb file. The program is called Cosmigo Pro Motion. They just bundled Wine with their program.
https://www.cosmigo.com/pixel_animation_software/downloads/mac_linux_downloads

We're trying to remove the dependency on WINE thanks.

On c1ba930 commit(I think that's what I copy for commit), it still doesn't load any non-hawk cores. Like VBA-Next and gambatte.

Does anyone know of a solution for that? I'm sorry if I posted this before, but its just a big problem as it would prevent any other cores from being ported.

[Edit], I do know that once the build system is changed to dotnet, it should make porting a lot easier.

Disregard what I said above. I'll be patience and be grateful with being able to tas anything on linux now.

More testing on commodore 64 tasing, I tested multi disk bundler to make a xml file for wasteland, it creates one fine(I think) but it doesn't run it.

I stand correct: it can load xml files, but the multi disk bundler doesn't write them correctly. It just writes the folder where bizhawk is located.

Why is encoding disabled? I mean, it didnt output video on vlc, but I just used shotcut to fix it.

Another thing, with dshawk still in development, do you have any clue on how we can get that working on linux? Right now on windows theyre having trouble even loading a game, but my mind would be blown if we got it working on linux someday.

CPCHawk, SameBoy, and ZXHawk have non-string resources (causes crash when compiled with dotnet).


@InfamousKnight A/V recording is disabled because I'm working on other things, and didn't want people running into a crash while using it. A quick look at the DS branch suggests it will be easy to port.

Hmm, I still have to see it to believe it. If that succeeds, I will never touch windows again.

So its been a while since I tested the linux port.

Any plans on updating the OP so we know where we currently stand? Also I believe users with igpu have to force software renderer to open anything.

Any plans on updating the OP

It's on my list, I swear... I just keep adding more things above it. It doesn't help that there are only about 4 users rn.

There will be more if we announce on discord.

I came here to ask if Record avi was enabled(it worked before, but with a blank screen that can be fixed using shotcut) and noticed the page was finally updated! I understand it was disabled to avoid crashes, but would be nice to have still.

Really happy to see this progress!

Thanks.. um I wont be able to test it until like 2 days as my computer is in the shop right now. New problem with installing ubuntu.

Again, thank you guys so much for putting this together.

Ok, I got almost everything installed on ubuntu 20.04

First of all, libblip_buff doesn't seem to be recognized on here. A lot of things give out a big error log like save states on any core(even hawk cores), I try to switch to a core and save config and the big error log comes up and I try to config controller setting and and save and exit and it crashes with that big error log again.

Interestingly, I don't need software renderer enabled to run anything despite having the same gpu as before. [Edit, I actually do need software renderer enabled for the above issues and then they are solved. I can "run" though without the software renderer.

In other news: record AVI function works about the same as last time. Only ffmpeg works. I tested saturnus and there's still a black screen with audio in the background so I have to use shotcut to fix it. No desync issues when playing back a saturnus movie made on windows to linux. So I made a test movie on windows, put it on userfiles, and tested it on linux and no desyncs. So yeah, they are probably exactly the same.

Looking forward to seeing what else can be added!

Shotcut is the video editor that ships with Ubuntu, yes? I tried a quick recording and also noticed the output was malformed, but if there's an FFmpeg flag to fix it we can add a note. What exactly did you do to the video?

If shotcut could read it and turn it into something you could view, 99% chance the player you chose was bad and couldn't handle the format, or you chose an esoteric format.

something as advanced as vlc

Less advanced than shotcut, by your own evidence. If you want to provide the magic incantations to make ffmpeg output suck less in random video players, I have no problem including it as one of our preset options, and maybe the default one if it doesn't suck too bad.

Just pointing out for the sake of testing, I tested uzebox and it loads. C64 hawk should still work(I haven't tested latest build on it), but I doubt it broke itself. I'm pretty sure all the hawk cores work fine. Interestingly, you don't need software renderer enabled for non-hawk cores like the waterbox ones. But you do need it for hawk cores. A different error message appears as well. A long one..

Also, you should put record avi works fine with ffmpeg. Except the video output is black with audio working. I know shotcut can fix it. I wonder what would happen if I upload it to youtube.

So it looks like a lot more is working than 19 cores. Melonds doesn't look too far away from a linux build. Some attempts were made but failed. Looking at upstream melonds, some linux work was done.

So I have a question, for emulators that are multi-platform, like mgba, how would we go about porting that to the linux bizhawk? I'm assuming some naming conventions would need to be changed? And so one would have to dig through the code knowing what to change to make it work for linux? I'm just trying to understand.

Depends on the core and how windowsy it is. For mgba, one simply makes a new linux build script and other small ad-hoc adjustments which wont be known until its tried.

^ And until now, only build scripts have needed changes (on the core side; on the Hawk side we also s/.dll/.so/).

There is the possibility of having code that's not gnu enough though; for instance, our mupen setup would be significantly difficult to port.

Ok, I tested mgba and it says aborted core on latest commit as of writing this. I tried with and without software renderer.

Is anyone else having that problem?

Bump I think I found the issue: https://drive.google.com/file/d/1wLFwsNxa8kk-OiCoZsfn1c39eWzfzhGV/view?usp=sharing notice how the commit: ac4ed47 is missing.

The commit you want is 2f5c947 (dev build).

That's the one I tried. I just thought because that other commit was missing it may have broke it. Is it working for you?

I wouldn't have updated the list if it didn't work; that means testing CI builds as well. If you're building from source I'd recommend git fetch origin && git checkout origin/master && git branch -f master.

(the commit that's "missing" was removed in a force push)

Um, that command doesn't work. fatal: not a git repository (or any of the parent directories): .git

I tested the one in gitlab under pipelines and it still says aborted(core dump) I ran that command in Home directory. I sense something is missing there?

Interesting. My Ubuntu setup is temporarily out of order, but you could try building it yourself to see if it's a linker problem (endrift made it really easy):

cd BizHawk
git submodule update --init # assuming you've not done this already
cd mgba
./bizhawk-make-install.sh
# it'll say cp libmgba.dll.so ../../../../../output/dll when done

The other command to fix HEAD needs to be run in the repo root dir, do that FIRST.

nevermind, it's probably this -_- /usr/lib needs to change like in the run script edit: might be fixed as of b6f4344?
https://github.com/TASVideos/BizHawk/blob/ae667eca2909d464f92121631192f8f31939d183/src/BizHawk.Common/IImportResolver.cs#L24