-
-
Notifications
You must be signed in to change notification settings - Fork 663
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
setUrl with headers is causing high CPU usage on physical iOS devices #1082
Comments
And when you don't set the headers, are you saying the CPU usage is lower? Because I think that in the web implementation, the headers are ignored anyway. |
Edit: Apologies, I see you are referring to iOS, not web. |
I'm a bit confused by your "Steps to reproduce - NOT CODE" since the first user step involves writing code. Please edit your bug report so that you provide a working reproduction project that I can git clone without my needing to write code, and under the steps to reproduce, provide the "user steps" (not code). |
-> Updated the first step to clone the linked fork of
There already is an updated fork of |
If you didn't include any steps for the user to perform because the audio starts playing automatically without any user interaction, please edit your example so that there is at least a button that the user can press and provide instructional user steps accordingly. I'm not going to be able to see the before and after effect without having such a user step. |
I updated the example repo and the steps to reproduce. I hope they are clear now :) |
Hi @jxstxn1 I have created a branch Since this was made as part of another change involving the platform interface, to test it you will need to clone the repo, and then edit the diff --git a/just_audio/example/pubspec.yaml b/just_audio/example/pubspec.yaml
index f187b4c..e39b7c9 100644
--- a/just_audio/example/pubspec.yaml
+++ b/just_audio/example/pubspec.yaml
@@ -18,11 +18,11 @@ dependencies:
path: ../
# Uncomment when testing platform interface changes.
-# dependency_overrides:
-# just_audio_platform_interface:
-# path: ../../just_audio_platform_interface
-# just_audio_web:
-# path: ../../just_audio_web
+dependency_overrides:
+ just_audio_platform_interface:
+ path: ../../just_audio_platform_interface
+ just_audio_web:
+ path: ../../just_audio_web
dev_dependencies:
# TODO: uncomment these dependencies when they have nullsafe versions.
diff --git a/just_audio/pubspec.yaml b/just_audio/pubspec.yaml
index 5d41e12..bff8530 100644
--- a/just_audio/pubspec.yaml
+++ b/just_audio/pubspec.yaml
@@ -14,12 +14,12 @@ environment:
flutter: ">=3.0.0"
dependencies:
- just_audio_platform_interface: ^4.2.2
- # just_audio_platform_interface:
- # path: ../just_audio_platform_interface
- just_audio_web: ^0.4.8
- # just_audio_web:
- # path: ../just_audio_web
+ # just_audio_platform_interface: ^4.2.2
+ just_audio_platform_interface:
+ path: ../just_audio_platform_interface
+ # just_audio_web: ^0.4.8
+ just_audio_web:
+ path: ../just_audio_web
audio_session: ^0.1.14
rxdart: '>=0.26.0 <0.28.0'
path: ^1.8.0
diff --git a/just_audio_background/example/pubspec.yaml b/just_audio_background/example/pubspec.yaml
index 1618cfb..d9a3463 100644
--- a/just_audio_background/example/pubspec.yaml
+++ b/just_audio_background/example/pubspec.yaml
@@ -16,11 +16,11 @@ dependencies:
path: ..
# Uncomment when testing platform interface changes.
-# dependency_overrides:
-# just_audio_platform_interface:
-# path: ../../just_audio_platform_interface
-# just_audio_web:
-# path: ../../just_audio_web
+dependency_overrides:
+ just_audio_platform_interface:
+ path: ../../just_audio_platform_interface
+ just_audio_web:
+ path: ../../just_audio_web
dev_dependencies:
# TODO: uncomment these dependencies when they have nullsafe versions.
diff --git a/just_audio_background/pubspec.yaml b/just_audio_background/pubspec.yaml
index 6f405a5..ed169d8 100644
--- a/just_audio_background/pubspec.yaml
+++ b/just_audio_background/pubspec.yaml
@@ -25,5 +25,5 @@ dev_dependencies:
flutter_lints: ^2.0.1
environment:
- sdk: ">=2.14.0 <4.0.0"
+ sdk: ">=2.17.0 <4.0.0"
flutter: ">=3.0.0"
diff --git a/just_audio_web/pubspec.yaml b/just_audio_web/pubspec.yaml
index bb096d9..02dfa08 100644
--- a/just_audio_web/pubspec.yaml
+++ b/just_audio_web/pubspec.yaml
@@ -11,9 +11,9 @@ flutter:
fileName: just_audio_web.dart
dependencies:
- just_audio_platform_interface: ^4.2.2
- # just_audio_platform_interface:
- # path: ../just_audio_platform_interface
+ # just_audio_platform_interface: ^4.2.2
+ just_audio_platform_interface:
+ path: ../just_audio_platform_interface
flutter:
sdk: flutter
flutter_web_plugins: Note that headers are implemented natively on iOS by using the Let me know how it goes and if it works as intended I can push another release. |
Just fixed a bug on this branch where it assumed headers were always specified (it should now also work where no headers are specified). |
@jxstxn1 I've just published the platform interface, so it is now possible to test without patching the pubspec files. Please let me know if this solves your high CPU usage issue and I can push out the release. |
I've published the changes mentioned above. I'll close this issue for now, but if you still find it gives high CPU usage, make a comment below and I can reopen it. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio. |
Which API doesn't behave as documented, and how does it misbehave?
When I try to load audio from the web and using headers, the CPU Usage will ramp up 100%+ and stay there even if the audio is paused.
Minimal reproduction project
A fork with the header already set is available here:
https://github.com/jxstxn1/just_audio
To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:
Minimal reproduction project
Load audio without header
and check the XCode debug tab for a reference.load audio with header
and check XCode to verify that the CPU ramps up and stays highError messages
Expected behavior
CPU usage will stay at the same level as playing audio without headers
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Flutter SDK version
Additional context
The problem got already mentioned in #747 and #858
The text was updated successfully, but these errors were encountered: