flathub / com.opera.Opera

https://flathub.org/apps/details/com.opera.Opera
4 stars 1 forks source link

Chromium proprietary codecs aren't working #28

Closed mwoz123 closed 4 months ago

mwoz123 commented 1 year ago

After recent update ( to ver 99.0.4788.47) it keeps on dispalying "Page crashed (..) Reload this page" on various pages.

e.g. on: https://www.youtube.com https://www.youtube.com/watch?v=RsELrcVNzG0

@Gaeldrin, @barthalion - could you help ? This happens on my 2 PCs with Ubuntu 22.04.

Gaeldrin commented 1 year ago

Confirmed, I have the same behaviour. For now I made a rollback to version 99.0.4788.31 so the users are not impacted, seems to work fine.

As for the issue, I don't see anything related in the Opera changelog. When executed from command line, I get this:

~/git/com.opera.Opera$ flatpak run --devel com.opera.Opera --private
  ...startup messages...
[0605/124031.306768:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Operation not permitted (1)

For me, that is it. At least for now, I have no idea how to proceed, quick search did not help and I must go. Do you have any idea @barthalion ? Any help is appreciated.

mwoz123 commented 1 year ago

Thanks but is there a chance that users (like me), who'd already installed this crashing version, will get upgrade/rollback to working one?

I'm unfamiliar with flatpak but maybe you could you add, to version id, a suffix (e.g. -1, -hotfix / -rollback whatever) to be caught by the flatpak upgrade system and to force not-crashing Opera version installation ?

Gaeldrin commented 1 year ago

@mwoz123 That should be the case, everyone should get working version. There is 3 hour waiting time that I cannot do anything about. I am not too familiar with flatpak myself so I could be wrong about that - if you can confirm successful downgrade automatically after few more hours, please let me know.

What is certain, you can downgrade at any time manually if you cannot wait: https://docs.flatpak.org/en/latest/tips-and-tricks.html#downgrading

mwoz123 commented 1 year ago

Thanks. I received version 99.0.4788.31.

Unfortunatelly (I'd restarted Opera but) still "Page crashed" on YT, Restarted PC but still "Page crashed".

image

I think it might have been version 99.0.4788.13 or even earlier, that was working fine

Gaeldrin commented 1 year ago

Well, I have a good news and a bad news.

Good news is, thanks to all this I have a much better idea about what the problem is. I'm very sure that the problem is with the Chromium codecs library added to Opera flatpak, and not Opera update itself. Meaning, the Opera can work well, just without the extra codecs.

Bad news is, I have no idea why the Chromium codecs suddenly stopped working. Can be that Flatpak changed something and now the Opera flatpak cannot access it, can be a version mismatch between the two, can be something else entirely. Until I figure out something more, I will disable the extra codecs to have at least some playback functionality.

barthalion commented 1 year ago

It probably only worked by a coincidence. Arch packages ffmpeg codecs for Opera separately, most likely to avoid these version mismatches: https://gitlab.archlinux.org/archlinux/packaging/packages/opera-ffmpeg-codecs/-/blob/main/PKGBUILD

mwoz123 commented 1 year ago

Guys are you sure it's codecs issue? we you able to find a working (youtube) verson ?

I remember I tested youtube when I first isntalled opera from flatpak (~3weeks ago) and it worked then. But now I'm not able to find a working version :(

Maybe something has changed in flatpak driver itself or configuration? I checked version and the results were:

| version | result | commit id | | 98.0.4759.39 | page crashed | 8486fefb74b0ae63bd79aff5f7c0cb8fb1d3d094487acee9482297a83c99171e | | 97.0.4719.63 | page crashed | a2ff3695e52d172e72fbd5a63bf259397d7035b78e3aad22c1cf35fbbed6d713 | | 96.0.4693.31 | page crashed | 03cc00319c825a52b3bdc65fda1fc0fb6802247aa4696a7a7b52bd80220fa0e2 | | 94.0.4606.38 |page crashed | d09a88f2353d322eb56a7685838e1d4c2d5ac936d4d881203c846fe97acf4638 |

comands used:

# get commit numbers
flatpak remote-info flathub --log com.opera.Opera
# downgrade flatpak command: 
 sudo flatpak update --commit=d09a88f2353d322eb56a7685838e1d4c2d5ac936d4d881203c846fe97acf4638 com.opera.Opera
mwoz123 commented 1 year ago

Arch packages ffmpeg codecs for Opera separately,

Opera snap also keeps codecs in separate snap package... I'd used it for couple months and never noticed not working video, which is something I cannot say about Opera.deb.

I'd upgraded to latest Opera flatpak (with #30) and YT seems to work, but no other videos :(

Some exmaples:

Gaeldrin commented 1 year ago

Guys are you sure it's codecs issue? we you able to find a working (youtube) verson ?

.. But now I'm not able to find a working version :(

Yes, I am sure, I verified it and you can too. The steps are to

  1. install Opera flatpak before I removed the Chromium codecs and then
  2. downgrade the codecs to compatible version as follows:
# downgrade Opera to 99.x.x.47 with codecs: 
 sudo flatpak update --commit=e3abd33637dc3dd51257118a03cc5df5234e2b2b7f9e4a6485563b404afb71c5 com.opera.Opera
# downgrade codecs to Chromium 113 (base of Opera 99): 
 sudo flatpak update --commit=41da9adab9385bfc3bfa80b95f23ac6ace85b46032b120aeeb87676fbd894cf7 org.chromium.Chromium.Codecs

As for how to fix this, I would like to ask @barthalion or anyone with knowledge about Flatpak for recommendation. I imagine there is a way to make the dependency install specific commit but that would mean manual change every time the Chromium base changes with all the drawbacks..

barthalion commented 1 year ago

As I said at https://github.com/flathub/com.opera.Opera/issues/28#issuecomment-1579586891, it should be packaged separately to ensure it's not bound to Chromium's version.

Gaeldrin commented 1 year ago

Thank you, I've read it but unfortunately I don't know how to do that.

I've come up with an automated way of getting the correct library (using ArchLinux package of all things :) ) but Flatpak build commands are not the correct place for my construct and I don't know of another way. And as I already spent some time working on a platform I am not familiar with and I don't want to spend an unknown amount of time more to learn it properly, I will just leave here a template in shell showing how the problem could be fixed. Maybe someone will complete it (I feel it is a fine 1st issue) or maybe I will come back to it in the future. But it will probably not happen too soon.

# 1. get latest Chromium version
codecversion=$(wget https://gitlab.archlinux.org/archlinux/packaging/packages/opera-ffmpeg-codecs/-/raw/main/PKGBUILD -q -O - | grep "pkgver=" | cut -f2 -d"=")
# 2. get matching libffmpeg.so
wget https://ftp5.gwdg.de/pub/linux/archlinux/extra/os/x86_64/opera-ffmpeg-codecs-${codecversion}-1-x86_64.pkg.tar.zst | tar --zstd -xf
# 3. move the library to opera/lib_extra/ or link it
# 4. clean the downloaded files if necessary
mwoz123 commented 1 year ago

I also can't help here :( @barthalion could you help?

mwoz123 commented 8 months ago

I was trying to workaround the issue. Found arch archive repo contains a lot of opera-ffmpeg.

Unfortunately copying (not exact the same but simliar version) libffmpeg.so to /var/lib/flatpak/app/com.opera.Opera/current/active/files/opera/lib_extra but still non-youtube videos didn't worked :(

So based on arch PKGBUILD file and Opera.yaml I tried to create Opera.ffmpeg flatpak build yaml: https://github.com/mwoz123/opera-ffmpeg-flatpak/blob/master/com.opera.Opera.ffmpeg.yaml

but as I never did C++ nor Flatpak coding I got stuck at:

$ flatpak-builder build com.opera.Opera.ffmpeg.yaml -v --force-clean
(...)
Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-llvmorg-18-init-9505-g10664813-1.tar.xz 
<urlopen error [Errno -3] Temporary failure in name resolution>
Failed to download prebuilt clang package clang-llvmorg-18-init-9505-g10664813-1.tar.xz
Use build.py if you want to build locally.
Exiting.
Gaeldrin commented 8 months ago

I was trying to workaround the issue. Found arch archive repo contains a lot of opera-ffmpeg.

Unfortunately copying (not exact the same but simliar version) libffmpeg.so to /var/lib/flatpak/app/com.opera.Opera/current/active/files/opera/lib_extra but still non-youtube videos didn't worked :(

Hello again. :)

It's weird that it doesn't work for you, just tested this and it works for me (using current Opera version: 106.0.4998.19). Got the version 120, unpacked and moved to /var/lib/flatpak/app/com.opera.Opera/current/active/files/opera/lib_extra/libffmpeg.so and now I have support for h.264 codec.

mwoz123 commented 8 months ago

Right I does work this way:) I'm on the same Opera version right now.

But not sure if it will work always? if we can simply use arch bundled codecs as it doesn't exactly match the chromium version we have? As I'm already upgraded I cannot confirm it was my mistake or just the mismatch of the minor/mid version chromium-ffmpeg and the opera-chromium...


I'd overlooked your comment, and I meantime I pushed forward work for https://github.com/mwoz123/opera-ffmpeg-flatpak/

As I never did flatpak/C++ build - right now the issue is flatpak-builder throws gn: command not found. I'm using buildsystem: simple, as it's used by Chromium and buildsystem: cmake-ninja throws Error: module: opera-ffmpeg: Can't find CMakeLists.txt

I'll probably leave the work in case we'd want to go back to it, as it should be more solid solution...

ShoutHouse commented 7 months ago

I am currently experiencing this issue, without the crash window. It is presenting itself as just a failure to play, or a message that says "no supported file to access." or similar.

Nobara 39 (Fedora) Kernel 6.7 KDE Plasma 5.27.10 kwin wayland Opera One: 107.0.5045.15

The fix listed above works. Placing the codec from my flatpak install of Vivaldi into the ~/lib_extra folder DOES fix the issue.

Previously, I was only able to play video at YouTube and nowhere else including Amazon, Twitch, and more.

Is the wrong ffmpeg.so file being provided? Currently the flatpak seems not to include the ~/lib_extra folder at all. Am I missing something or is that a possible oversight? Is it possible to have an option to set the main location that our OS places the ffmpeg.so file so that it can be maintained with the system update cycle?

Edit: NVM I think the issue is persisting. Occurs in the rpm as well.

nmondal commented 7 months ago

Crashing out. I replaced the libffmpeg.so with something else, it used to work, now it is crashing out pages.

Zorin 16.3
Opera One(version: 107.0.5045.15)
Chromium version:121.0.6167.140

No matching ffmpeg for the same version anywhere yet.

mwoz123 commented 6 months ago

Guys how about using Vivalidi's ffmpeg codecs: https://repo.herecura.eu/herecura/x86_64/ and archive versions: https://archive.archlinux.org/packages/v/vivaldi-ffmpeg-codecs/ ?

Tested on my:

Opera One(version: 107.0.5045.21)
Opera is up to date
Update stream:Stable
System:Freedesktop SDK 23.08 (Flatpak runtime) (x86_64; Unity)
Chromium version:121.0.6167.160

using vivaldi-snapshot-ffmpeg-codecs-122.0.6261.21-1-x86_64.pkg.tar.zst extacted libffmpeg.so.6.6 & copied as /var/lib/flatpak/app/com.opera.Opera/current/active/files/opera/lib_extra/libffmpeg.so

Seems to work: https://help.vivaldi.com/desktop/media/html5-proprietary-media-on-linux/ :)

ZariTen commented 5 months ago

@mwoz123 solution seems to work, so I created a script that automates that. If anyone wants it: https://gist.github.com/ZariTen/d16336785d4ee50e875c3b261d5cf488 . (Always remember to analyse shell scripts before executing them, they can be dangerous!)

Gaeldrin commented 4 months ago

Hello @mwoz123 , can you please share how did you get this information? Is this by any chance an output of some command?

Opera One(version: 107.0.5045.21)
Opera is up to date
Update stream:Stable
System:Freedesktop SDK 23.08 (Flatpak runtime) (x86_64; Unity)
Chromium version:121.0.6167.160
mwoz123 commented 4 months ago

It's from help/about from Opera url: opera://about/ in address bar

mwoz123 commented 4 months ago

It might be hard to automate picking it from there. But how about incorporating (modified) ZariTen's script to get latest codecs?

Gaeldrin commented 4 months ago

Let's see where this goes :)