GithubHelp home page GithubHelp logo

Comments (13)

ashutoshgngwr avatar ashutoshgngwr commented on June 24, 2024 1

@SebastJava Thank you for taking the time to investigate it. I don't remember exactly. There may have been several refactors since then. Perhaps it is best not to rely on my vague memory. If I were starting afresh, I'd start here:

fun getCurrentPreset(): SortedMap<String, Float> {
return soundPlayers
.filterValues { state == State.STOPPING || (it.state != SoundPlayer.State.STOPPING && it.state != SoundPlayer.State.STOPPED) }
.mapValues { soundPlayerVolumes[it.key] ?: 1F }
.toSortedMap()
}

Most likely, it is broken. You can also look at SoundPlaybackService, where it is called to update a StateFlow on which the UI elements rely.

from android-app.

ashutoshgngwr avatar ashutoshgngwr commented on June 24, 2024 1

Hey @SebastJava! Thank you for taking the time to dig deep and find the exact steps needed to reproduce this. I'll resolve it as soon as possible, perhaps over the weekend.

I hope I am not wasting your time.

You didn't. Your input has been very helpful!

from android-app.

ashutoshgngwr avatar ashutoshgngwr commented on June 24, 2024 1

@SebastJava I've added a fix to resolve this issue. Since it changes a few components' behaviours at the implementation's lowest level, I'm sceptical that it may cause unwanted side effects. Nevertheless, I've released a new version, 2.5.5, with this fix, and it should be available shortly on GitHub releases, F-Droid and Noice beta on the Google Play Store.

from android-app.

SebastJava avatar SebastJava commented on June 24, 2024 1

Thanks !

from android-app.

ashutoshgngwr avatar ashutoshgngwr commented on June 24, 2024

Thanks for reporting this! iirc, it came up during the implementation, and I had been lazy about it. Nonetheless, I'll try to fix this as soon as possible.

from android-app.

SebastJava avatar SebastJava commented on June 24, 2024

Thanks for this quick reply! I was currently trying to investigate what causes this bug to occur, exactly. Trying to find the exact steps to reproduce... Because this is that kind of mysterious bug that I can talk about, but I am not able to consistently reproduce it every time...

So, my question is: do you have a clear idea of the "steps to reproduce"? Or should I keep trying to find the exact combination of steps to reproduce this bug?

from android-app.

ashutoshgngwr avatar ashutoshgngwr commented on June 24, 2024

@SebastJava I tried reproducing it myself! I think what happens is when you play a preset, not all sounds will be in the PLAYING state at the same time. A few of them might be in the BUFFERING state. When you hit stop, the sounds in the PLAYING state enter the STOPPING state, while the sounds in the BUFFERING state directly enter the STOPPED state. This is important because SoundPlayerManager#getCurrentPreset and SoundPlaybackService rely on sound states to find the active preset name, and sounds in STOPPED won't be part of the active preset. I hope this makes sense!

To reproduce it, you need to hit stop before all sounds enter the PLAYING state. You can monitor sound states in log messages with the SoundPlayerManager tag. Can you verify this?

from android-app.

ashutoshgngwr avatar ashutoshgngwr commented on June 24, 2024

@SebastJava It should be easy to reproduce on a slow network since not all sounds from a preset will be able to buffer adequately to start concurrently.

from android-app.

SebastJava avatar SebastJava commented on June 24, 2024

@ashutoshgngwr I am not really a programmer, but I am willing to learn... Maybe, one day, I will finally find the time, and a quiet environment, and peace of mind, so I can dive into these things more seriously.

I am currently writing this reply on my computer, with the latest Linux Mint Cinnamon OS. But here I am talking about your Noice app on my Moto G Pure cellular phone, with Android 12.

[...] I hope this makes sense!

Yes, I approximately understand your reasoning and it makes sense.

To reproduce it, you need to hit stop before all sounds enter the PLAYING state. You can monitor sound states in log messages with the SoundPlayerManager tag. Can you verify this?

If I understand you correctly, your are saying this bug would only occur when I quickly press "stop", so there are still sounds in the BUFFERING state... But, from my various empirical tests, I get the feeling it just the opposite. This little bug only occurs when I press "stop" after some time, like after 2 minutes or so. I never get this bug if I just play my preset for 10 seconds and then stop.

And... what makes it even weirder is it seems I only get this bug with my custom presets.
This one: https://trynoice.com/preset?v=1&n=Cascades&s=%7B%22brownian_noise%22%3A1.0%2C%22pink_noise%22%3A0.8%2C%22water_stream%22%3A1.0%2C%22white_noise%22%3A0.4%2C%22wolves%22%3A0.5%7D

from android-app.

SebastJava avatar SebastJava commented on June 24, 2024

You can monitor sound states in log messages with the SoundPlayerManager tag. Can you verify this?

@ashutoshgngwr

Sorry, I have trouble understanding this. I don't know how to find any log messages on my Moto G Pure Android 12 phone. Help please!

from android-app.

SebastJava avatar SebastJava commented on June 24, 2024

Also, I believe my internet connection isn't so slow. I only use this nice Noice when at home. So, I have my own WiFi connection here. And I am the only user on it and thus I am pretty sure I always get the same steady ▼15 Mbit/s || ▲10 Mbit/s...

from android-app.

SebastJava avatar SebastJava commented on June 24, 2024

Ah, okay, sorry, I had many things on mind at the same time. I think I can quickly find answers on how to get these Android system logs. Still, your help would be appreciated, but otherwise I will probably just find some answers on Google... :)

from android-app.

SebastJava avatar SebastJava commented on June 24, 2024

@ashutoshgngwr All right ! I think I may have finally found the exact strange steps to reproduce...

To reproduce

  1. Go to the Library.
  2. Choose at least one sound that repeats seamlessly, such as pink or white noise.
  3. Choose one sound that repeats with a random delay, such as wolves or thunder.
  4. Save your preset.
  5. Just listen and wait for at least 60 seconds, then press stop while no randomly delayed sound is playing, i.e. no wolf howls or thunder sounds.
  6. See? "Unsaved preset" is now displayed for 5 seconds, during the fade out...

Of course, I can't be sure, but I think I found it. I hope I am not wasting your time. The truth is I am a bit reluctant to dive into this big system logs investigation. It would probably be a fascinating adventure, but I currently have other concerns on my mind. I am busy with other things. This system logs investigation probably sounds easy for you, but the thing is I would have to start by installing the big SDK. This looks like a big adventure. Maybe later?

from android-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.