Skip to content

fix: 100% busy main thread while bot is not playing audio in vc#1578

Draft
usyless wants to merge 1 commit intobrainboxdotcc:devfrom
usyless:dev
Draft

fix: 100% busy main thread while bot is not playing audio in vc#1578
usyless wants to merge 1 commit intobrainboxdotcc:devfrom
usyless:dev

Conversation

@usyless
Copy link
Copy Markdown
Contributor

@usyless usyless commented Apr 29, 2026

I am unsure whether the fix is valid, considering it goes against the comment to always set WANT_WRITE.
I have tested with epoll in wsl, poll under windows and whatever my raspberry pi 3b+ on debian 12 uses and it seems to work
However my testing has not been extensive, and therefore I would like for some more confirmation as to whether this is valid.

I'm also unsure on the needs stop frames part, then again, the voice stuff is too much for me to all look at
And im unsure on whether the send_now branch should also need the same treatment with the socket update
I also want to look into whether update socket can be made more efficient by preventing the copy of the entire object each time

Code change checklist

  • I have ensured that all methods and functions are fully documented using doxygen style comments.
  • My code follows the coding style guide.
  • I tested that my change works before raising the PR.
  • I have ensured that I did not break any existing API calls.
  • I have not built my pull request using AI, a static analysis tool or similar without any human oversight.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2026

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit 8f138c5
🔍 Latest deploy log https://app.netlify.com/projects/dpp-dev/deploys/69f276548777f80008af1475
😎 Deploy Preview https://deploy-preview-1578--dpp-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the code Improvements or additions to code. label Apr 29, 2026
@usyless usyless changed the title Fix 100% busy main thread while bot is not playing audio in vc fix: 100% busy main thread while bot is not playing audio in vc Apr 29, 2026
@braindigitalis
Copy link
Copy Markdown
Contributor

can someone on bsd or osx test this under kqueue please?

@braindigitalis
Copy link
Copy Markdown
Contributor

@usyless is this pr ok to move out of draft

@usyless
Copy link
Copy Markdown
Contributor Author

usyless commented May 4, 2026

I haven't really tested enough, so it'd be nice for others to test too to ensure it doesn't break random parts of voice, but sure that's fine as I've been using it with my two bots and not noticed any issue there

@Jaskowicz1
Copy link
Copy Markdown
Contributor

If you can whip up a quick test program, I can get it running on OSX

@usyless
Copy link
Copy Markdown
Contributor Author

usyless commented May 4, 2026

Oh awesome, I can do that tonight or tomorrow morning.

@usyless
Copy link
Copy Markdown
Contributor Author

usyless commented May 6, 2026

@Jaskowicz1 Here is a basic example main.cpp, its a bit cooked since i re-used the code from my other bot with a single server queue-based system but it has joining, leaving and playing (can also leave while playing reliably with no crash - im just using the pausing as an indicator of that here)

@braindigitalis
Copy link
Copy Markdown
Contributor

can't we just use src/davetest?

@usyless
Copy link
Copy Markdown
Contributor Author

usyless commented May 6, 2026

Oh idk, I just made a quick program as asked but yea built in tests would make sense

@Jaskowicz1
Copy link
Copy Markdown
Contributor

ngl i forgot about davetest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code Improvements or additions to code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants