Board index FlightGear Development Canvas

Multi-threaded FlightGear/OSG and Canvas flickering solved

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Multi-threaded FlightGear/OSG and Canvas flickering solved

Postby SurferTim » Thu Aug 12, 2021 12:01 pm

I have a Ubuntu 18.04LTS system on an Intel I-7 with 16Gb memory and a GTX1050TI video card with 3 displays.

The glass panels flicker like I'm on LSD. At first I thought it was just the CitationX, but the Falcon 50 and the Airbus 320 flicker also.
It happens only in multi-display mode.

Here is the flicker in the Patten hangar Citation I found with FG2019.2.0, and later versions. My last try was FG2020.4.0.
clm76 tried to help me set up a new glass panel in the CitationX I use, and it has the same problem, except it ends in a FG crash back to the Ubuntu desktop after a minute or two.


Anybody else having this issue? If not, what must I do short of spending a couple thousand dollars on computer upgrades?

X-Plane glass panels work fine on my computer.
Last edited by SurferTim on Mon Aug 23, 2021 4:49 pm, edited 1 time in total.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1712
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: NDCanvas flickering problem

Postby merspieler » Thu Aug 12, 2021 2:03 pm

What do you mean by "multi-display mode"? How do you set that up?
Anybody else having this issue?

I'm getting that effect, when I use the clone view of the new compositeviewer.
Using i3wm to make fg span all 3 screens I don't have this issue (wiki article)
So it's something configuration related...

If not, what must I do short of spending a couple thousand dollars on computer upgrades?

No, you don't cause it has nothing to do with your hardware.


(Oh... and a few hundred bucks, spend wisely, can go a long way ;-) )
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2244
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: NDCanvas flickering problem

Postby SurferTim » Thu Aug 12, 2021 2:22 pm

You may be right. It seems to be most prevalent when there is a glass panel in more than one display.
My displays are split to three windows (one for each display) and three cameras (one for each window).
So far, it has worked well, til now.

Edit: And I have used up all my "few hundred dollars goes a long way" options.
I'll give your setup a try and let you know how it went. It will be a while. A/C is down, and it's gonna be 95f (35c) today.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1712
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: NDCanvas flickering problem

Postby Hooray » Thu Aug 12, 2021 3:21 pm

Thanks for reporting the issue, ideally please use the issue tracker to file a ticket here: https://sourceforge.net/p/flightgear/codetickets/

Like you said, this is specific to CompositeViewer setups: https://wiki.flightgear.org/CompositeVi ... imitations

It would be good to know if all Canvas placements are affected or not (desktop placements (tooltips), GUI dialogs, Canvas embedded in PUI dialogs or Cockpit/Scenery placements).

If in doubt, use a self-contained test case by running one of the Canvas snippets in a multi-screen setup to see if you can reproduce the issue: https://wiki.flightgear.org/Canvas_snip ... e_tile_map

If such snippets also trigger the same problem, the issue is not specific to cockpit placements.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: NDCanvas flickering problem

Postby SurferTim » Thu Aug 12, 2021 3:49 pm

I wanted to ensure it was an issue before filing a ticket. Good thing I checked here first. It may not be an issue, just my FG config setup.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1712
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: NDCanvas flickering problem

Postby merspieler » Thu Aug 12, 2021 4:26 pm

Hooray wrote in Thu Aug 12, 2021 3:21 pm:Like you said, this is specific to CompositeViewer setups: https://wiki.flightgear.org/CompositeVi ... imitations


Actually... there has been a multi camera setup before compositor/compositeviewer which seems to be his case since he mentions 2019.2.0
See $FGDATA/Docs/README.multiscreen

While it didn't work to my expectations, I don't remember any canvas issues with it.

I'll give it a quick test

EDIT: So I couldn't get my old xmls loading at all... always running into "double free or corruption (!prev)"

Tim would you mind, sharing your config?
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2244
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: NDCanvas flickering problem

Postby SurferTim » Thu Aug 12, 2021 4:44 pm

I've been trying on a few FG versions. I remember FG2019.2.0 because it was my first working compiled version thanks to legoboyvdlp. I tried with FG2020.3.3 (ALS rendering) and FG2020.4.0.

