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

ogg123: --random/--repeat: endless loop if audio device disappears #45

Closed
sdaoden opened this issue Apr 4, 2024 · 3 comments
Closed

Comments

@sdaoden
Copy link

sdaoden commented Apr 4, 2024

Hello!
Thanks for the much beloved ogg/vorbis stuff that i use for over two decades i think.
I have spent years of my life with this format / software (i wrote a little pretty borked OGG player thing for MacOS in 2010, but 'am back to FreeBSD/Linux and thus ogg123 for very long)!
(Only a bit disappointed that integer-only tremor disappeared; i have a copy.. but maybe will never use it, and THUS .. 'NUFF said.)

So i do have a problem with ogg123 in that it often plays all day long and i have a bluetooth thing that is addressed via BlueAlsa; the actual device is borked though, and so it happens that the device disappears.
If ogg123 is at that time running in --random or --repeat mode, it enters an endless loop that drives the CPU to maximum.

Wouldn't it make sense to add an error counter and reset it when anything can be written successfully, and otherwise bail out after XY errors? Or sleep a bit instead of busy-endless-looping if there was an error?
Would it make sense to write a patch and create a pull request?

Thanks for ogg/vorbis people! Thanks.
Ciao from Germany,

@rillian
Copy link
Contributor

rillian commented Apr 4, 2024

Hmm. It looks like ogg123 doesn't check for error after submitting audio for playback, and so repeat mode might keep decoding over and over again without noticing the audio is going nowhere.

@sdaoden
Copy link
Author

sdaoden commented Apr 5, 2024

I see. I never looked into this, actually; if it happens i see the "ERROR: buffer write failed." error, so whereas your thing also very much looks like a bug, the loop in main() seems to have no exit clause at all; however the play() it calls will react, but only on sig_request.exit, not on any I/O error.
What'ya say?

@sdaoden
Copy link
Author

sdaoden commented May 9, 2024

Ah yes, some good aspects there are with github!
I have really opened

#47

which contains a possible solution!

@sdaoden sdaoden closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants