Gnome screen recorder doesn't work on dist-upgraded jammy systems

Bug #1963264 reported by Jakub Klos
78
This bug affects 12 people
Affects Status Importance Assigned to Milestone
GNOME Shell
Fix Released
Unknown
gnome-shell (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

When I press Ctrl+Shift+Alt+R, screencast indicator appears in the indicator menu but disappears in about 2 seconds. No file is even created under the Videos folder.

journalctl shows:

Mar 02 09:10:29 Development dbus-daemon[2962]: [session uid=1000 pid=2962] Activating service name='org.gnome.Shell.Screencast' requested by ':1.62' (uid=1000 pid=3311 comm="/usr/libexec/gsd-media->
Mar 02 09:10:29 Development dbus-daemon[2962]: [session uid=1000 pid=2962] Successfully activated service 'org.gnome.Shell.Screencast'
Mar 02 09:10:31 Development dbus-daemon[2962]: [session uid=1000 pid=2962] Activating service name='org.gnome.Shell.Screencast' requested by ':1.62' (uid=1000 pid=3311 comm="/usr/libexec/gsd-media->
Mar 02 09:10:31 Development dbus-daemon[2962]: [session uid=1000 pid=2962] Successfully activated service 'org.gnome.Shell.Screencast'
Mar 02 09:10:32 Development gjs[5825]: JS LOG: Failed to create pipeline: Gst.ParseError: no element "pipewiresrc"

The issue is the Gst.ParseError.

Before upgrading to jammy (22.04), it used to work fine. Also, when testing under qemu/KVM it works properly. It just doesn't work when running directly on the PC.

What other logs can I provide?

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: gnome-shell 41.3-1ubuntu1
ProcVersionSignature: Ubuntu 5.15.0-18.18-generic 5.15.12
Uname: Linux 5.15.0-18-generic x86_64
ApportVersion: 2.20.11-0ubuntu78
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Thu Mar 3 15:41:44 2022
DisplayManager: gdm3
InstallationDate: Installed on 2020-05-12 (660 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
RelatedPackageVersions: mutter-common 41.3-3ubuntu1
SourcePackage: gnome-shell
UpgradeStatus: Upgraded to jammy on 2022-02-27 (4 days ago)

Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :
summary: - Screencast not working (stops in 2 seconds)
+ Screencast not recording
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Screencast not recording

I'm not sure we should investigate this at all until at least 42 is released.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Do you have gstreamer1.0-pipewire installed?

Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :

Yes, I do. Like I said, it works on my VM (almost the same installation) but not on the host. I am thinking about trying to build some older pipewire version just for testing.

Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :

I have found this little python script which also suffers from the same issue.

When run as
GST_DEBUG=3 python gnome-screen-cast.py

I get the following output:

session path: /org/gnome/Mutter/ScreenCast/Session/u16
stream path: /org/gnome/Mutter/ScreenCast/Stream/u16
added
0:00:00.019493755 132581 0xecbd30 WARN GST_ELEMENT_FACTORY gstelementfactory.c:701:gst_element_factory_make_with_properties: no such element factory "pipewiresrc"!
0:00:00.019526231 132581 0xecbd30 ERROR GST_PIPELINE gst/parse/grammar.y:851:priv_gst_parse_yyparse: no element "pipewiresrc"
0:00:00.020452889 132581 0xecbd30 ERROR GST_PIPELINE gst/parse/grammar.y:939:priv_gst_parse_yyparse: link has no source [sink=@0xf28d50]
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 232, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/home/jakub/Downloads/gnome-screen-cast.py", line 82, in on_pipewire_stream_added
    pipeline = Gst.parse_launch('pipewiresrc path=%u ! %s videoconvert ! glimagesink'%(node_id, format_element))
gi.repository.GLib.GError: gst_parse_error: no element "pipewiresrc" (1)

Still complains about some missing element

Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :

Similarly this does not work
gst-launch-1.0 pipewiresrc
ERROR: pipeline could not be constructed: no element "pipewiresrc"
but it works on the VM

Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :

But you are right
gst-inspect-1.0 pipewiresrc
No such element or plugin 'pipewiresrc'

something is odd with my installation. I tried reinstalling the gstreamer1.0-pipewire but still the same. Will try think of something

Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :

I got a bit further. gstreamer1.0-pipewire was installed but for some reason gstreamer did not pick it up. Even after reinstalling, it still was not listed as a gstreamer plugin. I had to physically remove the libgstpipewire so, restart streamer and then put it back. After that gstreamder picks the plugin and this error "no element pipewiresrc" occurs no more.

However, recording still does not work properly
The recording indicator appears, the file appears as well but has no content (0 size).

journalctl log
Mar 04 10:42:08 Development dbus-daemon[2781]: [session uid=1000 pid=2781] Activating service name='org.gnome.Shell.Screencast' requested by ':1.64' (uid=1000 pid=3358 comm="/usr/libexec/gsd-media-keys " label="unconfine>
Mar 04 10:42:08 Development dbus-daemon[2781]: [session uid=1000 pid=2781] Successfully activated service 'org.gnome.Shell.Screencast'
Mar 04 10:42:36 Development dbus-daemon[2781]: [session uid=1000 pid=2781] Activating service name='org.gnome.Shell.Screencast' requested by ':1.64' (uid=1000 pid=3358 comm="/usr/libexec/gsd-media-keys " label="unconfine>
Mar 04 10:42:36 Development dbus-daemon[2781]: [session uid=1000 pid=2781] Successfully activated service 'org.gnome.Shell.Screencast'
Mar 04 10:42:38 Development dbus-daemon[2781]: [session uid=1000 pid=2781] Activating via systemd: service name='org.freedesktop.Tracker3.Miner.Extract' unit='tracker-extract-3.service' requested by ':1.4' (uid=1000 pid=>
Mar 04 10:42:38 Development systemd[2764]: Starting Tracker metadata extractor...
Mar 04 10:42:38 Development dbus-daemon[2781]: [session uid=1000 pid=2781] Successfully activated service 'org.freedesktop.Tracker3.Miner.Extract'
Mar 04 10:42:38 Development systemd[2764]: Started Tracker metadata extractor.

I cannot even stop the recording. It is stuck.

Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :

Turned out that these 2 packages were missing in my host and are required for proper functionality:
pipewire-media-session libpipewire-0.3-common
After adding these and rebooting everything works finally!
Please, close this ticket

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Curious. You should have received those packages already since they're required by gnome-remote-desktop, which is recommended by ubuntu-desktop and gnome-shell. Maybe this was an Ubuntu "minimal" installation, or maybe it's a problem with upgrades?

Changed in gnome-shell (Ubuntu):
status: New → Invalid
Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :

Exactly, I wonder as well.
It worked fine in 20.04 and then after the upgrade it stopped working. The truth is that during the upgrade process something went wrong and I had to reboot. Then I continued the upgrade process again but who knows how things work in such scenario. On the VM guest it worked properly so it must have been the interrupted upgrade I guess.

Revision history for this message
Joe Barnett (thejoe) wrote :

I had pipewire-media-session libpipewire-0.3-common installed fine after an upgrade from impish->jammy, but still had to remove the libgstpipewire so, and reinstall the package to get gstreamer to recognize the pipewiresrc element

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Reopened because comment #10 didn't fix anything and we are receiving duplicate bug reports.

summary: - Screencast not recording
+ Gnome screen recorder doesn't work on dist-upgraded jammy systems\
summary: - Gnome screen recorder doesn't work on dist-upgraded jammy systems\
+ Gnome screen recorder doesn't work on dist-upgraded jammy systems
Changed in gnome-shell (Ubuntu):
status: Invalid → Confirmed
importance: Undecided → Medium
tags: added: regression-release rls-jj-incoming
Changed in gnome-shell (Ubuntu):
importance: Medium → Low
tags: removed: rls-jj-incoming
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Note that we will need to figure out a workaround before a fix can be created. So if anyone can figure out what package or configuration is missing in upgrades then it will save us time.

Revision history for this message
Ionut Negru (blackjohnny) wrote :

Hi,

I have encountered the same issue after upgrading to Ubuntu 22.04.

For me the fix was to reinstall the `gstreamer1.0-pipewire` package.

`sudo apt reinstall gstreamer1.0-pipewire`

Regards

Revision history for this message
Fateme Tamehri (fatemetmhr) wrote :

I still have this problem... And I tried whatever was said in comments here.
what I found by journalctl:

Apr 29 14:45:27 blacklighter dbus-daemon[2158]: [session uid=1000 pid=2158] Successfully activated service 'org.gnome.Shell.Screencast'
Apr 29 14:45:27 blacklighter gjs[3471]: JS LOG: Failed to create pipeline: Gst.ParseError: no element "pipewiresrc"
Apr 29 14:45:27 blacklighter gnome-shell[2406]: Error starting screencast
Apr 29 14:45:27 blacklighter snap-store[2694]: automatically prevented from changing kind on system/snap/*/runtime/io.snapcraft.core18-CSO04Jhav2yK0uz97cr0ipQRyqg0qQL6/latest/stable from runtime to unknown!
Apr 29 14:45:28 blacklighter gnome-shell[2406]: D-Bus client with active sessions vanished
Apr 29 14:45:29 blacklighter systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Apr 29 14:45:29 blacklighter systemd[1]: systemd-localed.service: Deactivated successfully.
Apr 29 14:45:33 blacklighter dbus-daemon[2158]: [session uid=1000 pid=2158] Activating service name='org.gnome.Shell.Screencast' requested by ':1.43' (uid=1000 pid=2406 comm="/usr/bin/gnome-shell " label="unconfined")
Apr 29 14:45:33 blacklighter dbus-daemon[2158]: [session uid=1000 pid=2158] Successfully activated service 'org.gnome.Shell.Screencast'
Apr 29 14:45:33 blacklighter gjs[3512]: JS LOG: Failed to create pipeline: Gst.ParseError: no element "pipewiresrc"
Apr 29 14:45:33 blacklighter gnome-shell[2406]: Error starting screencast
Apr 29 14:45:35 blacklighter gnome-shell[2406]: D-Bus client with active sessions vanished
Apr 29 14:45:36 blacklighter zeitgeist-datah[3399]: zeitgeist-datahub.vala:210: Error during inserting events: GDBus.Error:org.gnome.zeitgeist.EngineError.InvalidArgument: Incomplete event: interpretation, manifestation and actor are required

Revision history for this message
lemurchik (lemurchik) wrote :
Revision history for this message
rizitis (elahistos) wrote :

this bug dont have only one reason...
one more reason for the same bug is when geoclue2 version is not the one that xdg-desktop-portal version want...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks lemurchik, I guess we need more people to try:

  cd ~/.cache
  rm -rf gstreamer-1.0

Revision history for this message
Bojan Bunic (buneech) wrote (last edit ):

Removing the ~/.cache/gstreamer-1.0/ folder worked for me. Upgraded from impish to jammy.
pipewiresrc appeared in the output by gst-inspect-1.0 after removing the cache.

Changed in gnome-shell:
status: Unknown → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

That's tricky. I'm not sure removing files from users' home directories is something we can do in a package update.

Ideally we would instead find the bug in the offending gstreamer/whatever package and fix the source code. Without any idea what package is even causing the bug we may not be able to ever get a fix.

Revision history for this message
Stan Angeloff (stanangeloff) wrote (last edit ):

Removing ~/.cache/gstreamer-1.0/ worked for me, too.
I upgraded from ‘focal’ to ‘jammy’.
Following Bojan's suggestion, ‘pipewiresrc’ appeared
in the output of ‘gst-inspect-1.0’ after the purge.

Revision history for this message
Shuai (regisdu) wrote :

All of the above solutions are not working for me...
I searched somewhere else, it suggested me to try the command "pipewire", which returns that I didn't set the variable XDG_RUNTIME_DIR.
After I set it to a folder, and have pipewire running (which is not autostarted). The screen recorder works well.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.