To use the original nd (not the canvas) installed on the original Citation by Syd Adams, I still use FG2019.2.0.

I liked the Patten version Citation, but I couldn't get it to run for more than 30 minutes or so.

Edit: This is the new config.xml file. I had to modify it slightly from my original for FG2020.4.0. Three displays, 1920x1080.
And yes, the "double free or corruption" error is how it aborts FG on all my attempts.
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PropertyList>
  <sim>
    <menubar>
      <visibility type="bool">true</visibility>
    </menubar>

    <rendering>
      <draw-mask>
        <aircraft type="bool">true</aircraft>
      </draw-mask>

      <multithreading-mode>AutomaticSelection</multithreading-mode>
      <!--multithreading-mode>SingleThreaded</multithreading-mode-->
      <!--multithreading-mode>DrawThreadPerContext</multithreading-mode-->
      <!--multithreading-mode>CullDrawThreadPerContext</multithreading-mode-->
      <!--multithreading-mode>CullThreadPerCameraDrawThreadPerContext</multithreading-mode-->

      <camera-group>

        <window>
          <name type="string">HalfLeft</name>
          <host-name type="string"></host-name>
          <fullscreen type = "bool">false</fullscreen>
          <decoration type = "bool">false</decoration>
          <x>0</x>
          <y>0</y>
          <width>1920</width>
          <height>1080</height>
        </window>

        <window>
          <name type="string">Front</name>
          <host-name type="string"></host-name>
          <fullscreen type = "bool">false</fullscreen>
          <decoration type = "bool">false</decoration>
          <x>1920</x>
          <y>0</y>
          <width>1920</width>
          <height>1080</height>
        </window>

        <window>
          <name type="string">HalfRight</name>
          <host-name type="string"></host-name>
          <fullscreen type = "bool">false</fullscreen>
          <decoration type = "bool">false</decoration>
          <x>3840</x>
          <y>0</y>
          <width>1920</width>
          <height>1080</height>
        </window>

        <gui>
          <window>
            <name type="string">Front</name>
          </window>
        </gui>

        <camera>
          <name type="string">Front</name>
          <window>
           <name>Front</name>
          </window>

          <view>
            <heading-deg type = "double">0.0</heading-deg>
            <roll-deg type = "double">0.0</roll-deg>
            <pitch-deg type = "double">0.0</pitch-deg>
          </view>

          <master-perspective>
            <eye-distance type="double">0.8</eye-distance>
<!--
            <x-offset type="double">-0.05</x-offset>
-->
            <y-offset type="double">+-0.10</y-offset>
          </master-perspective>

          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1920</width>
            <height>1080</height>
          </viewport>
          <physical-dimensions>
            <width>0.520</width>
            <height>0.325</height>
            <bezel>
              <top>0.045</top>
              <left>0.021</left>
              <bottom>0.021</bottom>
              <right>0.021</right>
            </bezel>
          </physical-dimensions>
        </camera>

        <camera>
          <name type="string">HalfLeft</name>
          <window>
           <name>HalfLeft</name>
          </window>

          <view>
            <heading-deg type = "double">35.0</heading-deg>
            <roll-deg type = "double">3.0</roll-deg>
            <pitch-deg type = "double">0.0</pitch-deg>
          </view>

          <left-of-perspective>
            <parent-camera>Front</parent-camera>
          </left-of-perspective>

          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1920</width>
            <height>1080</height>
          </viewport>
          <physical-dimensions>
            <width>2.0</width>
            <height>1.60</height>
            <bezel>
              <top>0.045</top>
              <left>0.01</left>
              <bottom>0.01</bottom>
              <right>0.01</right>
            </bezel>
          </physical-dimensions>
        </camera>

        <camera>
          <name type="string">HalfRight</name>
          <window>
           <name>HalfRight</name>
          </window>

          <view>
            <heading-deg type = "double">-25.0</heading-deg>
            <roll-deg type = "double">-2.0</roll-deg>
            <pitch-deg type = "double">0.0</pitch-deg>
          </view>

          <right-of-perspective>
            <parent-camera>Front</parent-camera>
          </right-of-perspective>

          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1920</width>
            <height>1080</height>
          </viewport>
          <physical-dimensions>
            <width>1.7</width>
            <height>1.00</height>
            <bezel>
              <top>0.045</top>
              <left>0.01</left>
              <bottom>0.01</bottom>
              <right>0.01</right>
            </bezel>
          </physical-dimensions>
        </camera>

      </camera-group>
    </rendering>

  </sim>
