Skip to content

Update the android native libraries#2865

Merged
peppy merged 5 commits into
ppy:masterfrom
miterosan:Update_android_native_libraries
Jun 4, 2020
Merged

Update the android native libraries#2865
peppy merged 5 commits into
ppy:masterfrom
miterosan:Update_android_native_libraries

Conversation

@miterosan
Copy link
Copy Markdown
Contributor

http://www.un4seen.com/forum/?topic=13225.0
https://github.com/tanersener/mobile-ffmpeg/releases/tag/v4.2.2.LTS

Please note that newer releases of mobile-ffmpeg require at least Android 7.0.

The version v4.2.2.LTS requires Android 4.1.

@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Sep 26, 2019

What does this PR do exactly? It's hard to tell by the description and impossible by the blobs in diff - did you change ffmpeg to the LTS version?

Is there a chance this will address #2864?

@miterosan
Copy link
Copy Markdown
Contributor Author

@bdach The libraries located in this repository are outdated. This PR will update them.

There is a really small chance that this PR fixes #2864.

Cannot test that, as I do not own a device that has armv8.

@peppy
Copy link
Copy Markdown
Member

peppy commented Sep 26, 2019

If we’re going to break support for <v7 we better be sure as hell the game can’t run on those systems anyway

@miterosan
Copy link
Copy Markdown
Contributor Author

@peppy this PR includes the version that still supports android 4.1.

The update that comes after this one has an higher android sdk requirement

@peppy
Copy link
Copy Markdown
Member

peppy commented Nov 26, 2019

This needs testing by someone at least a v8 android device handy

@miterosan
Copy link
Copy Markdown
Contributor Author

What is the status of this PR?

@smoogipoo
Copy link
Copy Markdown
Contributor

hasn't been tested yet

@peppy
Copy link
Copy Markdown
Member

peppy commented Jun 1, 2020

Would be great if some android users could volunteer to test these changes.

@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Jun 1, 2020

I think I have an armv8 device? Will queue this up.

@peppy
Copy link
Copy Markdown
Member

peppy commented Jun 1, 2020

v7 should still work too, i believe.

@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Jun 1, 2020

BASS seems to be working but this PR breaks video on my device.

2020-06-01 20:26:24 [verbose]: VideoDecoder faulted: System.DllNotFoundException: libavformat.so assembly:<unknown assembly> type:<unknown type> member:(null)
2020-06-01 20:26:24 [verbose]: at (wrapper managed-to-native) osu.Framework.Android.Graphics.Video.AndroidVideoDecoder.avformat_alloc_context()
2020-06-01 20:26:24 [verbose]: at osu.Framework.Graphics.Video.VideoDecoder.prepareDecoding () [0x00001] in <1bfbbbc9b39f41feaec6dc2753cf0ff8>:0
2020-06-01 20:26:24 [verbose]: at osu.Framework.Graphics.Video.VideoDecoder.StartDecoding () [0x00011] in <1bfbbbc9b39f41feaec6dc2753cf0ff8>:0

Not sure I'll be able to give more detail today but I'll try to look into it.

@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Jun 1, 2020

Thankfully logcat spared me from a lengthy investigation.

06-01 22:43:09.001 D/Mono    (28700): DllImport error loading library 'libavformat.so': 'dlopen failed: library "libcpufeatures.so" not found'.
06-01 22:43:09.001 W/Mono    (28700): DllImport unable to load library 'dlopen failed: library "libcpufeatures.so" not found'.

After looking at the links to the ffmpeg mobile releases above, it's become quite clear that the libraries were updated without their newly-required dependencies (ticks indicate things that have been updated in this PR, while crosses - .sos that are missing here):

image

Adding them back gets the video working again.

@miterosan: before I go in pushing those missing files in here, was there any particular reason why you omitted them? Or did you just update only the files that existed in the repository before?

@bdach bdach self-assigned this Jun 1, 2020
bdach added 2 commits June 2, 2020 19:49
MobileFFmpeg version used is 4.2.2 LTS, in the "full" variant:

    https://github.com/tanersener/mobile-ffmpeg/releases/tag/v4.2.2.LTS

As per the release notes, it should support Android 4.1 (API level 16)
or higher.
@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Jun 2, 2020

I've pushed in the missing libraries. Tested on an armv8 device, by running both framework visual tests and the game with a local framework checkout. Seems to do fine (although video visual tests in framework seem to be triggering the memory leak at #3519 - I'm getting crashes/hangs after Video too far out of sync log messages, both here and on master).

As per commit message, the libraries added here are the "full" variant.

Would be good to have this tested on armv7 and x86 (although I don't really know if there are x86 android devices out there other than emulators?)

@peppy
Copy link
Copy Markdown
Member

peppy commented Jun 3, 2020

In attempting to test on the armv8 device I have handy, the video test looks to crash, but on SSL issues rather than video playback. Is that something we've seen happen before? @bdach what's your build setup? Just wondering if something has regressed in newer xamarin versions or something..

@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Jun 3, 2020

Yeah, I think I might have gotten a little confused, it does seem like it could be ssl-related. Closest thing to an error logcat shows me is this:

06-03 05:58:39.081 D/Mono    (21838): DllImport attempting to load: 'libmono-btls-shared'.
06-03 05:58:39.084 D/Mono    (21838): DllImport error loading library './libmono-btls-shared': 'dlopen failed: library "./libmono-btls-shared" not found'.
06-03 05:58:39.090 D/Mono    (21838): DllImport loaded library './libmono-btls-shared.so'.
06-03 05:58:39.090 D/Mono    (21838): DllImport searching in: 'libmono-btls-shared' ('./libmono-btls-shared.so').
06-03 05:58:39.090 D/Mono    (21838): Searching for 'mono_btls_ssl_ctx_new'.
06-03 05:58:39.090 D/Mono    (21838): Probing 'mono_btls_ssl_ctx_new'.
06-03 05:58:39.091 D/Mono    (21838): Found as 'mono_btls_ssl_ctx_new'.

but judging by output it looks like it succeeded in the end...? Not sure.

I was building through rider in debug config. Didn't change anything in the build config as far as I can tell.

@bdach
Copy link
Copy Markdown
Collaborator

bdach commented Jun 3, 2020

As described on Discord something really bad is happening with the web request that fetches the video in the test scene on Android. I thought it was due to single-threaded mode, but it doesn't break that way on desktop. I guess I'll open an issue and document findings there...?

Not sure whether that should block this PR or not.

@peppy
Copy link
Copy Markdown
Member

peppy commented Jun 4, 2020

Ignoring the ssl / network issue I think this looks OK. I don't have an armv7 device to test against so let's deploy and let the users do the testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants