Skip to content

Conversation

@philmoz
Copy link
Collaborator

@philmoz philmoz commented Oct 18, 2025

Set a Pot, Slider or Switch to control brightness without using a special / global function.

If a Backlight special / global is defined it will take precedence over this new radio setting.

TODO:

  • limit selection to Pots, Sliders or Switches Companion radio settings editor.
screenshot_gx12_25-10-18_18-26-08 screenshot_tx16s_25-10-18_18-25-38

@philmoz philmoz added this to the 3.0 milestone Oct 18, 2025
@philmoz philmoz added color Related generally to color LCD radios UX-UI Related to user experience (UX) or user interface (UI) behaviour B&W Related generally to black and white LCD radios labels Oct 18, 2025
@philmoz
Copy link
Collaborator Author

philmoz commented Oct 18, 2025

@elecpower When you have some time could you look at the companion side please.
I have implemented the YAML read/write and added the control to the radio settings edit page.

It needs to be updated to limit the backlight control to only select Pots, Sliders or Switches,

@3djc
Copy link
Collaborator

3djc commented Oct 18, 2025

I think this does go against the whole logic, where things are done throuht SF. Now it is a settings, a GF, a SF, for people to understand what happens , it becomes a nightware.

What happens if you usually don't need to use the pot, but this new model needs it for a gyro gain for example ?

@pfeerick
Copy link
Member

Looks like #2256 won't be needed anymore then, and the issues it addressed can be moved to here...

@pfeerick
Copy link
Member

I think this does go against the whole logic, where things are done throuht SF. Now it is a settings, a GF, a SF, for people to understand what happens , it becomes a nightware.

No, it gives a mechanism to it without using GF or SF. If you need something more advanced, you use that instead.

What happens if you usually don't need to use the pot, but this new model needs it for a gyro gain for example?

Same could be said for Brightness GF... i.e. you wouldn't configure it globally, or you use it for both.

@elecpower
Copy link
Collaborator

The commit above fixes the source list. The dynamic update part is a wip

@pitts-mo
Copy link

pitts-mo commented Oct 18, 2025

This PR #6684 is interesting and could be helpful to band-aid the primary problems in SF backlight I observe since introduced in EdgeTX ~v2.6.x. But this PR still does not provide a complete solution to allow setting both an alternate backlight brightness and control... Please consider/investigate issue #5851 as well.

Thank you & Happy to test :-)

@pitts-mo
Copy link

As I poke with this a bit I find myself agreed with @3djc. We are not talking about a menu navigation button, this is normal user controls and they should be left for user to configure in SF / GF.

@philmoz
Copy link
Collaborator Author

philmoz commented Oct 18, 2025

The commit above fixes the source list. The dynamic update part is a wip

Thanks for that. A couple of things:

  • Tilt X & Tilt Y should not be selectable
  • Negative / inverted values should be selectable.

@philmoz philmoz force-pushed the philmoz/backlight-source branch from 6678ca2 to d77e84e Compare October 18, 2025 19:58
@elecpower
Copy link
Collaborator

  • Tilt X & Tilt Y should not be selectable
  • Negative / inverted values should be selectable.

Noted and will incorporate

@elecpower
Copy link
Collaborator

Custom function switches not listed correctly and will be addressed as part of the larger issue

@philmoz philmoz force-pushed the philmoz/backlight-source branch from 874fede to a646cea Compare October 19, 2025 03:34
@elecpower
Copy link
Collaborator

elecpower commented Oct 19, 2025

TODO: add flex switches to list
Update: done

@elecpower
Copy link
Collaborator

@philmoz back to you for testing

@philmoz
Copy link
Collaborator Author

philmoz commented Oct 19, 2025

@philmoz back to you for testing

Looks good - thank you.

@philmoz philmoz force-pushed the philmoz/backlight-source branch from ccb7bd7 to be52513 Compare October 20, 2025 05:46
@pfeerick pfeerick changed the title feat(firmware): add ability to set source for backlight / brightness control. feat(firmware): add ability to set source for backlight / brightness control Oct 26, 2025
@3djc
Copy link
Collaborator

