Jump to content
You must now use your email address to sign in [click for more info] ×

Affinity Photo running on Linux with Bottles


aronkvh

Recommended Posts

Hi,
There's *finally* a way to run Affinity Photo and Designer on Linux and it's pretty easy actually.
Steps:

1. Install Bottles (from https://usebottles.com/ or your appstore)
2. From Settings/Runners, install 'Caffe 7.10'
3. Down
load the custom recipe file (from Kontik from the Bottles Telegram chat)
4. Create a new bottle, click 'Custom' and choose the recipe (AffinityCustomBottleRecipe.yml)
5. Click the 'Run executable' button and choose your downloaded .exe (Download from your Affinity Account)
6. Install it like the Windows version
7. Click the three dots next in the 'Photo' card of the 'Programs' list choose 'Change Launch options' and add the following to 'Command arguments': --no-hw-ui argument

There are still glitches and crashes but it's still someting :)
P.S.: Let me know if you'd like a video tutorial

AffinityCustomBottleRecipe.yml
 

Screenshot_20220810_173447.png

Link to comment
Share on other sites

  • 2 weeks later...

No success from my side, I just have everything black but can overlay them (like the document that we can see)

I'm running with a RTX 3090 in X11, could it be the problem?

Spoiler

20220819-194640.thumb.jpg.ca99b0d164a0ae35c463631d506ebbdf.jpg

EDIT: It works actually a bit more than only my screenshot, if I manage to create a new document I have this:

 

Edited by Cuissedemouche
Link to comment
Share on other sites

Finally! Thank you for the update. Affinity Designer was the only program that I still dual booted Windows for.

I also got it working - running a GTX 1060 and X11 - however I can't save any files - it says "Failed to save document: <Untitled> - Save failed because access to the file was lost.", no matter what directory I choose or what name I give the file.

Any ideas on what to do?

Link to comment
Share on other sites

I'm assuming that when you create the bottle, in the "Custom" menu, you need to select "Caffe 7.10" as the launcher as well?

I managed to install Affinity Designer using the Flathub version of Bottles (v. 2022.8.14), but Affinity Designer itself wouldn't launch. It might have been a Flatpak issue, I wasn't really sure - there was no error message given. I ran the installer file again and it gave the option to repair or uninstall the app, so it looks like it was installed correctly.

I then uninstalled the Flathub version of Bottles and installed the Fedora Linux RPM version of Bottles (v. 2022.5.28). I tried to install Affinity Designer. It wouldn't even open the Affinity Designer installer file. Again, no error message given.

I'm running Fedora 36. Do you have any advice? Which version of Bottles did you get it working on, and did you have any problems with Flatpak's sandboxing?

Thanks

Edited by azuredusk10
Adding more details about my experiene
Link to comment
Share on other sites

  • 4 weeks later...

Hello, many thanks for this !

I have installed the bottle in Bottle Flatpak version (local config = Mint 21).

Launching ok.

Use of tools ok (but I have not tried everything).

But when saving the file, path found, then refused as lost, as described in the other Linux thread.

I agree to be a tester during all the dev process if needed.

Cath

Link to comment
Share on other sites

On 9/19/2022 at 5:19 PM, cr77 said:

Hello, many thanks for this !

I have installed the bottle in Bottle Flatpak version (local config = Mint 21).

Launching ok.

Use of tools ok (but I have not tried everything).

But when saving the file, path found, then refused as lost, as described in the other Linux thread.

I agree to be a tester during all the dev process if needed.

Cath

Hey!
I also have the same problem, but I don't know where to report it. It probably has something to do with the underlying Windows API.
If you know where to report it, gladly do so! Maybe as a bug on WineHQ?

Best of luck!

Link to comment
Share on other sites

On 9/19/2022 at 5:19 PM, cr77 said:

Hello, many thanks for this !

I have installed the bottle in Bottle Flatpak version (local config = Mint 21).

Launching ok.

Use of tools ok (but I have not tried everything).

But when saving the file, path found, then refused as lost, as described in the other Linux thread.

I agree to be a tester during all the dev process if needed.

Cath

Does Bootles have acess to that folder? (you can check/allow it in Flatseal)

Link to comment
Share on other sites

11 minutes ago, aronkvh said:

Does Bootles have acess to that folder? (you can check/allow it in Flatseal)

Not the person you were asking but I tried to save to multiple folders - all of which Bottles can access - with no success. A file is actually created, but it is 0 bytes large and Affinity Designer shows an alert "Failed to save document: <Untitled>". Did you get it to work?

Edited by dledr0f88
spelling
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

The save functionality uses the function `MoveFileTransactedA` in kernel32. Which is not implemented in wine (bottles, proton are all projects built on top of wine). https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/kernel32/path.c#L144

I went through and debugged and submitted some patches to wine to address Affinity Photo working under wine. I was able to get it working with Vulkan on linux after making a few patches.

The last remaining change that I could see to get affinity photo running was to convert MoveFileTransacted (and related file operations) implemented to the point to work when called.

I have a pull request (https://gitlab.winehq.org/wine/wine/-/merge_requests/145) that was able to get the save functionality working. But wine must support more than just this one piece of software, and newly implemented code must not affect other software.

I suspect that is why this PR didn't get any attention. And as such, saving probably isn't going to be working for a while.

In regards to your flickering, if you expect performance of Affinity Photo to be as good as on windows or mac out of the box... don't. It would take a good amount of effort from someone with a lot of knowledge of the windows and linux api's, who is also good at performance improvement and debugging. Developers with interest and free time and expertise are rare.

Edited by ElementalWarrior
phrasing
Link to comment
Share on other sites

On 9/22/2022 at 1:24 PM, aronkvh said:

 

 

If someone can find a fix to this flickering please let me know.

I get a better experience using wine's built in vulkan rendering instead of vulkan through dxvk.

Effectively set all the d3d dll's to builtin through winecfg, and add the registry key for Direct3D/Renderer under wine to vulkan.[1]

 

1. See https://wiki.winehq.org/Useful_Registry_Keys and search for renderer.

image.png

Link to comment
Share on other sites

On 10/20/2022 at 6:20 PM, ElementalWarrior said:

The save functionality uses the function `MoveFileTransactedA` in kernel32. Which is not implemented in wine (bottles, proton are all projects built on top of wine). https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/kernel32/path.c#L144

I went through and debugged and submitted some patches to wine to address Affinity Photo working under wine. I was able to get it working with Vulkan on linux after making a few patches.

The last remaining change that I could see to get affinity photo running was to convert MoveFileTransacted (and related file operations) implemented to the point to work when called.

I have a pull request (https://gitlab.winehq.org/wine/wine/-/merge_requests/145) that was able to get the save functionality working. But wine must support more than just this one piece of software, and newly implemented code must not affect other software.

I suspect that is why this PR didn't get any attention. And as such, saving probably isn't going to be working for a while.

In regards to your flickering, if you expect performance of Affinity Photo to be as good as on windows or mac out of the box... don't. It would take a good amount of effort from someone with a lot of knowledge of the windows and linux api's, who is also good at performance improvement and debugging. Developers with interest and free time and expertise are rare.

Thank you for your work! That's awesome and I hope the PR gets approved soon. I wasn't able to compile WINE on my machine yet, but I will try again with your branch if saving actually works.

Link to comment
Share on other sites

On 10/21/2022 at 10:00 AM, dledr0f88 said:

Thank you for your work! That's awesome and I hope the PR gets approved soon. I wasn't able to compile WINE on my machine yet, but I will try again with your branch if saving actually works.

When I was working on it, I just used the arch PKGBUILD. I would skip the install step and just run the compiled binary from the output directory.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wine-staging-git

Link to comment
Share on other sites

Hello - new to both Affinity and the forums here. I'm another Linux dude that has been using it on desktop/laptop since 2001 and before that, since 1999 on servers. I can't stand Windows.

Presently, I'm running Mint. I have tried the recipe above with both Affinity Photo and Design and get a lot of weird things going on. Design freezes on me randomly.

Photo is something else - So, I can create new files and export them (I've tried PSD, PDF, and JPG). I can then open them later as well.

But trying to open jpgs in the same directory that were created/saved/exported in GIMP causes Photo to crash. Same with all the JPG's created by darktable. Very weird. My fan speed starts whirring like crazy, and then Photo just dies.

I can also not open Nikon RAW NEF files. Same behavior. Photo shows the message "Loading 1 Document," hangs for about 10-15 seconds, then dies.

Oddly, I can open stock images that I downloaded from Dreamstime and that are jpg. I have also been able to open jpgs created with an older point and shoot camera (can't remember the brand) that are jpg.

But it seems to have big issues with with jpgs created with GIMP, darktable, and Nikon.

Link to comment
Share on other sites

I have tried the version 2 release. I could not get it to run. It is released as a msix package.

You can often extract things like exe's, msi, msix as you would zip packages. If you run `unzip -l affinity-photo-2.0.0.msix` it will list the application binaries and assets.

After trying to run the Photo.exe it can't seem to find its own dll's. Even though they're in the same folder. I'm not sure why that is tbh. From `WINEDEBUG=+module wine Photo.exe` I see it saying its looking in the proper directory.

Link to comment
Share on other sites

1 hour ago, ElementalWarrior said:

I have tried the version 2 release. I could not get it to run. It is released as a msix package.

You can often extract things like exe's, msi, msix as you would zip packages. If you run `unzip -l affinity-photo-2.0.0.msix` it will list the application binaries and assets.

After trying to run the Photo.exe it can't seem to find its own dll's. Even though they're in the same folder. I'm not sure why that is tbh. From `WINEDEBUG=+module wine Photo.exe` I see it saying its looking in the proper directory.

Keep us updated about your progress on getting it to run. :D

Link to comment
Share on other sites

13 hours ago, ElementalWarrior said:

I have tried the version 2 release. I could not get it to run. It is released as a msix package.

You can often extract things like exe's, msi, msix as you would zip packages. If you run `unzip -l affinity-photo-2.0.0.msix` it will list the application binaries and assets.

After trying to run the Photo.exe it can't seem to find its own dll's. Even though they're in the same folder. I'm not sure why that is tbh. From `WINEDEBUG=+module wine Photo.exe` I see it saying its looking in the proper directory.

I tried the same thing and ran into the same issue.
I tried adding the dlls manually to the system32 folder and adding an override via winecfg but that also didn't help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.