</PropertyList>
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1712
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: NDCanvas flickering problem

Postby merspieler » Thu Aug 12, 2021 5:13 pm

I get the same crashes as with my config... I only have anup-to-date next to test tho...

I know it worked like that on older version....
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2244
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: NDCanvas flickering problem

Postby SurferTim » Thu Aug 12, 2021 5:57 pm

As I recall, when I was trying to set up my displays, there were two approaches.
One window, three cameras.
Three windows, three cameras.

Is there a "one window, one camera" setup?

I couldn't overcome the edge distortion with one window. It might have been just me. I used the three windows approach.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1712
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: NDCanvas flickering problem

Postby merspieler » Thu Aug 12, 2021 8:49 pm

SurferTim wrote in Thu Aug 12, 2021 5:57 pm:Is there a "one window, one camera" setup?

I couldn't overcome the edge distortion with one window. It might have been just me. I used the three windows approach.


There is, but there's the distortion... I've written some postprocessing to compensate for that but then the click spots were off.

The next attempt (using a cubemap) is still in a broken wip state...
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2244
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: NDCanvas flickering problem

Postby SurferTim » Thu Aug 12, 2021 9:11 pm

So my best option is I3 for now? Or is that the fix?
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1712
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: NDCanvas flickering problem

Postby merspieler » Thu Aug 12, 2021 9:16 pm

If you can live with the distortion, i3 is the easiest way...

I haven't checked but the one window/3 cameras thing might be an option too, if it works... for me it had other distortions and since I a) rather frequently switch from one screen fullscreen to 3 screens full screen resulting in greatly variing fovs and b) I use i3 as my only window manager it was the best choice for me.

If i3's the best choice for you too isn't up to me to decide ;-)
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2244
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: NDCanvas flickering problem

Postby SurferTim » Thu Aug 12, 2021 10:36 pm

It was up to chance.
The i3 app won't work. The nVidia GTX1050TI video card controller won't let it run.
It also appears the nVidia controller won't let me combine all the screens into one big screen, so using one window in the config doesn't work.
I'll work on it.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1712
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: NDCanvas flickering problem

Postby Hooray » Thu Aug 12, 2021 10:54 pm

Referring to merspieler's comments, @SurferTim: Could you please report/confirm whether the issue is unrelated/specific to the CompositeViewer mode ?
The point being, the issue has been previously reported in the context of CV usage - however, if this can be reliably reproduced/triggered without CV, it's more likely related to the common APIs underlying both approaches, i.e. CameraGroup & friends.

Also, we do have an actual issue at this point, so using the issue tracker to file a ticket does make sense - while the forum will get you somewhat prompt "support", that's not necessarily the best way to reach out to core developers (the devel-list is), and for tracking issues that may not be solved "soonish", it does make sense to use the ticket system, so that people can more easily track what's going on.

For now, it would definitely be helpful to know whether you're using the new CompositeViewer mode or not - if not, the issue is unrelated to the CV mode, which would be really helpful to better understand what's going on.

The background here being that the Canvas system is using slave cameras, which may be conflicting with the way multi-view setups internally work.

Also, when using the issue tracker, please report your OpenGL config (see the Help/About dialog)

If there are any placements unaffected by this (e.g. Canvas embedded in PUI), that would also be interesting to know.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: NDCanvas flickering problem

Postby SurferTim » Thu Aug 12, 2021 11:09 pm

I don't know enough about this CompositeViewer to know if I'm using it. Is it something I must select/deselect?
If it must be activated with --composite-viewer=1, I don't add that at start.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1712
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Next

Return to Canvas

Who is online

Users browsing this forum: No registered users and 2 guests