ryanheise / audio_service

Flutter plugin to play audio in the background while the screen is off.
805 stars 480 forks source link

non-ios headset not able to pause when playback speed more than 1.0 #1016

Open mhassan772 opened 1 year ago

mhassan772 commented 1 year ago

Documented behaviour

You encapsulate your audio code in an audio handler which implements standard callbacks on Android, iOS and the web that allow it to respond to playback requests coming from your Flutter UI, headset buttons, the lock screen, notification, iOS control center, car displays and smart watches, even when the app is in the background:

Actual behaviour

when you click on pause on the headset nothing happens. the audio just keeps playing

Minimal reproduction project

Official example: example_playlist.dart

Reproduction steps

  1. Connect your non-ios Bluetooth headset. (I tested with Bose)
  2. Start playing the audio and notice that you can start and pause using the headset with no problem.
  3. Increase the speed to more than 1.0.
  4. Start the player and notice that you are not able to pause with the headset anymore.

Output of flutter doctor

│ A new version of Flutter is available!                  │
│                                                         │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.8, on macOS 13.3.1 22E261 darwin-x64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.77.3)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

Devices exhibiting the bug

iPhone 11 with Bose headset

ryanheise commented 1 year ago

Minimal reproduction project

Official example: main.dart

That example, specifically?

Increase the speed to more than 1.0

That example does not include any feature to change the speed. If you're expecting me to change the code, then you haven't read the instructions for submitting a bug report. The reproduction steps are "user steps", i.e. things in the user interface that I should click on. Please fix your bug report accordingly.

I am also curious why the speed needs to be changed. Are you saying that your Bose headset's button will successfully play/pause if the speed is 1.0, and only fails when it is > 1.0? Please clarify. Also, are you saying that your Bose headset's button does work successfully on other apps when changing the speed to more than 1.0? Please clarify.

Do you have access to other headsets? Different headsets may have different capabilities and compatibilities with iOS devices, also, so it may turn out that this is a Bose issue and not an audio_service issue. Please clarify.

mhassan772 commented 1 year ago

sorry for not including those details. the main reason for this issue is because I found the way to fix it and I was trying to do a pull request. I am new to Github so it is taking me longer time than usual.

But yes, my bose or any non-ios headset works fine in the app if the speed is 1.0 Once I increase the speed it does not work anymore. pause just gets ignored.

And my bose works perfectly on all the other apps in my phone. And it is working now perfectly after I did the solution I will pull request soon once I figure out how to do it :D

On Tue, 2 May 2023 at 08:03, ryanheise @.***> wrote:

Minimal reproduction project

Official example: main.dart

That example, specifically?

Increase the speed to more than 1.0

That example does not include any feature to change the speed. If you're expecting me to change the code, then you haven't read the instructions for submitting a bug report. The reproduction steps are "user steps", i.e. things in the user interface that I should click on. Please fix your bug report accordingly.

I am also curious why the speed needs to be changed. Are you saying that your Bose headset's button will successfully play/pause if the speed is 1.0, and only fails when it is > 1.0? Please clarify. Also, are you saying that your Bose headset's button does work successfully on other apps when changing the speed to more than 1.0? Please clarify.

Do you have access to other headsets? Different headsets may have different capabilities and compatibilities with iOS devices, also, so it may turn out that this is a Bose issue and not an audio_service issue. Please clarify.

— Reply to this email directly, view it on GitHub https://github.com/ryanheise/audio_service/issues/1016#issuecomment-1531538184, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSPQYGZG73S3V2M3YLDL6TXEEH2XANCNFSM6AAAAAAXTCZ5M4 . You are receiving this because you authored the thread.Message ID: @.***>

mhassan772 commented 1 year ago

If you are okay for me to skip changing the changlog and follow the other instructions and just do the pull request with the code change I can do that now. I am sure it is working 100%. But I am happy to follow the instructions but it will take me some time.

ryanheise commented 1 year ago

Definitely a pull request would be welcome. After seeing your PR I may have a better idea of what the issue might be, given that I don't have a Bose headset myself to test on. After that, editing this bug report may still be helpful so that other people who have the same Bose headset will be able to follow the same reproduction steps.

I think you ought to be able to use the example_playlist.dart example instead of the main.dart example since that one contains a UI element for adjusting the speed.

mhassan772 commented 1 week ago

Hey I know you must be busy but I have been using this in my app since then and it is working like a charm. Is there a reason why it is not migrated into the main branch? Also I am thinking of investing a lot of time to get the iOS in parity with the skip silence and audio boost but I am worried it won’t be merged like this one. I just want a confirmation from you that it will be treated differently. Thanks for understanding @ryanheise