Video playback randomly fails ("If playback doesn't begin shortly, try restarting your device")

So this is an issue that has been bothering me ever since I installed Fedora 41 (KDE Plasma Desktop) on my gaming rig. I have attempted to look around online for a solution but I have been unable to find any concrete answer, all I could find was this thread which didn’t mark any of the replies as an answer: If playback doesn't begin shortly ,try restarting your device

To summarize the issue, the issue is that after booting into Fedora, video playback on web browsers will not work. On YouTube for instance the video gets stuck loading for a couple of seconds until the “If playback doesn’t begin shortly, try restarting your device” message shows up. This affects both Firefox and Chrome so it seems to be a system-wide issue. I have noticed that the issue goes away after one or more reboots. It could be that it begins to work after installing Fedora system updates (?), but I am not entirely sure. This has happened 4 to 5 times to me so far. I would hope that there is a permanent fix for this so I don’t have to enforce system reboots/updates after each boot whenever I want to watch some YouTube videos…?

Any help is greatly appreciated! This is the only annoyance that I got that makes me want to switch back into Windows 11, and I’d rather not do that. Fedora 41 works great other than this caveat.

System specs:

Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.13.7-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor
Memory: 31,3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3090/PCIe/SSE2
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7C84
System Version: 1.0

Nvidia drivers are installed (570.133.07)
Secure Boot is enabled.

Can you give us info about what you changed on your system since install?

I assume proprietary NVIDIA drivers, so adding rpmfusion. This probably disabled nouveau drivers, the opensource ones.

Did you install ffmpeg or libavcodec-freeworld?

ffmpeg-free 7.1.1 is pre-installed, and I installed the proprietary Nvidia drivers from negativo17.org. These packages are installed:

nvidia-driver
nvidia-driver-cuda
nvidia-driver-cuda-libs
nvidia-driver-libs
nvidia-driver-libs
nvidia-kmod-common
nvidia-libXNVCtrl
nvidia-modprobe
nvidia-persistenced
nvidia-settings

Those packages from negativo seem to frequently have problems on fedora.

Try removing all those. (The negativo packages also enable the modular nvidia-driver and fedora quit using modular packages several releases back).
After disabling the module sudo dnf module disable nvidia-driver reinstall the drivers from rpmfusion sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda.
As long as you have the rpmfusion-nonfree-nvidia-drivers repo enabled and the negativo repo disabled it should just work.

To show us exactly what may be installed that is nvidia related please run
dnf list --installed \*nvidia\* and post the output as preformatted text using the </> button on the toolbar of the text input window.

Finally, some information… ffmpeg-free misses codecs, and the negativo repo might cause issues too

I was unaware of negativo’s repo causing issues, but that could explain things. The only reason that I opted to use negativo instead of rpmfusion was because it added a newer driver quicker that I was interested in.

user@fedora:~$ dnf list --installed \*nvidia\*
Installed packages
akmod-nvidia.x86_64                       3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.13.8-200.fc41.x86_64.x86_64 3:570.133.07-1.fc41 @commandline
nvidia-modprobe.x86_64                    3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
nvidia-persistenced.x86_64                3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                    3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64           3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.i686        3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64      3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64        3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.i686             3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64           3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64          3:570.133.07-1.fc41 rpmfusion-nonfree-nvidia-driver

After a fresh reboot with the drivers from rpmfusion, the video playback issue seems to remain on both Firefox and Chrome.

I have swapped ffmpeg-free with ffmpeg now.

user@fedora:~$ sudo dnf swap ffmpeg-free ffmpeg --allowerasing
Updating and loading repositories:
 RPM Fusion for Fedora 41 - Nonfree - Updates                                 100% |  44.7 KiB/s |  33.2 KiB |  00m01s
 RPM Fusion for Fedora 41 - Free                                              100% | 158.3 KiB/s | 158.7 KiB |  00m01s
 RPM Fusion for Fedora 41 - Free - Updates                                    100% | 103.7 KiB/s |  67.7 KiB |  00m01s
 RPM Fusion for Fedora 41 - Nonfree                                           100% |  76.1 KiB/s |  91.3 KiB |  00m01s
Repositories loaded.
Package                             Arch     Version                              Repository                      Size
Removing:
 ffmpeg-free                        x86_64   7.1.1-1.fc41                         updates                      2.5 MiB
Removing dependent packages:
 libavcodec-free                    x86_64   7.1.1-1.fc41                         <unknown>                    9.6 MiB
 libavdevice-free                   x86_64   7.1.1-1.fc41                         <unknown>                  215.2 KiB
 libavfilter-free                   x86_64   7.1.1-1.fc41                         <unknown>                    4.1 MiB
 libavformat-free                   x86_64   7.1.1-1.fc41                         <unknown>                    2.6 MiB
 libavutil-free                     x86_64   7.1.1-1.fc41                         <unknown>                  971.0 KiB
 libpostproc-free                   x86_64   7.1.1-1.fc41                         <unknown>                   89.7 KiB
 libswresample-free                 x86_64   7.1.1-1.fc41                         <unknown>                  147.4 KiB
 libswscale-free                    x86_64   7.1.1-1.fc41                         <unknown>                  619.5 KiB
Installing:
 ffmpeg                             x86_64   7.1.1-3.fc41                         rpmfusion-free-updates       2.5 MiB
