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

Glitch in background, exclusive mode #2062

Closed
simdax opened this issue Jul 9, 2024 · 7 comments · Fixed by #2070
Closed

Glitch in background, exclusive mode #2062

simdax opened this issue Jul 9, 2024 · 7 comments · Fixed by #2070
Assignees
Labels

Comments

@simdax
Copy link

simdax commented Jul 9, 2024

Hello.

I'm working on a plugin that should be open when my application runs in background.

I use a fullduplex stream, as i filter the input from the default microphone. The idea is to keep the app alive while recording the surrounding sound.

For now, all is ok when I run my plugin from the app. But when going in background the stream becomes glitchy.

I'm not sure also to really be able to be able to start a stream with exclusive mode. Do I need to do something special?

Thank you!

@simdax simdax added the bug label Jul 9, 2024
@robertwu1
Copy link
Collaborator

Try the LiveEffect sample. It currently does not run in the background so I created a Pull Request (#2063). It seems to work fine in the background with the minor change with that PR.

@simdax
Copy link
Author

simdax commented Jul 9, 2024

As I mentionned it here #2063 (comment)
It seems that passing in background make some few glitches.

@philburk
Copy link
Collaborator

philburk commented Jul 9, 2024

If your callback function does a lot of processing then there may be a problem running in the background.
That is because the CPU gives lower priority to background tasks and lowers the CPU frequency.

What device are you on?
OS version?
etcetera

@robertwu1
Copy link
Collaborator

See https://developer.android.com/develop/background-work/services/foreground-services. Starting for Android U, foreground services are required.

@simdax
Copy link
Author

simdax commented Jul 10, 2024

It would be nice to have a background example, with the foreground service.
I'm not sure how to keep enough CPU for my plugin processing

@robertwu1
Copy link
Collaborator

I filed issue #2065

@robertwu1
Copy link
Collaborator

@simdax can you try PR #2070?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants