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

IPF file support on Mac v2.14.4.1 broken #7

Closed
malc0mn opened this issue Jul 16, 2023 · 15 comments
Closed

IPF file support on Mac v2.14.4.1 broken #7

malc0mn opened this issue Jul 16, 2023 · 15 comments

Comments

@malc0mn
Copy link

malc0mn commented Jul 16, 2023

Following these steps: https://torlus.com/floppy/forum/viewtopic.php?p=25110#p25110 on version 2.5.6.6 works perfectly and will allow opening of .ipf files on MacOS Ventura 13.4.1 (c).

However, this no longer works on version 2.14.4.1 which will report an error:

2023-07-16 12:27:58.597 hxcfloppyemulator[1713:133056] +[CATransaction synchronize] called within transaction

Edit: I should mention that this is an incredibly cool project. Really impressed!

@jfdelnero
Copy link
Owner

Unfortunately i don't have a recent enough Mac to reproduce, debug and fix this issue...

@malc0mn
Copy link
Author

malc0mn commented Aug 6, 2023

I'm happy to do some additional testing and/or provide additional logs if you can give me some pointers?

@jfdelnero
Copy link
Owner

@malc0mn
Copy link
Author

malc0mn commented Aug 9, 2023

Followed the same steps. The results are a bit different but it still does not work. Now when I click the 'load' button in v2.14.11.1, the same error is still output when running from the terminal, but more often. It happens even before the file selector window is visible:

2023-08-09 14:00:35.428 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.456 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.494 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.507 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.523 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.540 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.558 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.575 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.591 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.607 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.624 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.642 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.658 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.674 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction
2023-08-09 14:00:35.692 hxcfloppyemulator[7157:85824] +[CATransaction synchronize] called within transaction

This is the exact output, no lines have been omitted.

In v2.5.6.6 (with working IPF support on Mac) this line is displayed only once after clicking on the 'Load' button.

I do not know if there is a built in way to launch it with 'debug level logging'? Then I would probably be able to provide you with more useful logs ;-)

What I did not mention in my original post is that during starting of the app, this line is output in the terminal:

Error while loading libusbhxcfe ! USB HxC Floppy Emulator support disabled !

I never mentioned it since I did not care about USB support (and v2.5.6.6 also has this), but of course it might be useful to know (but is probably completely unrelated).

@jfdelnero
Copy link
Owner

jfdelnero commented Aug 15, 2023

I think that these prints are unrelated with your issue.
Please enable internal logs and share the log file here.
(Log->Set "Info/Warning/Error" and "Debug", then "Set log file" to set the log file, then try to load the ipf file)

@jfdelnero
Copy link
Owner

jfdelnero commented Aug 15, 2023

One possibility : The old HxC version was only compiled for x64 machines - and then the Mac use the emulator layer to run it and is able to load the x64 caps library. The new HxC targets the x64 and ARM. You have an ARM based machine, so the ARM HxC version is running... But the caps library only target x64 machines...

EDIT : I have checked the caps library, the most recent one come from 2011... So this library definitively need a new build.

@malc0mn
Copy link
Author

malc0mn commented Aug 18, 2023

I should have mentioned that I indeed have an M1 powered mac, crazy that I completely missed this obvious issue. So to confirm what you said:

Beta 2.14.11.1

The error in the logs is this one:

DEBUG  : IPF_libIsValidDiskFile : IPF file !
ERROR  : init_caps_lib : Can't load /Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/Frameworks/libfs-capsimage.dylib ! Library not found ?
ERROR  : IPF_libIsValidDiskFile : No Caps lib available!

While it does exist on disk, but is x86_64:

stat /Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/Frameworks/libfs-capsimage.dylib
16777231 6143848 -rwxr-xr-x 1 malc0mn staff 0 178592 "Aug 18 12:37:38 2023" "Jun 24 07:29:32 2014" "Aug 18 12:35:23 2023" "Jun 24 07:29:32 2014" 4096 352 0 /Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/Frameworks/libfs-capsimage.dylib

file /Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/Frameworks/libfs-capsimage.dylib
/Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/Frameworks/libfs-capsimage.dylib: Mach-O 64-bit dynamically linked shared library x86_64

The main executable is indeed a universal binary:

file /Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator
/Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
/Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator (for architecture x86_64):	Mach-O 64-bit executable x86_64
/Users/malc0mn/Downloads/HxCFloppyEmulator_soft_beta/HxCFloppyEmulator_Software/macOS/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator (for architecture arm64):	Mach-O 64-bit executable arm64

Version 2.5.6.6

This one is indeed not a mixed binary:

file /Volumes/Media/Applications/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator 
/Volumes/Media/Applications/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator: Mach-O 64-bit executable x86_64

Thank you for helping out on this one!

@malc0mn malc0mn closed this as completed Aug 18, 2023
@jfdelnero
Copy link
Owner

jfdelnero commented Aug 18, 2023

@malc0mn One possible workaround is to disable the ARM build in the makefiles.

remove the ARM part from the MACOSX_ARCH lines :

MACOSX_ARCH ?= -arch arm64 -arch x86_64

(it is maybe possible to set the MACOSX_ARCH variable from the main makefile.)

(i reopen the ticket for the moment)

@jfdelnero jfdelnero reopened this Aug 18, 2023
@renaudguerin
Copy link
Contributor

renaudguerin commented Aug 19, 2023

The new HxC targets the x64 and ARM. You have an ARM based machine, so the ARM HxC version is running... But the caps library only target x64 machines...

If this is indeed the problem, then there is a very simple workaround that should be working : force the Mac to open the x64 version of the app using Rosetta emulation until the CAPS library is available for ARM.

To do this @malc0mn simply right click / "Get Info" on the app icon (or just Cmd+I) and tick the "open with Rosetta" box.

I'm still on 2.6 but will be updating to 2.14 soon to try this (I am the person who wrote the comment @malc0mn was referring to)

@renaudguerin
Copy link
Contributor

In fact, I forgot about it but I made a Mac ARM build of the CAPSImage library, the release is here. This is what I used with HxC 2.6.
There is also the build from FS-UAE here, I will try it with HxC 2.14 now.

@renaudguerin
Copy link
Contributor

renaudguerin commented Aug 19, 2023

I have tried the workaround I described here and it's still working exactly the same for me in v2.14.4.1 as in v2.6

Steps :

  • Download my universal build (x86_64/arm64) of CAPSImage 5.1 here
  • Unpack & install CAPSImage.framework somewhere (for example a system location like /Library/Frameworks/, or inside the HxC app itself /Applications/HxCFloppyEmulator.app/Contents/Frameworks)
  • From the terminal, cd /Applications/HxCFloppyEmulator.app/Contents/Frameworks or wherever you installed the library.
  • Launch the HxC app from here : /Applications/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator &

I made myself a /usr/local/bin/hxc script to make this easier : cd /Applications/HxCFloppyEmulator.app/Contents/Frameworks && /Applications/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator &

This is not an ideal situation but it's the only way I've found until HxC is updated to look for the library in the standard system locations (see my original comment. If I find the time I will submit a patch)

@renaudguerin
Copy link
Contributor

I've just a submitted a PR which should make things work for Mac users just by copying the CAPSImage framework to /Library/Frameworks

@jfdelnero
Copy link
Owner

@renaudguerin
Release with your PR :
https://hxc2001.com/download/floppy_drive_emulator/HxCFloppyEmulator_soft_beta.zip

@renaudguerin
Copy link
Contributor

@renaudguerin Release with your PR : https://hxc2001.com/download/floppy_drive_emulator/HxCFloppyEmulator_soft_beta.zip

Confirmed it works fine !

@jfdelnero
Copy link
Owner

Since this is fixed, i close this issue.
reopen it if needed.

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

3 participants