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

The music slow down and the sound hiss. #663

Closed
1 task done
jrmyid opened this issue Aug 26, 2023 · 10 comments
Closed
1 task done

The music slow down and the sound hiss. #663

jrmyid opened this issue Aug 26, 2023 · 10 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@jrmyid
Copy link

jrmyid commented Aug 26, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When i listen to music (just a track or an entire playlist), randomly the sound is hiss and/or slow down. Each track, every time. Only on my android's app, this doesn't occur on my laptop.

Expected Behavior

The sound is clear.

Steps to reproduce

  1. I opened the app.
  2. I choosed a track and i listened to it
  3. The sound hissed and slowned down or just hissed

Operating System

Android : 5.10.157-android13-4-00003-g776d0a76f6aa-ab10208116

Spotube version

3.1.0

Installation source

F-Droid (Android)

Additional information

No response

@jrmyid jrmyid added the bug Something isn't working label Aug 26, 2023
@coyote-b
Copy link

Getting this bug too on every song. Google Pixel 6a running GrapheneOS (Android 13). I can replicate it on both wifi and LTE so I don't believe it's related to poor network connection.

@hackerb9
Copy link

hackerb9 commented Sep 14, 2023

Getting this bug too on every song. Google Pixel 6a running GrapheneOS (Android 13).

I also have a Pixel 6a (GrapheneOS) which exhibits this problem. It only happens after the screen has shut off for me. The peculiar scratchiness sounds to me like the player is CPU starved.

It is definitely not a bandwidth issue as it also happens with downloaded tracks.

Possibly related: #571 ( Intermittent Distorted Audio by @OfficialMuffin).

@WCooke
Copy link

WCooke commented Sep 24, 2023

I have the same issue, but only when songs are playing through the phone speakers (Pixel 6) not when playing via bluetooth (headphones or speakers)

Issue only occurs with Spotube and not with other music apps.

Android 13
Spotube v3.1.2

@hackerb9
Copy link

hackerb9 commented Sep 24, 2023

@WCooke Interesting. The problem occurs for me via Bluetooth (pixel buds). Are you running the stock Google OS on your Pixel 6?

@KRTirtho I've found that if I simultaneously run a background app that doesn't let the CPU idle (Jitsi Meet), Spotube doesn't garble when the screen dims. That makes me think the Pixel 6 must have an ultra-low CPU clock speed when it idles.

I am not an Android developed, but it looks like the best solution would be for Spotube to detect when idle mode starts and disable all the UI threads that are using excess CPU/GPU. https://developer.android.com/reference/android/os/PowerManager#ACTION_DEVICE_IDLE_MODE_CHANGED

Does Spotube already do this? Perhaps there's a thread being missed, like the color changing background?

Alternately, it looks like an app can request that a phone not let the CPUs go idle. It will use up the battery, but may be an easy fix. https://developer.android.com/reference/android/media/MediaPlayer#setWakeMode(android.content.Context,%20int)

@KRTirtho
Copy link
Owner

I am not an Android developed, but it looks like the best solution would be for Spotube to detect when idle mode starts and disable all the UI threads that are using excess CPU/GPU. https://developer.android.com/reference/android/os/PowerManager#ACTION_DEVICE_IDLE_MODE_CHANGED

Does Spotube already do this? Perhaps there's a thread being missed, like the color changing background?

Spotube is not supposed to manage the UI threads here. It is usually done by the flutter engine (skia/impeller) & the android embedder (basically the app lifecycle)

I am not an Android developed, but it looks like the best solution would be for Spotube to detect when idle mode starts and disable all the UI threads that are using excess CPU/GPU. https://developer.android.com/reference/android/os/PowerManager#ACTION_DEVICE_IDLE_MODE_CHANGED

And yea the PowerManager.WakeLock is already being used by Spotube through the audio_service plugin

Alternately, it looks like an app can request that a phone not let the CPUs go idle. It will use up the battery, but may be an easy fix. https://developer.android.com/reference/android/media/MediaPlayer#setWakeMode(android.content.Context,%20int)

Same as PowerManager. It's just automatically done by the MediaPlayer but Spotube uses mpv which also does this under the hood

@hackerb9
Copy link

@KRTirtho Do you know of another app I could try which uses the same libraries? I'm curious if those apps would have the same problem on a Pixel 6 with GrapheneOS.

@KRTirtho
Copy link
Owner

There's Harmonoid

@KRTirtho KRTirtho added the duplicate This issue or pull request already exists label Oct 29, 2023
@KRTirtho
Copy link
Owner

Duplicate of #571

@KRTirtho KRTirtho marked this as a duplicate of #571 Oct 29, 2023
@mustard007
Copy link

mustard007 commented Feb 4, 2024

Hello! I have a pixel 6 Pro and the sound quality coming from the phone speaker is dull, without bass and with low volume.

I found another app on F-Droid/Git using Flutter called Musify. I have no problems with the sound quality coming from the phone speaker with it.

It could be a possible solution checking their code.
Thanks!!

@mustard007
Copy link

There's Harmonoid

I Also don't have the "audio from phone speaker quality bug" with this application.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

6 participants