Author Topic: Linux: Text Effect is causing crash  (Read 4246 times)

Offline stampedeboss

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Linux: Text Effect is causing crash
« on: December 05, 2017, 02:08:08 AM »
I just finished confirming that what I thought was an issue with the Picture Effect causing crashes in Linux is actually an issue with the Text Effect.  In reviewing the debug detail associated with the crash, I noticed that it was reporting on  the Text Effect on Picture Effect.

To further test this theory, I made copies of the sequences I was having issues with.  After opening I immediately deleted all text effects from the sequence leaving the Picture Effects in place.  I then clicked render and it completed and played without issue.  One other observation, with the text effects in place, clicking on any effect causing it to render in the preview triggers the crash.

Offline stampedeboss

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #1 on: December 05, 2017, 02:49:58 AM »
I can now create the problem simply by opening a new sequence, either type, and adding a Text Effect on my matrix.  It doesn't abort until the new effect is clicked on and any character is keyed into the text field., therefore the issue is somewhere in the rendering of the effect to the preview.  One other item to report, it only occurs when XL Fonts is set to OS Fonts, any other setting works without an abort.
« Last Edit: December 05, 2017, 12:58:10 PM by stampedeboss »

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #2 on: December 05, 2017, 05:27:43 PM »
So the XL fonts I added are working.  That helps give a clue because I am manually drawing all those fonts.  The OS fonts are being rendered I believe by OpenGL calls but I'd need to double check.  I've been on vacation since Nov 30th.  Just came back for one day then heading back out of town in the morning.  I'll be back in the seat Dec 12th so I can't look into much before then.

Offline dkulp

  • Supporting Member
  • Hero Member
  • *
  • Posts: 812
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #3 on: December 05, 2017, 05:39:35 PM »

No, not OpenGL.   It's done via some gtk calls of some sort.   I was going to try and debug this, but my Linux Parallels  VM seems to be not working.  (haven't booted it in over a year and likely 2 parallels upgrades, so not too surprising.)   If chris doesn't get a chance to look at it, I'll try and get a new VM setup.

What version of Linux are you using?   If I need to re-install, might as well use the same version.
Daniel Kulp
Framingham, MA

Offline stampedeboss

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #4 on: December 05, 2017, 08:22:08 PM »
I actually run 3 different version of linux, Linux Mint 18.1 KDE is my main system, I've tried all three version of Mint 18.1, KDE, Mate, and Cinnamon.  I've also tried Fedora and they all have the same issue.

Offline dkulp

  • Supporting Member
  • Hero Member
  • *
  • Posts: 812
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #5 on: December 06, 2017, 12:27:46 PM »
I actually run 3 different version of linux, Linux Mint 18.1 KDE is my main system, I've tried all three version of Mint 18.1, KDE, Mate, and Cinnamon.  I've also tried Fedora and they all have the same issue.

OK.   I have this "fixed", kind of.   It's more of a hack but at least it doesn't crash.

That said, I had completely forgotten how bad the rendered fonts look on Linux.   Linux seems to ignore the flags to turn off the AntiAliasing so all the fonts look very blurry and crappy.   I looked into that years ago and never could figure out how to convince the Linux stuff to not antialias the fonts. 
Daniel Kulp
Framingham, MA

Offline cybi257

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #6 on: December 07, 2017, 06:37:42 PM »
While I am not having any issues with the Picture effect with the AppImage version, I still have the issue with the test effect.

Occurs when I do one of the following:
1 - Click in the text box and first character I enter
2- Have characters entered and change to OS Fonts.

I successfully compiled the source in Code:Blocks on the exact 16.10 Ubuntu fresh install as was mentioned in the Linux Build Help file.

Tried to track down the call, but I'm not very good with debugging in C/C++, so I am having mixed results on where this could be corrected. Mainly adding information here to add to any potential fix.

dkulp: You mentioned a "hack". I'm interested. Are you saying there is a setting that you are changing for the anti-aliasing for the fonts? Where exactly is this that you are changing. I'm down for any information that may help me locate more of a 'fix' than a hack, if possible.

xLights is where it's at, and while Gil doesn't agree (just picking on ya Gil, lol) I prefer LInux over Windows any day. It just does everything I need it to and some with me controlling what it does, not Microsoft thinking that they know what "I" want and should have. :/ So, I am willing to put the efforts in any way that I can to help improve and already great tool. And, this reminds me, I need to get my donation in still. :)

-Tim

Offline dkulp

  • Supporting Member
  • Hero Member
  • *
  • Posts: 812
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #7 on: December 07, 2017, 06:49:21 PM »

The crash is actually due to a structure not being initialized within wxWidgets when a wxGraphicsFont is created.   The internal wxFont is not valid and thus it crashes within the call to GetPartialTextExtents.   I need to log a bug with wxWidgets.

The hack was basically to set the wxFont also on the wxDC and use the metrics from that.   However, the metrics aren't exactly the same so I had to scale it a bit.   

Note:  if you only set a single color for the Text effect before entering any characters, it shouldn't crash either.   I believe this is only hit for the case where multiple colors are selected.

Regarding the antialiasing - I haven't figure out how to get non-antialiased text on Linux at all.  On OSX, we call ctx->SetAntialiasMode(wxANTIALIAS_NONE) and that turns it off for the font rendering, that doesn't work on Linux.   On MSW, we have to hack into the native font string and flip a flag.   Someone familiar with the pango code might need to submit a patch to wxWidgets or something.   No idea.   

Dan


While I am not having any issues with the Picture effect with the AppImage version, I still have the issue with the test effect.

Occurs when I do one of the following:
1 - Click in the text box and first character I enter
2- Have characters entered and change to OS Fonts.

I successfully compiled the source in Code:Blocks on the exact 16.10 Ubuntu fresh install as was mentioned in the Linux Build Help file.

Tried to track down the call, but I'm not very good with debugging in C/C++, so I am having mixed results on where this could be corrected. Mainly adding information here to add to any potential fix.

dkulp: You mentioned a "hack". I'm interested. Are you saying there is a setting that you are changing for the anti-aliasing for the fonts? Where exactly is this that you are changing. I'm down for any information that may help me locate more of a 'fix' than a hack, if possible.

xLights is where it's at, and while Gil doesn't agree (just picking on ya Gil, lol) I prefer LInux over Windows any day. It just does everything I need it to and some with me controlling what it does, not Microsoft thinking that they know what "I" want and should have. :/ So, I am willing to put the efforts in any way that I can to help improve and already great tool. And, this reminds me, I need to get my donation in still. :)

-Tim
Daniel Kulp
Framingham, MA

Offline cybi257

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #8 on: December 08, 2017, 05:30:46 PM »
Well, now that makes a lot more sense now. I have been able to use text at times with OS Fonts, but couldn't ever figure out why not all the time. The colors. :)

Nice information! That helps out more than ever. I honestly could live perfectly fine with single color.

Also, I agree on the wxWidgets bug. I recall seeing that during debugging. Was thinking it was something with that myself. I had a tough time thinking it was strictly code for xLIghts as it works fine on Windows, thus, should with Linux, for the actual xLights code itself. I figured it was looking more like and issue with something outside of xLights, specific to Linux.

Thanks for sharing that.

Offline dkulp

  • Supporting Member
  • Hero Member
  • *
  • Posts: 812
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #9 on: December 08, 2017, 05:38:05 PM »

If interested, the bug is logged:

https://trac.wxwidgets.org/ticket/18021

along with a proposed patch.    We'll see if they do anything with it.  :(

Daniel Kulp
Framingham, MA

Offline cybi257

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #10 on: December 10, 2017, 03:50:48 PM »
Look like they fixed this issue. I don't see a new Repo version of the xLight Linux for .40, nor an Appimage, but I did a GIT pull (clone) and built on my system with the updated wxWidgets and all seems good to go.

Now running xLight 2017.40 (though it tells me I'm running an old version and that .39 is available, lol), and able to use the text effect with multiple colors and no crashing! :)

-Tim

Offline stampedeboss

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #11 on: December 12, 2017, 07:24:28 AM »
Same here problem appears to be resolved. 


Sent from my iPhone using Tapatalk Pro

Offline debenham

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #12 on: December 12, 2017, 01:23:57 PM »
2017.41 is released now (I missed making packages etc for 2017.40)
Can you test it out and see if it works okay - if not I can make it so that it automatically applies the fix from https://trac.wxwidgets.org/ticket/18021 to the wxwidgets build it uses to see it that helps?

Offline stampedeboss

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #13 on: December 13, 2017, 11:27:21 AM »
Just tried 41 without success, it aborted while building the fseq file as it did before.

Offline debenham

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Linux: Text Effect is causing crash
« Reply #14 on: December 13, 2017, 01:58:46 PM »
I'm changing the build of wxwidgets included in the xLights package/appimage to have the fix from https://github.com/wxWidgets/wxWidgets/commit/aa4d51d57945cefac0d1b33324f9a2d82795fe43 included.
Can you please send me a sample sequence which is failing for you so I can test it too?