Installing dependencies:
 ffmpeg-libs                        x86_64   7.1.1-3.fc41                         rpmfusion-free-updates      21.3 MiB
 libavdevice                        x86_64   7.1.1-3.fc41                         rpmfusion-free-updates     162.1 KiB
 x264-libs                          x86_64   0.164-15.20231001git31e19f92.fc41    rpmfusion-free               2.8 MiB
 x265-libs                          x86_64   3.6-3.fc41                           rpmfusion-free              16.4 MiB
Installing weak dependencies:
 vmaf-models                        noarch   3.0.0-2.fc41                         fedora                       4.9 MiB

Transaction Summary:
 Installing:         6 packages
 Removing:           9 packages

Total size of inbound packages is 13 MiB. Need to download 13 MiB.
After this operation, 27 MiB extra will be used (install 48 MiB, remove 21 MiB).
Is this ok [y/N]: y
[1/6] x264-libs-0:0.164-15.20231001git31e19f92.fc41.x86_64                    100% |   1.7 MiB/s | 702.4 KiB |  00m00s
[2/6] x265-libs-0:3.6-3.fc41.x86_64                                           100% |  10.0 MiB/s |   1.3 MiB |  00m00s
[3/6] libavdevice-0:7.1.1-3.fc41.x86_64                                       100% | 183.5 KiB/s |  71.7 KiB |  00m00s
[4/6] ffmpeg-0:7.1.1-3.fc41.x86_64                                            100% |   1.7 MiB/s |   1.9 MiB |  00m01s
[5/6] ffmpeg-libs-0:7.1.1-3.fc41.x86_64                                       100% |   7.2 MiB/s |   8.4 MiB |  00m01s
[6/6] vmaf-models-0:3.0.0-2.fc41.noarch                                       100% |   1.0 MiB/s | 260.1 KiB |  00m00s
----------------------------------------------------------------------------------------------------------------------
[6/6] Total                                                                   100% |   5.4 MiB/s |  12.7 MiB |  00m02s
Running transaction
Importing OpenPGP key 0xD651FF2E:
 UserID     : "RPM Fusion free repository for Fedora (2020) <rpmfusion-buildsys@lists.rpmfusion.org>"
 Fingerprint: E9A491A3DE247814E7E067EAE06F8ECDD651FF2E
 From       : file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-41
Is this ok [y/N]: y
The key was successfully imported.
[ 1/17] Verify package files                                                  100% | 150.0   B/s |   6.0   B |  00m00s
[ 2/17] Prepare transaction                                                   100% |  36.0   B/s |  15.0   B |  00m00s
[ 3/17] Installing x265-libs-0:3.6-3.fc41.x86_64                              100% | 364.7 MiB/s |  16.4 MiB |  00m00s
[ 4/17] Installing x264-libs-0:0.164-15.20231001git31e19f92.fc41.x86_64       100% | 212.9 MiB/s |   2.8 MiB |  00m00s
[ 5/17] Installing ffmpeg-libs-0:7.1.1-3.fc41.x86_64                          100% | 233.7 MiB/s |  21.3 MiB |  00m00s
[ 6/17] Installing libavdevice-0:7.1.1-3.fc41.x86_64                          100% |  22.7 MiB/s | 162.9 KiB |  00m00s
[ 7/17] Installing ffmpeg-0:7.1.1-3.fc41.x86_64                               100% | 113.9 MiB/s |   2.5 MiB |  00m00s
[ 8/17] Installing vmaf-models-0:3.0.0-2.fc41.noarch                          100% |  60.4 MiB/s |   4.9 MiB |  00m00s
[ 9/17] Removing ffmpeg-free-0:7.1.1-1.fc41.x86_64                            100% |  11.4 KiB/s |  35.0   B |  00m00s
[10/17] Removing libavdevice-free-0:7.1.1-1.fc41.x86_64                       100% |   2.6 KiB/s |   8.0   B |  00m00s
[11/17] Removing libavfilter-free-0:7.1.1-1.fc41.x86_64                       100% |   2.0 KiB/s |   8.0   B |  00m00s
[12/17] Removing libavformat-free-0:7.1.1-1.fc41.x86_64                       100% |   2.0 KiB/s |   8.0   B |  00m00s
[13/17] Removing libavcodec-free-0:7.1.1-1.fc41.x86_64                        100% |   2.0 KiB/s |   8.0   B |  00m00s
[14/17] Removing libswresample-free-0:7.1.1-1.fc41.x86_64                     100% |   3.9 KiB/s |   8.0   B |  00m00s
[15/17] Removing libpostproc-free-0:7.1.1-1.fc41.x86_64                       100% |   2.6 KiB/s |   8.0   B |  00m00s
[16/17] Removing libswscale-free-0:7.1.1-1.fc41.x86_64                        100% |   2.6 KiB/s |   8.0   B |  00m00s
[17/17] Removing libavutil-free-0:7.1.1-1.fc41.x86_64                         100% |  13.0   B/s |   8.0   B |  00m01s
Complete!

I’m unable to confirm if this fixed the issue as reboots have shown to fix it seemingly at random, but I will try rebooting 10 times or so to see if I can replicate the error.

The issue happened again, this time after I was away from keyboard vacuum cleaning which got me kicked to the login screen. After going back to YouTube all videos show the same error message and refuse to play, so ffmpeg and rpmfusion repo do not appear to have fixed it.

Edit: Booting up a game and realizing that my audio wasn’t working for my headphones, I played around with the audio settings (switching audio device back and forth) and then suddenly the YouTube tabs that I had open began playing videos. I don’t know what’s making it this unstable.

Newer drivers sooner is not necessarily better. Rpmfusion fully tests drivers for use with fedora before releasing them, and AFAIK negativo does not do so.