3djc commented Oct 26, 2025

For consistency then, shouldn't the same apply to audio and variometer volumes ?

@philmoz
Copy link
Collaborator Author

philmoz commented Oct 26, 2025

For consistency then, shouldn't the same apply to audio and variometer volumes ?

One step at a time.

@philmoz philmoz force-pushed the philmoz/backlight-source branch 2 times, most recently from b527393 to d77d486 Compare October 30, 2025 00:17
@philmoz philmoz changed the title feat(firmware): add ability to set source for backlight / brightness control feat(firmware): add ability to set source for backlight / brightness and volume controls Oct 30, 2025
@philmoz
Copy link
Collaborator Author

philmoz commented Oct 30, 2025

Added audio volume control as well.

@elecpower
Copy link
Collaborator

Looks like I need to rename the source item model to a generic name. I'm open to suggestions.

@philmoz
Copy link
Collaborator Author

philmoz commented Oct 30, 2025

Looks like I need to rename the source item model to a generic name. I'm open to suggestions.

ControlSourceItemModel

@philmoz philmoz force-pushed the philmoz/backlight-source branch from d8f5b83 to c0e5e5e Compare October 30, 2025 08:17
@elecpower
Copy link
Collaborator

Testing in Ubuntu and results are inconsistent.

Used the latest PR state and setting nothing in Companion.
Set radio settings backlight no warning is displayed as expected.
Set a GF backlight and enable. Then return to radio settings backlight and no warning when there was in earlier test. Aaarrrgh.
Leave GF and add SF to the active model. Then return to radio settings backlight and warning displayed which it should be.
Deleted SF from model and warning not displayed as expected.

By the way the text is overlapping.
Screenshot from 2025-11-20 22-34-04

@elecpower
Copy link
Collaborator

Simulator and Companion crash after pressing Select model on any other model from Manage Models. All were created in Companion with defaults.
Stops in datastructs_screen.h line 67

@elecpower
Copy link
Collaborator

In Companion setting backlight source and a backlight GF.
Start simulator and go to Radio Settings and no warning. Same as performing both tasks on sim. But reverse of first tests.

@elecpower
Copy link
Collaborator

In the sim, if I add a second GF the warning displays and after I delete the second GF it disappears.

@philmoz
Copy link
Collaborator Author

philmoz commented Nov 20, 2025

@elecpower can you send your .etx file please.

@elecpower
Copy link
Collaborator

This is from the terminal window

25050ms: LONG PRESS[0x7d7180100760]
25350ms: TE_RELEASED
26250ms: TE_PRESSED
26400ms: TE_RELEASED
26400ms: CHILD_DELETED tile[0]
free(): invalid pointer

Created a new models and settings file. Added 3 models with defaults. Saved to this file
simcrashonswitchmodel.zip

Just change the extension back to etx.

@elecpower
Copy link
Collaborator

elecpower commented Nov 21, 2025

Backlight settings display post creation of GF

Screenshot from 2025-11-21 17-04-55 Screenshot from 2025-11-21 17-04-24

@elecpower
Copy link
Collaborator

Screenshot from 2025-11-21 17-09-16 Screenshot from 2025-11-21 17-09-43

@elecpower
Copy link
Collaborator

Closing Companion also causes a crash at same location in the libsim

900900ms: CHILD_DELETED tile[0]
900900ms: luaClose 0x7466580f0568
900900ms: luaClose 0x7466580eeed8
900900ms: sdDone
900900ms: stopped
900900ms: <timer_queue> stopped
[D] SimulatorWidget::deleteTempData():393 - Deleting temporary settings directory "/tmp/etx-lRisPx"
[D] SimulatorLoader::findSimulatorByName():102 - [simulator.interface.loader] searching "edgetx-tx15" simulator
[D] SimulatorLoader::unloadSimulator():171 - [simulator.interface.loader] Unloading "edgetx-tx15" ( "/src/build-e30-q690-debug/native/libedgetx-tx15-simulator.so" ) result: true
[D] main():270 - COMPANION EXIT 0
free(): invalid pointer

@philmoz
Copy link
Collaborator Author

philmoz commented Nov 21, 2025

The warning is only shown if the SF/GF override is active, not just defined.

@philmoz
Copy link
Collaborator Author

philmoz commented Nov 21, 2025

This is from the terminal window

25050ms: LONG PRESS[0x7d7180100760]
25350ms: TE_RELEASED
26250ms: TE_PRESSED
26400ms: TE_RELEASED
26400ms: CHILD_DELETED tile[0]
free(): invalid pointer

Created a new models and settings file. Added 3 models with defaults. Saved to this file simcrashonswitchmodel.zip

Just change the extension back to etx.

Hmmm. No crash on MacOS.

@elecpower
Copy link
Collaborator

elecpower commented Nov 21, 2025

The warning is only shown if the SF/GF override is active, not just defined.

So as it is a runtime conditional check there is no point me adding a warning to Companion.

Dumb question time. Why bother with a warning at all. If I set backlight in radio settings and months later add a backlight SF/GF then unless I consciously go into backlight settings and the SF/GF is active I wont know the radio setting is being overridden?

We don't display a warning in Outputs when an Override Channel SF is enabled. There are likely more stupid setting combinations that can be configured to effectively override other settings.

A comment that has been around since OTX is that there is often not just one way of achieving the same result.

@elecpower
Copy link
Collaborator

elecpower commented Nov 21, 2025

If it helps here is the Ubuntu call stack at the point of the crash

Screenshot from 2025-11-21 21-16-00

@pfeerick
Copy link
Member

The warning is only shown if the SF/GF override is active, not just defined.

So as it is a runtime conditional check there is no point me adding a warning to Companion.

"Enabled" might be the better word - if the SF/GF is defined, but disabled, no warning. Defined and enabled, then warning.

Dumb question time. Why bother with a warning at all. If I set backlight in radio settings and months later add a backlight SF/GF then unless I consciously go into backlight settings and the SF/GF is active I wont know the radio setting is being overridden?

We don't display a warning in Outputs when an Override Channel SF is enabled.

We do on the channel monitor (and outputs edit screen on colorlcd) though... there is an icon shown on both B&W and colourlcd if channel override is in effect for a given channel...

If it weren't for the fact you can do things multiple ways, a warning wouldn't be necessary, to prompt you that it is really configured somewhere else...

@elecpower
Copy link
Collaborator

Ok so accept your points.

The code to the effort of checking for active backlight. Why not display no message when no GF/SF actions, 'Overridden by GF/SF" when active and "Overrides in GF/SF" when inactive?

@pfeerick
Copy link
Member

I have no real opinion either way, but would suggest it adds clutter to show something when SF/GF is disabled (and thus effectively non-existent). I'll leave that for you, Phil and co. to figure out. 🤭

@elecpower
Copy link
Collaborator

I just don't like the idea that a SF/GF is lurking in the shadows with no indicator.

@philmoz
Copy link
Collaborator Author

philmoz commented Nov 23, 2025

If it helps here is the Ubuntu call stack at the point of the crash

Screenshot from 2025-11-21 21-16-00

That is really weird the WidgetOptionValue is a very simple structure with a small union and a std::string.

@pfeerick
Copy link
Member

I'm seeing the same on Linux Mint here, but not on MacOS or Windows.

3060ms: sdDone
3060ms: <menus> stopped
3060ms: <timer_queue> stopped
[D] SimulatorWidget::deleteTempData():393 - Deleting temporary settings directory "/tmp/etx-PMHcBv"
[D] SimulatorLoader::findSimulatorByName():102 - [simulator.interface.loader] searching "edgetx-tx15" simulator
[D] SimulatorLoader::unloadSimulator():171 - [simulator.interface.loader] Unloading "edgetx-tx15" ( "/tmp/.mount_EdgeTXIjkDHF/usr/lib/companion30/[libedgetx-tx15-simulator.so](http://libedgetx-tx15-simulator.so/)" ) result: true
[D] main():270 - COMPANION EXIT 0
free(): invalid pointer
Aborted (core dumped)

---
gdb

[D] main():270 - COMPANION EXIT 0
[Thread 0x7ffff0bfe6c0 (LWP 23223) exited]
free(): invalid pointer

Thread 1 "AppRun" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimised out>) at ./nptl/pthread_kill.c:44
warning: 44     ./nptl/pthread_kill.c: No such file or directory
(gdb) backtrace
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimised out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimised out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimised out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff544527e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff54288ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff54297b6 in __libc_message_impl (fmt=fmt@entry=0x7ffff55ce8d7 "%s\n")
    at ../sysdeps/posix/libc_fatal.c:134
#6  0x00007ffff54a8ff5 in malloc_printerr (str=str@entry=0x7ffff55cc672 "free(): invalid pointer")
    at ./malloc/malloc.c:5772
#7  0x00007ffff54ab38c in _int_free (av=<optimised out>, p=<optimised out>, have_lock=0) at ./malloc/malloc.c:4507
#8  0x00007ffff54addae in __GI___libc_free (mem=0x7fffca207fc8 <DateTimeWidget::options+40>) at ./malloc/malloc.c:3398
#9  0x00007fffc9d15c96 in TopBarPersistentData::~TopBarPersistentData() ()
   from /tmp/.mount_EdgeTXDBfKLL/usr/lib/companion30/[libedgetx-tx15-simulator.so](http://libedgetx-tx15-simulator.so/)
#10 0x00007ffff5447a76 in __run_exit_handlers (status=0, listp=<optimised out>,
    run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at ./stdlib/exit.c:108
#11 0x00007ffff5447bbe in __GI_exit (status=<optimised out>) at ./stdlib/exit.c:138
#12 0x00007ffff542a1d1 in __libc_start_call_main (main=main@entry=0x5555556dc210 <main>, argc=argc@entry=1,
    argv=argv@entry=0x7fffffffd778) at ../sysdeps/nptl/libc_start_call_main.h:74
#13 0x00007ffff542a28b in __libc_start_main_impl (main=0x5555556dc210 <main>, argc=1, argv=0x7fffffffd778,
    init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffd768)
    at ../csu/libc-start.c:360
#14 0x0000555555700d25 in _start ()

@philmoz philmoz force-pushed the philmoz/backlight-source branch from 29997ed to ed899ab Compare November 24, 2025 04:45
@philmoz
Copy link
Collaborator Author

philmoz commented Nov 24, 2025

Are there current & working instruction for setting up build on Ubuntu?
I have VM images for 20, 22 and 24 - so instructions for any of those would be appreciated.

@pfeerick
Copy link
Member

Think the only build instructions are for ubuntu 20.04 and haven't been updated since...

I would just install docker so can use a variation of docker run --name="ETXDocker" -it --rm --mount src="$(pwd)",target="/src",type=bind ghcr.io/edgetx/edgetx-dev bash to just download and use the docker build container. Otherwise, might be able to reverse engineer https://github.com/EdgeTX/build-edgetx/blob/main/dev/Dockerfile enough to get it working on 22.04 native.

@philmoz
Copy link
Collaborator Author

philmoz commented Nov 24, 2025

Ubuntu 20 won't work as it has no Qt6.
There are setup scripts for 22 and 24; but neither works.
Only Docker instructions are for Windows 10 / GWSL (currently trying this; but having to reboot into bootcamp is a pain).

@philmoz
Copy link
Collaborator Author

philmoz commented Nov 24, 2025

Crash should be fixed by PR #6825. I will rebase this when that PR is merged.

@philmoz philmoz force-pushed the philmoz/backlight-source branch 3 times, most recently from 25ef5fe to a7e297e Compare December 1, 2025 04:20
@philmoz philmoz force-pushed the philmoz/backlight-source branch from a7e297e to 7547128 Compare December 5, 2025 22:47
@philmoz philmoz force-pushed the philmoz/backlight-source branch from 7547128 to 26d8121 Compare December 15, 2025 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B&W Related generally to black and white LCD radios color Related generally to color LCD radios enhancement ✨ New feature or request UX-UI Related to user experience (UX) or user interface (UI) behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants