Open jtojnar opened 9 months ago
Seeing this as well on nixos-unstable.
Snapshot fails to load camera but Cheese works.
This is the Snapshot output I'm getting:
2023-11-27T04:29:36.731714Z INFO snapshot::application::imp: Snapshot (org.gnome.Snapshot)
2023-11-27T04:29:36.731729Z INFO snapshot::application::imp: Version: 45.0
2023-11-27T04:29:36.731734Z INFO snapshot::application::imp: Datadir: /nix/store/3jn3nmf7kbrgnrfnlvrq494nhaqv1xzy-snapshot-45.0/share/snapshot
2023-11-27T04:29:36.942503Z INFO ashpd::desktop::request: Creating a org.freedesktop.portal.Request /org/freedesktop/portal/desktop/request/1_137/ashpd_GuFy0PKGEB
2023-11-27T04:29:36.943785Z INFO ashpd::desktop::request: Received signal 'Response' on 'org.freedesktop.portal.Request'
2023-11-27T04:29:36.943807Z INFO ashpd::proxy: Calling method org.freedesktop.portal.Camera:OpenPipeWireRemote
0:00:00.154152797 55239 0x6d13a80034c0 FIXME default gstutils.c:4036:gst_pad_create_stream_id_internal:<preview-appsrc:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.154274622 55239 0x6d13a8003750 FIXME default gstutils.c:4036:gst_pad_create_stream_id_internal:<camerasrc-real-src-actual-src-pipewir:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.155131856 55239 0x6d12e0011000 FIXME glcontext gstglcontext.c:2038:gst_gl_wrapped_context_get_config:<glwrappedcontext0> wrapped context could not retrieve config. The application may be missing a call to gst_gl_context_fill_info() or the specific platform implemention is not implemented for retrieving the config from a wrapped OpenGL context.
0:00:00.752375437 55239 0x6d13140031c0 WARN pipewiresrc gstpipewiresrc.c:685:on_state_changed:<camerasrc-real-src-actual-src-pipewir> error: stream error: no more input formats
0:00:00.752418745 55239 0x6d13140031c0 WARN pipewiresrc gstpipewiresrc.c:685:on_state_changed:<camerasrc-real-src-actual-src-pipewir> error: stream error: no more input formats
0:00:00.752475122 55239 0x6d13a8003750 WARN basesrc gstbasesrc.c:3132:gst_base_src_loop:<camerasrc-real-src-actual-src-pipewir> error: Internal data stream error.
0:00:00.752488772 55239 0x6d13a8003750 WARN basesrc gstbasesrc.c:3132:gst_base_src_loop:<camerasrc-real-src-actual-src-pipewir> error: streaming stopped, reason not-negotiated (-4)
2023-11-27T04:29:37.568532Z ERROR aperture::viewfinder: Could not start camerabin: Element failed to change its state
2023-11-27T04:29:37.570635Z ERROR aperture::viewfinder: Could not start camerabin: Element failed to change its state
2023-11-27T04:29:37.571483Z ERROR aperture::viewfinder: Could not start camerabin: Element failed to change its state
2023-11-27T04:29:37.571976Z ERROR aperture::viewfinder: Bus Error from Some("/GstCameraBin:camerabin0/GstWrapperCameraBinSrc:camerasrc/GstAutoVideoSrc:camerasrc-real-src/GstPipeWireSrc:camerasrc-real-src-actual-src-pipewir")
stream error: no more input formats
Some("../src/gst/gstpipewiresrc.c(685): on_state_changed (): /GstCameraBin:camerabin0/GstWrapperCameraBinSrc:camerasrc/GstAutoVideoSrc:camerasrc-real-src/GstPipeWireSrc:camerasrc-real-src-actual-src-pipewir")
2023-11-27T04:29:37.571994Z ERROR aperture::viewfinder: Bus Error from Some("/GstCameraBin:camerabin0/GstWrapperCameraBinSrc:camerasrc/GstAutoVideoSrc:camerasrc-real-src/GstPipeWireSrc:camerasrc-real-src-actual-src-pipewir")
stream error: no more input formats
Some("../src/gst/gstpipewiresrc.c(685): on_state_changed (): /GstCameraBin:camerabin0/GstWrapperCameraBinSrc:camerasrc/GstAutoVideoSrc:camerasrc-real-src/GstPipeWireSrc:camerasrc-real-src-actual-src-pipewir")
2023-11-27T04:29:37.572010Z ERROR aperture::viewfinder: Bus Error from Some("/GstCameraBin:camerabin0/GstWrapperCameraBinSrc:camerasrc/GstAutoVideoSrc:camerasrc-real-src/GstPipeWireSrc:camerasrc-real-src-actual-src-pipewir")
Internal data stream error.
Some("../libs/gst/base/gstbasesrc.c(3132): gst_base_src_loop (): /GstCameraBin:camerabin0/GstWrapperCameraBinSrc:camerasrc/GstAutoVideoSrc:camerasrc-real-src/GstPipeWireSrc:camerasrc-real-src-actual-src-pipewir:\nstreaming stopped, reason not-negotiated (-4)")
Since this works fine for me™ (i.e. both starting from terminal and from Activities works fine), I am not sure where to start help debug this. I noticed that upstream now has a TROUBLESHOOTING.md though I am not sure if that can actually help, maybe if neither the flathub build (also works for me) nor a pipewire bump helps then asking for help on upstream is okay :upside_down_face:
Posting my outputs on various things (I am on https://github.com/NixOS/nixpkgs/commit/5a09cb4b393d58f9ed0d9ca1555016a8543c2ac8, using built-in camera on Dell Inspiron 7591):
pw-dump | grep default.video.source
nix-shell -p gst_all_1.gst-plugins-base -p gst_all_1.gst-plugins-good -p gst_all_1.gst-plugins-bad -p gst_all_1.gst-plugins-rs -p gst_all_1.gstreamer --run "gst-device-monitor-1.0 Video/Source"
RUST_LOG=snapshot=debug,aperture=debug RUST_BACKTRACE=1 GST_DEBUG=3 snapshot
nix-shell -p v4l-utils --run "v4l2-ctl --list-devices"
env
whoami && groups
Even weirder, on my work laptop, the camera works when started from terminal:
2023-11-27T14:15:38.413513Z INFO snapshot::application::imp: Snapshot (org.gnome.Snapshot)
2023-11-27T14:15:38.413524Z INFO snapshot::application::imp: Version: 45.0
2023-11-27T14:15:38.413525Z INFO snapshot::application::imp: Datadir: /nix/store/3jn3nmf7kbrgnrfnlvrq494nhaqv1xzy-snapshot-45.0/share/snapshot
2023-11-27T14:15:38.562766Z INFO ashpd::desktop::request: Creating a org.freedesktop.portal.Request /org/freedesktop/portal/desktop/request/1_159/ashpd_WBoWzAvFBs
2023-11-27T14:15:38.564825Z INFO ashpd::desktop::request: Received signal 'Response' on 'org.freedesktop.portal.Request'
2023-11-27T14:15:38.564863Z INFO ashpd::proxy: Calling method org.freedesktop.portal.Camera:OpenPipeWireRemote
but not when started from Activities:
Nov 27 15:11:21 sy org.gnome.Snapshot.desktop[225701]: 2023-11-27T14:11:21.363954Z INFO snapshot::application::imp: Snapshot (org.gnome.Snapshot)
Nov 27 15:11:21 sy org.gnome.Snapshot.desktop[225701]: 2023-11-27T14:11:21.363963Z INFO snapshot::application::imp: Version: 45.0
Nov 27 15:11:21 sy org.gnome.Snapshot.desktop[225701]: 2023-11-27T14:11:21.363965Z INFO snapshot::application::imp: Datadir: /nix/store/3jn3nmf7kbrgnrfnlvrq494nhaqv1xzy-snapshot-45.0/share/snapshot
Nov 27 15:11:21 sy systemd[203083]: Started Application launched by gnome-shell.
░░ Subject: A start job for unit UNIT has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit UNIT has finished successfully.
░░
░░ The job identifier is 1413.
Nov 27 15:11:21 sy org.gnome.Snapshot.desktop[225701]: 2023-11-27T14:11:21.511681Z INFO ashpd::desktop::request: Creating a org.freedesktop.portal.Request /org/freedesktop/portal/desktop/request/1_133/ashpd_ERI3r1PRR7
Weirdly, there are no significant environment differences I can see:
Since 14fb201c7ca9866ea9fd5bf953cb077191ce48ce swapped cheese for snapshot, there's no working camera app in NixOS 23.11 / GNOME (by default) :cry:
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
It also works fine for me regardless of launching from Activities/Bash. Let me know if any logs would be useful.
Now it works for me: snapshot shows camera output :tada:
I'm on NixOS 23.11 (commit d02d818) and iIt works both from GNOME Shell and gnome-terminal.
Still not working here on unstable (5f64a12a728902226210bf01d25ec6cbb9d9265b). Is there commits on 23.11 not on unstable?
Probably not a Nix problem, the same is happening with me on Arch. Starting from terminal triggered a pop up asking for camera access, but nothing changed. After the pop up, "Camera" (snapshot) was listed untoggled (no access) under settings -> privacy -> cameras; I checked it but nothing changed again.
edit: I forgot to mention: cheese works as expected. edit: for some reason, it's working fine after reboot. No upgrade was performed.
Please check if this is still the case.
Working on 24.05.20240202.e92b601
with hyprland.
Still not working for me on Gnome.
The symptoms described in https://github.com/NixOS/nixpkgs/issues/261217#issuecomment-1827940310 sound like they might stem from non-monotonic D-Bus serials. So maybe the issue I was having will be fixed by https://gitlab.gnome.org/GNOME/snapshot/-/merge_requests/194.
Has this issue been fixed yet in NixOS? If so, what caused this? I have the same error with snapshot on openSUSE Tumbleweed, GNOME 45. Thanks.
When using Snapshot from the gnome branch on my laptop, it does not display any camera output. I tried with ugly plugins as well:
And after turning on v4l2 loopback program (Droidcam):
Cheese does display camera output.
cc @bobby285271