Skip to content

Wait when trying to play a webstream while connecting to wifi #284

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

SZenglein
Copy link
Contributor

The previous code had some issues. First of all, with DONT_ACCEPT_SAME_RFID_TWICE it would not work at all. But without a change, not even that works correctly (due to gTriedToConnectToHost never being set).

IMHO the code is simplified a lot. The whole control flow can be simplified if we just wait until a connection try hast completed.

The behavior will be slightly different. Most importantly, loading a webstream as the last played rfid now works consistently. Further, the error handling of playing a webstream while disconnected is shifted to the audio library and is handled like any other error.

@SZenglein SZenglein force-pushed the fix_handle_webstream_on_startup branch from e434fe8 to 734a2c1 Compare December 28, 2023 01:31
The code is simplified a lot. I removed the functions and variables that
were never running anyway.

The webstream command is now always accepted, and the error is handled
inside the audio task. The audio task also blocks as long as a
connection try is in progress.

In addition to the code that did not work anyway, this should also fix
the oversight that we want to immediately play a different webstream
after starting, not only the last RFID.
@SZenglein SZenglein force-pushed the fix_handle_webstream_on_startup branch from 734a2c1 to ba8630b Compare June 12, 2025 18:23
@SZenglein
Copy link
Contributor Author

Rebased this onto the latest dev, please have a look @tueddy @biologist79 :)

There is one thing I am not 100% sure of: I'm basically blocking the Audio task for as long as WiFi is in the process of connecting. This hasn't caused any issues for me. With all the variables in the Audio loop it is also not easy to see what's going on, so maybe there is a better way to "do nothing".

From the commit message:

The code is simplified a lot. I removed the functions and variables that
were never running anyway.

The webstream command is now always accepted, and the error is handled
inside the audio task. The audio task also blocks as long as a
connection try is in progress.

In addition to the code that did not work anyway, this should also fix
the oversight that we want to immediately play a different webstream
after starting, not only the last RFID.

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

Successfully merging this pull request may close these issues.

1 participant