Skip to content

Comments

another attempt to fix our scratchy audio pipeline!#109

Draft
unknownpedestrian wants to merge 10 commits intomainfrom
Linting/threadsafe
Draft

another attempt to fix our scratchy audio pipeline!#109
unknownpedestrian wants to merge 10 commits intomainfrom
Linting/threadsafe

Conversation

@unknownpedestrian
Copy link
Collaborator

@unknownpedestrian unknownpedestrian commented Feb 22, 2026

-added attempt limit in stop_playback Function to prevent infinite loops in health monitor (might break checks later in pipeline)

  • wrapped streamscrobbler in asyncio.to_thread to prevent event loop blocking from synchronous scrobbling calls

  • tell ffmpeg to ignore corrupt frames instead of attempting to correct them

  • added output buffer (after transcode)

  • link validator added to pls_parser module

  • Private_stream variable threaded workaround (since streamscrobbler is threaded now)

  • fix awaits in maint command (slower now, on purpose)

  • fix tls_verify Boolean

  • configured env vars to logger on_ready (even when defaults are set!)

  • Make bot come in deafened

  • Tidy up ffmpeg vars

  • Re-did attempt limit "the Python Way" ♥ (still might break things further down the pipeline!)

  • expanded env configurability

  • updated example env + comments!

…oops in health monitor

- wrapped streamscrobbler in asyncio.to_thread to prevent event loop blocking from synchronous scrobbling calls
- tell ffmpeg to ignore corrupt frames instead of attempting to correct them, which can cause long stalls and high CPU usage
@unknownpedestrian unknownpedestrian added enhancement New feature or request Quirk Issues that don't break functionality labels Feb 22, 2026
Copy link
Owner

@CGillen CGillen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, I don't think the sleeps are necessary, but we're dealing with audio, so who knows

bot.py Outdated
Comment on lines 1048 to 1050
max_attempts = 10
attempts = 0
while voice_client.is_playing() and attempts < max_attempts:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for i in range(attempts):
will get you a cleaner way to loop for attempts number times. Then you can use
if i+1 == attempts: to see if you're on the last loop

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have an example?? or a link to the documentation for that? brain kinda slow today

also do I need to remove any of them sleeps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I got it, pull updated!

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

Labels

enhancement New feature or request Quirk Issues that don't break functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants