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

BufferQueue has no connected producer #763

Open
moodstubos opened this issue Nov 15, 2021 · 16 comments
Open

BufferQueue has no connected producer #763

moodstubos opened this issue Nov 15, 2021 · 16 comments
Labels

Comments

@moodstubos
Copy link

running example app I get this after orientation change:

E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer(19273): [SurfaceTexture-0-19273-22](id:4b4900000025,api:0,p:-1,c:19273) dequeueBuffer: BufferQueue has no connected producer

map disappears. Just white container.

After some more changes of orientation map comes back visible.

This happens on Google Pixel 6

[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.22000.318], locale de-DE)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.5)
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.62.1)
[√] Connected device (4 available)

• No issues found!
@moodstubos
Copy link
Author

I tried to use Hybrid composition as descripted here: https://flutter.dev/docs/development/platform-integration/platform-views

This works very well, map keeps visible after orientation change.
BUT: docs say that < Android 10 this method results in bad performance (have not tested this). Therefore you could maybe use this only in newer Android versions and prior Android 10 use the current AndroidView solution. Just an idea.

Test code (android only!):

 @override
  Widget buildView(Map<String, dynamic> creationParams, OnPlatformViewCreatedCallback onPlatformViewCreated, Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers) {
    return PlatformViewLink(
      viewType: "plugins.flutter.io/mapbox_gl",
      surfaceFactory: (BuildContext context, PlatformViewController controller) {
        return AndroidViewSurface(
          controller: controller as AndroidViewController,
          gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
          hitTestBehavior: PlatformViewHitTestBehavior.opaque,
        );
      },
      onCreatePlatformView: (PlatformViewCreationParams params) {
        return PlatformViewsService.initSurfaceAndroidView(
          id: params.id,
          viewType: "plugins.flutter.io/mapbox_gl",
          layoutDirection: TextDirection.ltr,
          creationParams: creationParams,
          creationParamsCodec: StandardMessageCodec(),
          onFocus: () {
            params.onFocusChanged(true);
          },
        )
          ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)
          ..create();
      },
    );
}

@stale
Copy link

stale bot commented Jan 14, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 14, 2022
@stale stale bot closed this as completed Jan 21, 2022
@skreborn
Copy link

@tobrun We're also experiencing this issue - could it possibly be reopened?

@ryanjohndias
Copy link

Also experiencing this issue...

@felix-ht
Copy link
Collaborator

should be fixed by #916

@felix-ht felix-ht reopened this Feb 24, 2022
@stale stale bot removed the stale label Feb 24, 2022
@stale
Copy link

stale bot commented Apr 25, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 25, 2022
@skreborn
Copy link

@felix-ht Should this be kept open since #916 was reverted and thus the issue isn't really solved (on default configuration at least)?

@stale stale bot removed the stale label Apr 26, 2022
@devmobile-vulog
Copy link

Could we have a status on this ? Or a quick fix maybe ? Our clients are experiencing this issue. Thanks

@felix-ht
Copy link
Collaborator

felix-ht commented May 4, 2022

you can try testing with flutter 2.13 beta as well as turning on hybrid composition

@devmobile-vulog
Copy link

devmobile-vulog commented May 4, 2022

Thanks for the quick answer, how do I turn on hybrid composition in mapbox 15.0?

@devmobile-vulog
Copy link

Using hybrid composition makes the map come on top of the page when coming back from background just like in #954

@treacks5
Copy link

treacks5 commented Jun 15, 2022

Same issue here, the whole map goes black or white (depends on the project). Black screen (real project) / White screen (minimal project).
It appear that we reproduce this issue only on Android 12.

Is there someone who have a work around ? Or a fix ?

We tried with the latest commit of the master branch of Mapbox but still having this black/white screen.

Log error are spamming this :

E/BufferQueueProducer( 4219): [SurfaceTexture-0-4219-2](id:107b0000000c,api:0,p:-1,c:4219) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer( 4219): [SurfaceTexture-0-4219-2](id:107b0000000c,api:0,p:-1,c:4219) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer( 4219): [SurfaceTexture-0-4219-2](id:107b0000000c,api:0,p:-1,c:4219) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer( 4219): [SurfaceTexture-0-4219-2](id:107b0000000c,api:0,p:-1,c:4219) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer( 4219): [SurfaceTexture-0-4219-2](id:107b0000000c,api:0,p:-1,c:4219) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer( 4219): [SurfaceTexture-0-4219-2](id:107b0000000c,api:0,p:-1,c:4219) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer( 4219): [SurfaceTexture-0-4219-2](id:107b0000000c,api:0,p:-1,c:4219) dequeueBuffer: BufferQueue has no connected producer
E/BufferQueueProducer( 4219): [SurfaceTexture-0-4219-2](id:107b0000000c,api:0,p:-1,c:4219) dequeueBuffer: BufferQueue has no connected producer

We managed to reproduce this white screen with our minimal project also. But it is random, sometimes it is when we do too much work with the app (click, move, resize, ...), and sometimes it is when we launch the app:

double dynamicHeight = 10;

  void _otherAction() async {
    _resize();
  }

  Future<void> _resize() async {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      if (dynamicHeight > 100) dynamicHeight = 20;
      dynamicHeight = dynamicHeight * 2;
    });
  }

Widget build(BuildContext context) {
return Scaffold(
      body: Column(
        children: [
          Container(
            height: dynamicHeight,
            width: 50,
            color: Colors.pink,
          ),
          Expanded(
            child: Stack(
              children: [
                MapboxMap(
                  accessToken:
                      <ACCESS_TOKEN>,
                  styleString:
                      <MAP_STYLE>,
                  minMaxZoomPreference: MinMaxZoomPreference(3, 22),
                  initialCameraPosition: CameraPosition(
                    target: LatLng(46.227, 2.213),
                    zoom: 6,
                  ),
                  onMapCreated: (controller) {
                    mapboxMapController = controller;
                  },
                ),
                Align(
                  alignment: Alignment.bottomLeft,
                  child: FloatingActionButton(
                    child: const SizedBox(
                      height: 40,
                      width: 40,
                    ),
                    onPressed: () {
                      _otherAction();
                    },
                  ),
                ),
              ],
            ),
          ),
          Container(
            height: dynamicHeight,
            width: 50,
            color: Colors.pink,
          ),
        ],
      ),
    );
}

Screenshot 2022-06-15 at 13 05 19

Here is a video of the issue, Pixel 4 Android 12 :
https://user-images.githubusercontent.com/53431511/173813441-8d9ce31c-9568-4c08-abdf-e77a0fb50c22.mp4

@devmobile-vulog
Copy link

@felix-ht can we get a status on this ? Right now we have to choose between this bug and the crash when turning on hybrid composition

@irvine5k
Copy link
Contributor

irvine5k commented Sep 9, 2022

Any status on this?

@SubChord
Copy link
Contributor

SubChord commented Oct 21, 2022

Found out that in [#0feb12bce79da96e5e54c1c422cebc9f2dee799c](0feb12b) the line .textureMode(true) was removed.

Adding this line again resolves the issue for me. Though my logcat gets flooded with E/FrameEvents(30825): updateAcquireFence: Did not find frame. messages.

Any objections to adding this line again to the MapboxBuilder?

@adrianvintu
Copy link

I can reproduce this 100% on Galaxy S8 with Android 9, and randomly on Galaxy S10 with Android 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants