GNOME snapshot RPM package does not work

In Fedora 39 there is the RPM snapshot package, one of the core apps of GNOME 45. Although this package is the new official application of camera in Gnome, it does not work, perhaps due to the lack of some dependences or perhaps for something that I cannot understand. However, the relative Flatpak version works perfectly.
This topic was created in order to compare ourselves on this issue and be able to find a solution.

snapshot, though available from fedora, is not a gnome core app and seems to not be installed by default in fedora 39

# dnf list installed snapshot
Error: No matching Packages to list


# dnf list snapshot
Fedora 39 - x86_64 - Updates                                                                         45 kB/s |  23 kB     00:00    
RPM Fusion for Fedora 39 - Free                                                                     9.0 kB/s | 3.6 kB     00:00    
RPM Fusion for Fedora 39 - Nonfree                                                                   17 kB/s | 6.8 kB     00:00    
Available Packages
snapshot.x86_64                                             45.1-1.fc39                                              updates        
snapshot.x86_64                                             45.1-1.fc39                                              updates-archive

If you are looking for how to take screenshots the ‘print screen’ button on the keyboard enables that by default with gnome.

In what way does it not work? Does it fail to install, does it crash, or what?

It’s not installed by default in Fedora 39. But it is a GNOME Core app.

It starts but doesn’t find any camera device.

Not all all cameras work with linux. You can check your camera device on the LHDB. This should tell you if the same camera is detected or not on linux, and if so, whether it works and what driver is used. You will need to determine the bus (usually USB) and the vendor:device ID’s. In some cases users have provide comments detailing how to get a device working.

That’s not the specific case. Camera device has been detected by Linux and it works properly with other applications, also using Gstreamer.

In that case, you can use journalctl to compare a working case with the one that fails. Note the time of each test and use the --since and --until options to filter the output.

Does the Fedora flatpak work?

flatpak install --reinstall fedora org.gnome.Snapshot

Here, both flatpaks detect the camera (the Flathub version is a bit glitchy), but the snapshot package installed in a toolbox does not. I’m not sure if that’s just a container issue though.

What do you see in the terminal when running the RPM version?

2023-12-26T18:17:34.257645Z  INFO snapshot::application::imp: Snapshot (org.gnome.Snapshot)    
2023-12-26T18:17:34.257663Z  INFO snapshot::application::imp: Version: 45.1    
2023-12-26T18:17:34.257665Z  INFO snapshot::application::imp: Datadir: /usr/share/snapshot    
2023-12-26T18:17:34.405186Z  INFO ashpd::desktop::request: Creating a org.freedesktop.portal.Request /org/freedesktop/portal/desktop/request/1_161/ashpd_rdZKRDNWKS
2023-12-26T18:17:34.414995Z  INFO ashpd::desktop::request: Received signal 'Response' on 'org.freedesktop.portal.Request'
2023-12-26T18:17:34.415025Z  INFO ashpd::proxy: Calling method org.freedesktop.portal.Camera:OpenPipeWireRemote
2023-12-26T18:17:34.415335Z  WARN snapshot::widgets::camera: Could not use the camera portal: Portal request failed: org.freedesktop.portal.Error.NotAllowed: Permission denied

I think we have an answer now. The first time I launched the application in the terminal I denied access to the camera device (as I thought it was not necessary since it is not an application in a sandbox). Now access is automatically denied every time.

That should probably be reported upstream. The app should be able to suggest reenabling camera permission if it doesn’t see any camera

Did you try enabling that permission in Settings → Apps? If so, did that help?

The flatpak currently has a sandbox hole that lets it bypass the portal. Logically, I’d expect the RPM version to do the same thing.

I reported it in GitLab.
Is there a way to restore the initial situation? Reinstalling app doesn’t work.

Unfortunately it’s not possibile to edit the camera permission from GNOME Settings, probably because it’s not a flatpak app.

That does make sense I guess. You wouldn’t want to give the false impression that disabling the permission actually does anything.

You can use flatpak permission-remove devices camera to clear all camera permissions.

Compare (flatpak):

$ flatpak permissions devices camera
Table   Object App                Permissions Data
devices camera org.gnome.Snapshot yes         0x00

to (RPM):

$ flatpak permissions devices camera 
Table   Object App Permissions Data
devices camera     yes         0x00

When that permission dialog is triggered for the RPM version of snapshot, it makes an entry with no App ID. This seems a bit broken, but again I don’t think it’s the cause of your issue.

Does the app display ‘No Cameras Found’ or does it spin endlessly?

It spins endlessly when I run it from the app menu. It works (with that warn) when i run it from terminal.

Can I use this command just for a single app?

Normally, you can add the app id to the end of the command, but there isn’t one in this case. I don’t know of a way to unset that granularly.

Thank you for all your clarifications. I reset camera permissions and I was able to give them once it asked me (I keep not understanding why there is a need for this if I am not in a sandbox).

Now there aren’t warns if I run it in terminal:

2023-12-27T06:39:05.556272Z  INFO snapshot::application::imp: Snapshot (org.gnome.Snapshot)    
2023-12-27T06:39:05.556287Z  INFO snapshot::application::imp: Version: 45.1    
2023-12-27T06:39:05.556291Z  INFO snapshot::application::imp: Datadir: /usr/share/snapshot    
2023-12-27T06:39:05.718507Z  INFO ashpd::desktop::request: Creating a org.freedesktop.portal.Request /org/freedesktop/portal/desktop/request/1_113/ashpd_dpuNJJZGJg
2023-12-27T06:39:14.467851Z  INFO ashpd::desktop::request: Received signal 'Response' on 'org.freedesktop.portal.Request'
2023-12-27T06:39:14.467935Z  INFO ashpd::proxy: Calling method org.freedesktop.portal.Camera:OpenPipeWireRemote

But the situation is always the same if I run it from apps menu:

I’m having the same issue on Framework 13. Though I get past the spinning circle to see “No camera found”. (Both RPM ran in console and Flathub, running RPM from desktop spins forever.)

Despite not being a Flatpak app, when granting RPM package the permission, the permission is stored in Flatpak, with no ID (probably why it doesn’t show in GNOME Settings), and doesn’t go away if it’s uninstalled:

$ flatpak permissions
Table      Object     App                     Permissions                  Data
devices    camera                             yes                          <<byte 0x00>>

EDIT:
Uninstalled both RPM and Flathub version, cleared permission, installed Flathub version, didn’t work when launched from desktop (never asked for permission), launched from console and gave permission, now works.
Camera is stuttery, but probably unrelated.