Skip to content

BufferQueue has no connected producer #763

Description

@moodstubos

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!

Activity

  1. moodstubos commented on Nov 15, 2021

    @moodstubos
    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();
          },
        );
    }
    
  2. stale commented on Jan 14, 2022

    @stale

    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.

  3. skreborn commented on Feb 24, 2022

    @skreborn

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

  4. ryanjohndias commented on Feb 24, 2022

    @ryanjohndias

    Also experiencing this issue...

  5. felix-ht commented on Feb 24, 2022

    @felix-ht
    Collaborator

    should be fixed by #916

  6. stale commented on Apr 25, 2022

    @stale

    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.

  7. skreborn commented on Apr 26, 2022

    @skreborn

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

  8. devmobile-vulog commented on May 4, 2022

    @devmobile-vulog

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

  9. felix-ht commented on May 4, 2022

    @felix-ht
    Collaborator

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

  10. devmobile-vulog commented on May 4, 2022

    @devmobile-vulog

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

  11. devmobile-vulog commented on May 9, 2022

    @devmobile-vulog

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

  12. treacks5 commented on Jun 15, 2022

    @treacks5

    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

  13. devmobile-vulog commented on Jul 13, 2022

    @devmobile-vulog

    @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

  14. irvine5k commented on Sep 9, 2022

    @irvine5k
    Contributor

    Any status on this?

  15. thijsvdbb commented on Oct 21, 2022

    @thijsvdbb
    Contributor

    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?

  16. adrianvintu commented on Jan 9, 2024

    @adrianvintu

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions