ubports / ubuntu-touch

Ubuntu Touch's issue inbox is now migrated to GitLab.
https://gitlab.com/ubports/ubuntu-touch
1.28k stars 110 forks source link

No video displayed in other apps than browser and Video Player #1854

Open stekalb opened 2 years ago

stekalb commented 2 years ago

Steps to reproduce

Expected behavior

video playback also works for other apps

Actual behavior

video screen is green

Logfiles and additional information

media-hub.log Original issue: [https://gitlab.com/mardy/mitubo/-/issues/1#note_712386523]

stekalb commented 2 years ago

In the application log of mitubo:

Setting up surface with height:  368  width:  640
library "/system/lib/libstagefrighthw.so" not found

On teleports:

void AalMediaPlayerService::play()
Setting up surface with height:  368  width:  640
Actually calling m_hubPlayerSession->play()
[DD 2021-10-25 19:51:43.150577] [player_stub.cpp:192@operator()] PlaybackStatusChanged signal arrived via the bus (status: PlaybackStatus::playing)
[WW 2021-10-25 19:51:43.157613] [codec.h:148@decode_argument] Unknown metadata key "audio-codec" while decoding dbus message
[WW 2021-10-25 19:51:43.157868] [codec.h:148@decode_argument] Unknown metadata key "container-format" while decoding dbus message
[WW 2021-10-25 19:51:43.158079] [codec.h:148@decode_argument] Unknown metadata key "encoder" while decoding dbus message
[WW 2021-10-25 19:51:43.158198] [codec.h:148@decode_argument] Unknown metadata key "language-code" while decoding dbus message
[WW 2021-10-25 19:51:43.158303] [codec.h:148@decode_argument] Unknown metadata key "mpris:artUrl" while decoding dbus message
[WW 2021-10-25 19:51:43.158406] [codec.h:148@decode_argument] Unknown metadata key "mpris:length" while decoding dbus message
[WW 2021-10-25 19:51:43.158508] [codec.h:148@decode_argument] Unknown metadata key "mpris:trackid" while decoding dbus message
[WW 2021-10-25 19:51:43.158609] [codec.h:148@decode_argument] Unknown metadata key "video-codec" while decoding dbus message
[WW 2021-10-25 19:51:43.158714] [codec.h:148@decode_argument] Unknown metadata key "xesam:lastUsed" while decoding dbus message
[DD 2021-10-25 19:51:43.172727] [player_stub.cpp:192@operator()] PlaybackStatusChanged signal arrived via the bus (status: PlaybackStatus::playing)
[WW 2021-10-25 19:51:43.201742] [codec.h:148@decode_argument] Unknown metadata key "audio-codec" while decoding dbus message
[WW 2021-10-25 19:51:43.202224] [codec.h:148@decode_argument] Unknown metadata key "container-format" while decoding dbus message
[WW 2021-10-25 19:51:43.202460] [codec.h:148@decode_argument] Unknown metadata key "encoder" while decoding dbus message
[WW 2021-10-25 19:51:43.202549] [codec.h:148@decode_argument] Unknown metadata key "language-code" while decoding dbus message
[WW 2021-10-25 19:51:43.202606] [codec.h:148@decode_argument] Unknown metadata key "mpris:artUrl" while decoding dbus message
[WW 2021-10-25 19:51:43.202659] [codec.h:148@decode_argument] Unknown metadata key "mpris:length" while decoding dbus message
[WW 2021-10-25 19:51:43.202710] [codec.h:148@decode_argument] Unknown metadata key "mpris:trackid" while decoding dbus message
[WW 2021-10-25 19:51:43.202800] [codec.h:148@decode_argument] Unknown metadata key "video-codec" while decoding dbus message
PlaybackStatus changed to:  "playing"
PlaybackStatus changed to:  "playing"
library "/system/lib/libstagefrighthw.so" not found
qml: mediaviewer timer
virtual void AalMediaPlayerControl::stop() 
stekalb commented 2 years ago

However. In case the missing library message is relevant - the target path is wrong.

library "/system/lib/libstagefrighthw.so" not found

phablet@ubuntu-phablet:~/.cache/upstart$ sudo find / | grep libstagefrighthw.so
[sudo] password for phablet: 
/android/vendor/lib64/libstagefrighthw.so
/android/vendor/lib/libstagefrighthw.so

On Volla there are the following libs there:

phablet@ubuntu-phablet:/system/lib$ ll /system/lib/libstagefright*
-rw-r--r--. 1 root root  28912 Okt 24 06:13 /system/lib/libstagefright_codecbase.so
-rw-r--r--. 1 root root 142880 Okt 24 06:12 /system/lib/libstagefright_foundation.so
-rw-r--r--. 1 root root 289512 Okt 24 06:13 /system/lib/libstagefright_httplive.so
-rw-r--r--. 1 root root  28856 Okt 24 06:13 /system/lib/libstagefright_omx_utils.so
-rw-r--r--. 1 root root 991788 Okt 24 06:13 /system/lib/libstagefright.so
-rw-r--r--. 1 root root 208196 Okt 24 06:13 /system/lib/libstagefright_wfd.so
-rw-r--r--. 1 root root  58052 Okt 24 06:13 /system/lib/libstagefright_xmlparser.so

According to this link https://source.android.com/devices/media that might be the underlying issue

mardy commented 2 years ago

I've been looking at the media-hub logs from @stekalb (with GST_DEBUG=4, they are attached to the original issue) and comparing them with those from my Xiaomi Note 7. The only difference found is that in @stekalb logs it's creating an amcviddec-omxmtkvideodecoderavc element, whereas in mine it's amcviddec-omxqcomvideodecoderavc. But other than that the rest seems the same, apart from ordering (gstreamer is heavily threaded), and I didn't spot any error messages that were present only in @stekalb's logs.

As far as the client is concerned, indeed I do not see any warnings about libstagefrighthw.so on my phone, so that might actually be the key issue.

gbdomubpkm commented 2 years ago

No temporary solution to make the nice MiTubo work on the Volla ?

Flohack74 commented 2 years ago

I think the line about libstagefrighthw.so is just a warning, and is not relevant for the problem.

stefan-kalb commented 2 years ago

When usind MiTubo I also see this message im media-hub.log: libstagefright_codec.so not found ... Maybe a wrong lead. After closing mitubo, reopen it and try to play a video, the codec error does not reappear.

stefan-kalb commented 2 years ago

Maybe, the relevant error messages in media hub just appear once. After a reboot I opened a video

fredldotme commented 2 years ago

Maybe, the relevant error messages in media hub just appear once. After a reboot I opened a video

Does it work when you're on mobile data?

mardy commented 2 years ago

Maybe, the relevant error messages in media hub just appear once. After a reboot I opened a video

Hi Stefan! Can you please also try attaching the syslog? It might be able to shed some light. And one more thing that you can do is run the media-hub manually, with gstreamer logs enabled:

stop media-hub
GST_DEBUG=3 media-hub-server > media-hub-gst.log

Then start playing a video. I recommend doing this with the Teleports app, just to rule out any network interference.

Edit: I wonder if yggdrasil has some more (or just different) gstreamer codecs, and for some reason the wrong one gets picked up.

stefan-kalb commented 2 years ago

syslog.log media-hub-gst-console.log

with mitubo.

stefan-kalb commented 2 years ago

Does it work when you're on mobile data?

It doesn't matter. Happens on WiFi as well as on mobile data

stefan-kalb commented 2 years ago

And the same with teleports: syslog-tp.log media-hub-gst-console-tp.log

mardy commented 2 years ago

Thanks Stefan! So, I noticed that on my device (where video playback works) I also have the lines:

amcvideodec gstamcvideodechybris.c:2339:gst_amc_video_dec_set_context:<amcvideodec-omxqcomvideodecoderavc0> codec not set yet
library "libstagefright_ccodec.so" not found

and therefore we can exclude them from the problem. All other warnings are also in my log. The first difference in the logs is these two lines, that appear in your log and not in mine:

0:00:19.670132540  6634   0x760c026f70 ERROR            amcvideodec gstamcvideodechybris.c:929:gst_amc_color_format_info_set: Unsupported color format 842094201
0:00:19.670258540  6634   0x760c026f70 ERROR            amcvideodec gstamcvideodechybris.c:811:gst_amc_video_dec_set_src_caps:<amcvideodec-omxmtkvideodecoderavc0> Failed to set up GstAmcColorFormatInfo

Maybe @fredldotme who has more experience with hybris and video codecs can give us some suggestions to debug this further? What is the 842094201 color format?

fredldotme commented 2 years ago

According to our mir-hybris gst-plugins patch: COLOR_MTK_FormatYUVPrivate = 0x32315679

Oddly enough the color format in question should be mapped properly already: https://github.com/ubports/gst-plugins-bad-packaging/blob/xenial_-_android9/debian/patches/adding-mirsink-and-android-media-over-hybris-support.patch#L5387

Which means something here might be doing something wrong: https://github.com/ubports/gst-plugins-bad-packaging/blob/xenial_-_android9/debian/patches/adding-mirsink-and-android-media-over-hybris-support.patch#L7070

gbdomubpkm commented 2 years ago

MiTubo 0.7.0 on Volla always 'green lantern' alas !

gbdomubpkm commented 2 years ago

Just a user test i did with my Volla on RC 54 : MiTubo 1.2-0 and QtwebEngine v 5.15.10 : always green screen when playing a video.

gbdomubpkm commented 1 year ago

Does anyone know if MiTubo works on the Volla 22 ?