EdgeTX / edgetx

EdgeTX is the cutting edge open source firmware for your R/C radio
https://edgetx.org
GNU General Public License v2.0
1.59k stars 338 forks source link

EdgeTX startup / welcome / hello sound does not come before Lua scripts on power-on #135

Open rotorman opened 3 years ago

rotorman commented 3 years ago

Tested f9aeebca on RM TX16S with Yaapu LUA telemetry widget. In my opinion, on power-up of the radio, the "Welcome to EdgeTX" sound should come first before other sounds. The following video shows, that e.g. in case Yaapu LUA telemetry widget is active, it's welcome sound "Yaapu telemetry ready" precedes EdgeTX welcome sound: https://www.youtube.com/watch?v=Gk1ZFmFnxsc

raphaelcoeffic commented 3 years ago

Aha! So that would be mean to force the sound queue to play the other sounds at the end. I think the audio is already capable of things like that. So it needs to be used properly, and that should work.

pfeerick commented 3 years ago

This is one annoying issue...

This is happening because https://github.com/EdgeTX/edgetx/blob/5d953c85acc0ad12c450abefd35744bd62e94281/radio/src/opentx.cpp#L1819

is run before the audio queue is started at

https://github.com/EdgeTX/edgetx/blob/5d953c85acc0ad12c450abefd35744bd62e94281/radio/src/opentx.cpp#L1861

and even though part of the AudioQueue startup task is to play the welcome audio

https://github.com/EdgeTX/edgetx/blob/8becbfcb499d919b6ba537de06778ab296a734e8/radio/src/audio.cpp#L542-L544

it seems Lua manages to get in first, and it's a "dumb" FIFO queue, and doesn't seem to have facilty for 'jumping the queue'. 😢

It also seems that the jobs can't be re-ordered - i.e. so that LUA widgets start later.

pfeerick commented 3 years ago

A further issue that was brought to my attention by a rcvideoreviews discord user - special function tracks triggered by a logical function can also get in ahead of the welcome audio.

pfeerick commented 2 years ago

Interestingly enough, this is actually the behaviour of OTX ;)