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

Linux [WSL], GStreamer missing library/Internal data stream error #1144

Closed
velia-vito opened this issue May 30, 2022 · 10 comments
Closed

Linux [WSL], GStreamer missing library/Internal data stream error #1144

velia-vito opened this issue May 30, 2022 · 10 comments
Assignees
Labels
bug platform-linux Affects the linux platform stale Automatically close this issue, if no activity is recognized waiting for report Wait for the author to respond to the conversation

Comments

@velia-vito
Copy link

velia-vito commented May 30, 2022

GStreamer is missing a library.

Full Description

  1. You can't find out what cmake error makes the build fail every single time unless you run flutter run --verbose
  2. That done, having installed the relevant requirements, It still shows that some library is missing.
  3. It works well on Chrome and Windows. Issue exists only on Linux (Nice pkg, thanks a lot!)

Code to Reproduce

repo

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:audioplayers/audioplayers.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(Main());
}

class Main extends StatelessWidget {
  final tickPlayer = AudioPlayer()..setSourceAsset('tick.wav');
  final tockPlayer = AudioPlayer()..setSourceAsset('tock.wav');

  Main({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: TextButton(
            onPressed: () => Timer.periodic(
              const Duration(seconds: 2),
              (timer) async {
                if (timer.tick % 2 == 0) {
                  await tickPlayer.resume();
                  await tickPlayer.resume();
                } else {
                  await tockPlayer.resume();
                }

                print(timer.tick);

                if (timer.tick == 4) {
                  await Future.delayed(
                    const Duration(milliseconds: 150),
                    () => tickPlayer.resume(),
                  );
                  await Future.delayed(
                    const Duration(milliseconds: 150),
                    () => tickPlayer.resume(),
                  );
                  await Future.delayed(
                    const Duration(milliseconds: 150),
                    () => tickPlayer.resume(),
                  );
                  timer.cancel();
                }
              },
            ),
            child: const Text('Play'),
          ),
        ),
      ),
    );
  }
}

Log Errors

