Footprints not always shown in Footprint Chooser (MSW & GTK)

Bug #1824505 reported by Paul van der hoeven
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Unassigned

Bug Description

When adding footprints in Pcbnew (Press "o" shortcut and click on canvas) the "Choose Footprint" window is opened.

When a footprint is selected from the tree in the left area, the footprint is not always shown on the black footprint area on the right.

When I move the mouse into the black drawing area, or when the "Choose Footprint" window looses focus the footprint is drawn.

This happens in Windows and with Linux.

I am also affected by this from a topic started by another user:
https://forum.kicad.info/t/footprints-not-showing-in-browser-nor-chooser/16310

Application: kicad
Version: 5.1.0+dfsg1-1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-4-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: Clang 7.0.1 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Tags: pcbnew
Revision history for this message
Jeff Young (jeyjey) wrote :

I can't reproduce this on OSX.

When it doesn't show, is there text in the footprint area? Does it say "No footprint selected", "Loading...", or nothing at all?

Revision history for this message
Paul van der hoeven (paulvdh) wrote :

There is no visible text that indicates any error or "loading..."

A day after the bug report I added a 30 second screen capture video with the symptom on the KiCad forum.

Direct link:
https://kicad-info.s3.dualstack.us-west-2.amazonaws.com/original/2X/5/5737f136776b4a809dc59dd7171bfca83dd8325d.mkv

After that I did some more experiments and from subtle things in it's behaviour I get a strong feeling that the part gets loaded from the library, but the screen does not get a refresh.

It may be a race condition that the screen is refreshed a few ms before the part is ready to be shown.

Some of the components are shown the first time, when I go through a list of components with the cursor keys or click on them, then the first time not all components are shown, but the 2nd time the components are always shown. This also seems logical for a race condition.

My PC is also 11 years old now and pretty slow (E6550), 4666bogomips and a passmark rating of 1500. A decent PC nowadays is about 8x faster then my old workhorse.

Revision history for this message
Paul van der hoeven (paulvdh) wrote :

Addition:

I noticed that the text info window below the search tree is always updated with the new component info, even when the graphic area for the footprint stays black.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I narrowed this down. It only happens when using the down arrow key to navigate the footprint list and the footprint hasn't been loaded from the file. Once the footprint has been loaded, then the down arrow key will show the footprint. Interestingly, moving the cursor after pressing the down arrow key will cause the footprint panel to redraw and show the footprint. Here are the steps to reproduce:

1) Select the place footprint tool and click on the board to launch the footprint chooser.
2) Expand any library and select the first footprint, no footprint is shown.
3) Move the cursor in the footprint panel, the footprint is now show.
4) Hit the down arrow key to select the next footprint in the library, no footprint shown.
5) Move the cursor in the footprint panel, the footprint is now show.
6) Repeat steps 4 and 5, same behavior.
7) Hit the up arrow key to select previously selected footprints, footprint is always shown.
8) Hit the down arrow key to select the next footprint, footprint is always shown until the next footprint that hasn't been loaded is select. Footprint is not show.

I'm not sure if this is linux specific or not but I confirmed it on linux. Please ignore the dirty flag in the version string, I'm working on the road maps so there are no code changes in my build.

Application: kicad
Version: (5.1.2-16-gc56e540e5-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-4-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.62.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: Clang 7.0.1 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Changed in kicad:
status: New → Triaged
importance: Undecided → Low
milestone: none → 5.1.3
Revision history for this message
Jeff Young (jeyjey) wrote :

@Wayne, the footprint loader/renderer is multi-threaded. When arrowing down it will push the footprint to be loaded into the queue, and then will receive an event when it's ready. When arrowing up they're already loaded, so they're just drawn.

Put a breakpoint where we fire the wxEVT_COMMAND_TEXT_UPDATED event in footprint_preview_panel.cpp:224 and see if it fires. That's the thread saying it's finished loading the footprint.

You can also put one in FOOTPRINT_PREVIEW_PANEL::OnLoaderThreadUpdate() which should be capturing the above event and then drawing the footprint.

tags: added: pcbnew
Changed in kicad:
milestone: 5.1.3 → 5.1.4
Changed in kicad:
milestone: 5.1.4 → 5.1.5
Jeff Young (jeyjey)
summary: - Footprints not always shown in Footprint Chooser
+ Footprints not always shown in Footprint Chooser (MSW & GTK)
Revision history for this message
Seth Hillbrand (sethh) wrote :

I suspect that this has been resolved. I can no longer repeat it using Wayne's steps. Anyone still seeing it?

Changed in kicad:
status: Triaged → Incomplete
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

It appears to be fixed in the master and 5.1 branches at least on MSW. It also appears to be fixed in 5.1.4 so I'm setting this to fix released. If someone can reproduce it, please set it back to confirmed.

Changed in kicad:
status: Incomplete → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.