Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIXEL: ioctl err: 1 on non-emulated Pixel hardware #2121

Open
chjaeggi opened this issue Feb 19, 2024 · 18 comments
Open

PIXEL: ioctl err: 1 on non-emulated Pixel hardware #2121

chjaeggi opened this issue Feb 19, 2024 · 18 comments
Labels
android bug Something isn't working more info needed Further information is requested

Comments

@chjaeggi
Copy link

chjaeggi commented Feb 19, 2024

Describe the bug
I am referring to the discussion in here:
#1998
There seems to be a bug especially when dragging around in a map (or when re-drawing it thereby). It gets worse the more frequent the redrawing happens (for instance with an animated location indicator), the phone gets really hot (because of those I/O errors)

To Reproduce
I included a minimal sample in the discussion afformentioned. Here again for summary:

class MainActivity : ComponentActivity() {

    private fun setUpMapLibre(okHttpClient: OkHttpClient) {
        Mapbox.getInstance(this, null, WellKnownTileServer.MapLibre)
        HttpRequestUtil.setOkHttpClient(okHttpClient)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        val okHttpClient = OkHttpClient.Builder().build()
        setUpMapLibre(okHttpClient)

        super.onCreate(savedInstanceState)
        setContent {
            MaterialTheme {
                Surface(
                    modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background
                ) {
                    val context = LocalContext.current
                    val mapView = MapView(context).apply {
                        getMapAsync { map ->
                            map.apply {
                                setStyle("https://raw.githubusercontent.com/maplibre/demotiles/gh-pages/styles/osm-bright-gl-style/style.json") {
                                    LocationComponentActivationOptions.builder(context, it).build()
                                }
                            }
                        }
                    }
                    AndroidView(factory = { mapView })
                }
            }
        }
    }
}

Expected behavior
No PIXEL: ioctl err: 1 output

Screenshots

Platform information (please complete the following information):

  • Android all versions (tested from API level 28)
  • Maplibre android-sdk:10.2.0

Additional context
See discussion thread

@chjaeggi chjaeggi added the bug Something isn't working label Feb 19, 2024
@louwers
Copy link
Collaborator

louwers commented Feb 20, 2024

I cannot reproduce the problem, but this style is also known to be malfunctioning. Try with another tile source please.

@louwers louwers added the more info needed Further information is requested label Feb 20, 2024
@chjaeggi
Copy link
Author

Did you use a real pixel device? Not an emulated one?
Me and my colleagues can reproduce it independent of a particular style on these phones.

There are other styles causing this issue even more like this:
https://demotiles.maplibre.org/styles/osm-bright-gl-terrain/style.json

and not so frequent but still explorable especially when pinch to zoom closely:
https://demotiles.maplibre.org/style.json

please note those are styles provided in your demo application.

How should we proceed, please advise,

Cheers
C

@louwers
Copy link
Collaborator

louwers commented Feb 20, 2024

I tested on a Samsung S10 and a Google Pixel 7.

What version of OkHttp are you using?

Does the error occur if you don't set the HTTP client?

@chjaeggi
Copy link
Author

chjaeggi commented Feb 20, 2024

The one mentioned in the discussion, let's see:

implementation("com.squareup.okhttp3:okhttp:4.11.0")

Without the client I am not able to fetch the style, am I?

@louwers
Copy link
Collaborator

louwers commented Feb 20, 2024

@chjaeggi It is not needed, it will fall back to the default ok http client (it is a dependency).

Edit: The 10.2.0 release used OkHttp 4.10.0, so it should be compatible. But you might want to try removing it.

@chjaeggi
Copy link
Author

I removed everything related to OKHttp, it really seems an issue with your code accessing disk (as the device is getting hot after a time, not sure about that as I/O could relate to network communication)

@louwers
Copy link
Collaborator

louwers commented Feb 20, 2024

Can you provide more output?

Does it happen on other phones too?

What Android version are you using?

We do benchmarking and Android UI tests on Pixel devices and we have not encountered this issue.

@chjaeggi
Copy link
Author

At the moment all I have is this:

2024-02-20 16:45:20.705 15143-15375 recomposesample         ch.exmple.mapslibrecomposesample     E  PIXEL: ioctl err: 1
2024-02-20 16:45:20.715 15143-15375 recomposesample         ch.exmple.mapslibrecomposesample     E  PIXEL: ioctl err: 1
2024-02-20 16:45:20.732 15143-15375 recomposesample         ch.exmple.mapslibrecomposesample     E  PIXEL: ioctl err: 1
2024-02-20 16:45:20.749 15143-15375 recomposesample         ch.exmple.mapslibrecomposesample     E  PIXEL: ioctl err: 1
2024-02-20 16:45:20.764 15143-15375 recomposesample         ch.exmple.mapslibrecomposesample     E  PIXEL: ioctl err: 1
2024-02-20 16:45:20.784 15143-15375 recomposesample         ch.exmple.mapslibrecomposesample     E  PIXEL: ioctl err: 1
2024-02-20 16:45:20.799 15143-15375 recomposesample         ch.exmple.mapslibrecomposesample     E  PIXEL: ioctl err: 1

... errors counting heavily up

There is not more output besides that line unfortunately.

Other phones yes: each pixel we tested so far (Pixel 8 Pro, Pixel Foldable, Pixel 5 and Pixel 4)
Version Android 13 and 14.

@louwers
Copy link
Collaborator

louwers commented Feb 20, 2024

One last thing you could try is to use an AppCompatActivity instead of a ComponentActivity, since that is what is used for all our testing.

@chjaeggi
Copy link
Author

hey there thanks for the support! Unfortunately no success either with an AppCompatActivity and
theme <style name="Theme.MapsLibreComposeSample" parent="Theme.AppCompat.NoActionBar" />.

Same error still.

It really is strange that you cannot observe these events on none of your pixel phones

@chjaeggi
Copy link
Author

I assume while looking at the code those errors can only originate from the:
MapboxGLSurfaceView class which does the heavy lifting and also the error occurs when wandering around the map

@chjaeggi
Copy link
Author

chjaeggi commented Mar 8, 2024

any updates?

@louwers
Copy link
Collaborator

louwers commented Mar 8, 2024

@chjaeggi Can you try this? I just built it myself and ran it on a clean Pixel 8 Pro (no error). https://drive.google.com/file/d/1FVM4ypLjiRaVxE4jUJuwJRhIj6v_-MKx/view?usp=sharing

If it works there is something wrong with your build setup. If it doesn't work there is probably something wrong with your devices...

@louwers louwers closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
@louwers louwers reopened this Mar 8, 2024
@louwers
Copy link
Collaborator

louwers commented Mar 8, 2024

animated location indicator

This might be what is making the phone hot. I'll merge this today and release a new pre-release, maybe you could see if that fixes it. #2182

@chjaeggi
Copy link
Author

What release number would that be? Is it merged already? Thanks for the help

@louwers
Copy link
Collaborator

louwers commented Mar 11, 2024

Thhat is a build from main, so the upcoming 11.0.0 release.

@chjaeggi
Copy link
Author

sorry for the hassle i generate. any update when this will be released? I have a hard time to debug with all thoses errors and I would love to test the new release. Is there a way I can locally build one myself?

@louwers
Copy link
Collaborator

louwers commented Mar 12, 2024

@chjaeggi No problem. The 11.0.0 release is scheduled for the end of this month.

You can build the library with ./gradlew assemble in platform/android. Make sure to clone the submodules. https://github.com/maplibre/maplibre-native/blob/main/platform/android/DEVELOPING.md#getting-the-source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working more info needed Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants