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

feat(radio,cpn): Startup splash screen and sound changes. #3451

Merged
merged 14 commits into from
Jul 30, 2023

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Apr 8, 2023

Fixes #3438, fixes #2537, fixes #391

Summary of changes:

  • Enable startup splash screen duration for color LCD radios.
  • Add option to disable startup sound on all radios.
  • Add Companion support for above changes.
  • Move mixer task startup to after splash screen is done on color LCD radios so that the startup sound is played first.

Notes:

  • The startup splash screen cannot be disabled for color LCD radios. The minimum setting is 1 second. This is because the radio.yml file has not been loaded when the splash screen is displayed so the property to disable it is unknown.
  • There is an initial delay on color LCD radios before the startup sound is played. This is due to the initialisation of the theme and loading the radio & model files from the SD card. The length of the delay will depend on the radio, SD card speed, theme background image and number of model files, and this delay will determine the actual minimum time for the splash screen to be shown.
  • Moving the mixer task startup does not seem to have caused any adverse side effects on my QX7S, TX16S Mk2 or the simulator. It probably needs more testing on other radios though.

Screen Shot 2023-04-08 at 8 13 12 pm

Screen Shot 2023-04-08 at 8 13 55 pm

Screen Shot 2023-04-08 at 8 14 20 pm

@philmoz philmoz mentioned this pull request Apr 8, 2023
1 task
@pfeerick
Copy link
Member

pfeerick commented Apr 8, 2023

Hm, be interesting to see if this fixes #135 also

@pfeerick pfeerick added this to the 2.10 milestone Apr 8, 2023
@pfeerick pfeerick added bug 🪲 Something isn't working enhancement ✨ New feature or request color Related generally to color LCD radios labels Apr 8, 2023
@philmoz
Copy link
Collaborator Author

philmoz commented Apr 8, 2023

Hm, be interesting to see if this fixes #135 also

I think it should fix most cases; but it's a hard one to test.

I tested a simple widget and calling playSound in the refresh method is ok, the sound plays after the welcome sound.
Calling playSound from the create method will, however, still play before the welcome sound because Lua scripts are initialised first.

@pfeerick
Copy link
Member

pfeerick commented Apr 9, 2023

It's should actually to test this particular case - the yappu telemetry widget plays a "yappu telemetry ready" sound as it starts, so if that no longer precedes the ETX hello.wav when the active model on power on has the widget installed, it's fixed. I guess it will depend on where the yappu playsound is.

@philmoz
Copy link
Collaborator Author

philmoz commented Apr 9, 2023

I guess it will depend on where the yappu playsound is.

Yaapu plays its startup sound in the create function so this change does specifically fix #135

ulfhedlund added a commit to ulfhedlund/edgetx that referenced this pull request Apr 10, 2023
Added translation for PR EdgeTX#3451:
#define TR_PLAY_HELLO "Startljud"
@ulfhedlund
Copy link
Contributor

Is there a string for translation of "Play Startup Sound" in Companion?

@philmoz philmoz force-pushed the start-splash-and-sound branch 2 times, most recently from afc8914 to 74cb2ce Compare May 14, 2023 07:19
@philmoz philmoz changed the title feat(radio,cpn) - Startup splash screen and sound changes. feat(radio,cpn): Startup splash screen and sound changes. Jul 5, 2023
@pfeerick
Copy link
Member

pfeerick commented Jul 16, 2023

Hi all... hope you've been enjoying your weekend :) Can I get a translation for this one please. Screenshots in the initial post for context.

#define TR_PLAY_HELLO "Startup Sound"

@Pat6874
Copy link
Contributor

Pat6874 commented Jul 16, 2023 via email

@ulfhedlund
Copy link
Contributor

ulfhedlund commented Jul 16, 2023 via email

@offer-shmuely
Copy link
Contributor

offer-shmuely commented Jul 16, 2023

HE
#define TR_PLAY_HELLO "צליל אתחול"

@froqstar
Copy link

DE:
#define TR_PLAY_HELLO "Startton"

@HThuren
Copy link
Contributor

HThuren commented Jul 16, 2023

DA
#define TR_PLAY_HELLO "Startop lyd"

... and nice weekend to you too

@zyren
Copy link
Contributor

zyren commented Jul 16, 2023

CN

#define TR_PLAY_HELLO "开机语音"

TW

#define TR_PLAY_HELLO "開機語音"

@Eldenroot
Copy link
Contributor

CZ

#define TR_PLAY_HELLO "Zvuk při spuštění"

@zandorsp
Copy link
Contributor

PT

#define TR_PLAY_HELLO "Som ao ligar"

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 28, 2023

The only issue (and it's a doozie...) set the startup time to 8s (or longer), and restart the radio 🤭 My TX16S at least doesn't like that...

Ooops. Any ideas?

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 28, 2023

Suspending the watchdog timer seems to fix it - hopefully this is the correct way to do it.

@pfeerick
Copy link
Member

Interesting... it fitted the timeline of the watchdog, but I had thought RTOS_WAIT_TICKS would have satisfied it... 🤷

@raphaelcoeffic @gagarinlg Your thoughts?

radio/src/opentx.h Outdated Show resolved Hide resolved
@gagarinlg
Copy link
Member

Interesting... it fitted the timeline of the watchdog, but I had thought RTOS_WAIT_TICKS would have satisfied it... 🤷

@raphaelcoeffic @gagarinlg Your thoughts?

Do not stop the watchdog!

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 28, 2023

Do not stop the watchdog!

watchdogSuspend() is used elsewhere - is it not safe to use while the splash screen is being shown?

@gagarinlg
Copy link
Member

Do not stop the watchdog!

watchdogSuspend() is used elsewhere - is it not safe to use while the splash screen is being shown?

Then we should redesign those parts.
I would prefer to regularly wake up, kick the watchdog and the go back to sleep, when the timeout is not reached

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 28, 2023

I've changed the splash timeout loop to use WDG_RESET instead.

@pfeerick pfeerick merged commit 9e7a331 into EdgeTX:main Jul 30, 2023
23 checks passed
raphaelcoeffic added a commit that referenced this pull request Aug 7, 2023
PR #3451 introduced a change that caused the mixer task to be started out of the UI task, which introduces a race condition `mixerTaskId.rtos_handle`, as the mixer scheduler might trigger before `xTaskCreateStatic` returns and the task handle is assigned.

This PR fixes the issue by delaying the start of the mixer scheduler until `xTaskCreateStatic` returned and the task handler has been properly assigned.
raphaelcoeffic added a commit that referenced this pull request Aug 7, 2023
PR #3451 introduced a change that caused the mixer task to be started out of the UI task, which introduces a race condition `mixerTaskId.rtos_handle`, as the mixer scheduler might trigger before `xTaskCreateStatic` returns and the task handle is assigned.

This PR fixes the issue by delaying the start of the mixer scheduler until `xTaskCreateStatic` returned and the task handler has been properly assigned.
raphaelcoeffic added a commit that referenced this pull request Aug 7, 2023
PR #3451 moved the start of the mixer task to a point in time where the task scheduler is already started (UI task). Before that change, the mixer task would be created before and effectively started after the task scheduler started.

This introduces a race condition on `mixerTaskId.rtos_handle`, as the mixer scheduler might trigger before `xTaskCreateStatic()` returns and the task handle is assigned.

This PR fixes the issue by delaying the start of the mixer scheduler until `xTaskCreateStatic()` returned and the task handler has been properly assigned.
@philmoz philmoz deleted the start-splash-and-sound branch October 31, 2023 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working color Related generally to color LCD radios enhancement ✨ New feature or request
Projects
None yet