nova-grande@nova-grande:~/code/TickerForAuthors$ sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-pulseaudio; echo "----------------------"; flutter run;
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgstreamer1.0-dev is already the newest version (1.16.2-2).
gstreamer1.0-libav is already the newest version (1.16.2-2).
gstreamer1.0-plugins-bad is already the newest version (1.16.2-2.1ubuntu1).
gstreamer1.0-pulseaudio is already the newest version (1.16.2-1ubuntu2.1).
libgstreamer-plugins-base1.0-dev is already the newest version (1.16.2-4ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
----------------------
Launching lib/main.dart on Linux in debug mode...
Building Linux application...
Syncing files to device Linux...                                    98ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on Linux is available at: http://127.0.0.1:37185/1owLesBAhnY=/
The Flutter DevTools debugger and profiler on Linux is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:37185/1owLesBAhnY=/
flutter: 1
Error: 12; message=Your GStreamer installation is missing a plug-in.
Error: 1; message=Internal data stream error.
[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Error: 12; message=Your GStreamer installation is missing a plug-in.
#0      MethodChannelAudioplayersPlatform._doHandlePlatformCall (package:audioplayers_platform_interface/method_channel_audioplayers_platform.dart:175:9)
#1      MethodChannelAudioplayersPlatform.platformCallHandler (package:audioplayers_platform_interface/method_channel_audioplayers_platform.dart:148:7)
#2      MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:404:55)
#3      MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:397:34)
#4      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:380:35)
#5      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:377:46)
#6      _invoke2.<anonymous closure> (dart:ui/hooks.dart:190:15)
#7      _rootRun (dart:async/zone.dart:1426:13)
#8      _CustomZone.run (dart:async/zone.dart:1328:19)
#9      _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#10     _invoke2 (dart:ui/hooks.dart:189:10)
#11     _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#12     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#13     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#14     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:589:22)
#15     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Error: 1; message=Internal data stream error.
#0      MethodChannelAudioplayersPlatform._doHandlePlatformCall (package:audioplayers_platform_interface/method_channel_audioplayers_platform.dart:175:9)
#1      MethodChannelAudioplayersPlatform.platformCallHandler (package:audioplayers_platform_interface/method_channel_audioplayers_platform.dart:148:7)
#2      MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:404:55)
#3      MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:397:34)
#4      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:380:35)
#5      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:377:46)
#6      _invoke2.<anonymous closure> (dart:ui/hooks.dart:190:15)
#7      _rootRun (dart:async/zone.dart:1426:13)
#8      _CustomZone.run (dart:async/zone.dart:1328:19)
#9      _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#10     _invoke2 (dart:ui/hooks.dart:189:10)
#11     _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#12     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#13     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#14     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:589:22)
#15     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)

flutter: 2
Error: 12; message=Your GStreamer installation is missing a plug-in.
Error: 1; message=Internal data stream error.
[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Error: 12; message=Your GStreamer installation is missing a plug-in.
#0      MethodChannelAudioplayersPlatform._doHandlePlatformCall (package:audioplayers_platform_interface/method_channel_audioplayers_platform.dart:175:9)
#1      MethodChannelAudioplayersPlatform.platformCallHandler (package:audioplayers_platform_interface/method_channel_audioplayers_platform.dart:148:7)
#2      MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:404:55)
#3      MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:397:34)
#4      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:380:35)
#5      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:377:46)
#6      _invoke2.<anonymous closure> (dart:ui/hooks.dart:190:15)
#7      _rootRun (dart:async/zone.dart:1426:13)
#8      _CustomZone.run (dart:async/zone.dart:1328:19)
#9      _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#10     _invoke2 (dart:ui/hooks.dart:189:10)
#11     _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#12     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#13     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#14     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:589:22)
#15     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Error: 1; message=Internal data stream error.
#0      MethodChannelAudioplayersPlatform._doHandlePlatformCall (package:audioplayers_platform_interface/method_channel_audioplayers_platform.dart:175:9)
#1      MethodChannelAudioplayersPlatform.platformCallHandler (package:audioplayers_platform_interface/method_channel_audioplayers_platform.dart:148:7)
#2      MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:404:55)
#3      MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:397:34)
#4      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:380:35)
#5      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:377:46)
#6      _invoke2.<anonymous closure> (dart:ui/hooks.dart:190:15)
#7      _rootRun (dart:async/zone.dart:1426:13)
#8      _CustomZone.run (dart:async/zone.dart:1328:19)
#9      _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#10     _invoke2 (dart:ui/hooks.dart:189:10)
#11     _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#12     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#13     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#14     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:589:22)
#15     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)

AudioPlayers: Unable to set the pipeline to the playing state.
flutter: 3
AudioPlayers: Unable to set the pipeline to the playing state.
AudioPlayers: Unable to set the pipeline to the playing state.
flutter: 4
AudioPlayers: Unable to set the pipeline to the playing state.
AudioPlayers: Unable to set the pipeline to the playing state.
AudioPlayers: Unable to set the pipeline to the playing state.
Lost connection to device.

Files/URLs/Sources

nova-grande@nova-grande:~/code/TickerForAuthors$ ls assets/
tick.wav  tock.wav
  • both files are 250ms long

Screenshots

  • None

Platforms

  • Linux

Other

[✓] Flutter (Channel stable, 3.0.1, on Ubuntu 20.04.4 LTS 5.10.102.1-microsoft-standard-WSL2, locale C.UTF-8)
    • Flutter version 3.0.1 at /home/nova-grande/software/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fb57da5f94 (11 days ago), 2022-05-19 15:50:29 -0700
    • Engine revision caaafc5604
    • Dart version 2.17.1
    • DevTools version 2.12.2

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[!] Flutter IDE Support (No supported IDEs installed)
    • IntelliJ - https://www.jetbrains.com/idea/
    • Android Studio - https://developer.android.com/studio/
    • VS Code - https://code.visualstudio.com/

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.4 LTS 5.10.102.1-microsoft-standard-WSL2

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
@velia-vito velia-vito added the bug label May 30, 2022
@velia-vito
Copy link
Author

update, it compiles and runs, but no audio plays

@Gustl22
Copy link
Collaborator

Gustl22 commented Jun 1, 2022

Are you able to execute the example?

Also may try installing plugins-good, but wav should work without it.
Are you on WSL2 ? yes

Also pay attention to line endings.

@velia-vito
Copy link
Author

Also pay attention to line endings.

As in? Aren't the line endings auto-generated?

@velia-vito
Copy link
Author

I can run the example. But my code still does not work.

[        ] An Observatory debugger and profiler on Linux is available at: http://127.0.0.1:35781/TZuLIy16Hj0=/
[ +226 ms] The Flutter DevTools debugger and profiler on Linux is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:35781/TZuLIy16Hj0=/
[+11093 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+2081 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+1963 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+2198 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+1938 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+1840 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+2022 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+2203 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+1800 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[+2021 ms] AudioPlayers: Could not set playback to position 0 and rate 1.000000.
[  +70 ms] Service protocol connection closed.
[        ] Lost connection to device.
[   +1 ms] DevFS: Deleting filesystem on the device (file:///tmp/ticker-for-authorsJEBVVH/ticker-for-authors/)
[ +252 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed
[   +3 ms] "flutter run" took 33,177ms.
[ +254 ms] ensureAnalyticsSent: 251ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 0

It compiles properly but no audio plays.

You can check on my code at https://github.com/shady-ti/ticker-for-authors

@Gustl22
Copy link
Collaborator

Gustl22 commented Jun 25, 2022

@shady-ti your code works perfectly fine on my Ubuntu 22.04 with 1 sound per second, 1 minute long with Flutter 3.0.3. Maybe you can shrink down the possibilities or try it on a native installation. Maybe its a thing of WSL2.
Consider closing, if you don't experience the problem anymore.

@velia-vito
Copy link
Author

If it is WSL, I have no way of confirming. Shall I send you the file I compiled? If it works for you it's an issue with WSL, else it's something with my setup.

@Gustl22
Copy link
Collaborator

Gustl22 commented Jun 27, 2022

I just tried it via Windows WSL2 and also worked the first time.

But there seems to be a some randomness, when playing two AudioPlayers simultaneously (with v1.0.1). I'll investigate and may write some tests for it, but it could take a while...

@Gustl22 Gustl22 added the platform-linux Affects the linux platform label Sep 27, 2022
@velia-vito
Copy link
Author

velia-vito commented Oct 11, 2022 via email

@Gustl22
Copy link
Collaborator

Gustl22 commented Jul 25, 2023

@shady-ti is the issue solved with #1332 ? Can you confirm with the latest AP version 5.0.0?

@Gustl22 Gustl22 added waiting for report Wait for the author to respond to the conversation stale Automatically close this issue, if no activity is recognized labels Jul 25, 2023
@Gustl22 Gustl22 closed this as completed Oct 1, 2023
@velia-vito
Copy link
Author

Sorry for the delay, Uni has been kicking my ass. And yes, the issue is fixed. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-linux Affects the linux platform stale Automatically close this issue, if no activity is recognized waiting for report Wait for the author to respond to the conversation
Projects
None yet
Development

No branches or pull requests

2 participants