Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI control text does not render #17

Closed
ghost opened this issue Dec 13, 2018 · 32 comments
Closed

UI control text does not render #17

ghost opened this issue Dec 13, 2018 · 32 comments
Assignees
Labels
bug Something isn't working discuss Discussing the issue
Milestone

Comments

@ghost
Copy link

ghost commented Dec 13, 2018

Testing with 1.1.4, control text is not rendering. When starting, for example, lsp-plugins-limiter-mono in standalone mode, only Limiter and Signal group labels are rendered but no other text is shown. After first launching the plugin, a small popup appears above the plugin UI with a black screen and a white bar:

screenshot

  • Each plugin seems to work and responds to control changes (after dismissing the blank popup).
  • Observed with every plugin that I have tried.
  • No crashes or other odd behavior is observed.
  • Same result whether running as standalone, LV2 (in Ardour) and as VST (in Reaper).
  • Same result when using an earlier version (1.1.0).
  • Same result whether using pre-built binaries or building from source.
  • No build errors when building from source.

Host info:

  • Slackware64 14.2 (Linux 4.4.14)
  • Window manager: XFCE 4.12.0
  • XFCE default theme loaded. Also tried other themes.
  • x86_64 Intel(R) Core(TM) i7-3770K
  • No other VST plugins installed. Some LV2 are installed (Carla, gx_*, and Invada), but I get the same result whether these are present or not.

Memory usage:

           total        used        free         shared  buff/cache   available
Mem:       16349904     2023184     6451080      239588     7875640    13580272
Swap:      39450708         256    39450452

Packages Installed:

  • gcc 5.5.0
  • jack 1.9.12
  • lv2 1.12.0
  • ladspa 1.13
  • expat 2.2.2
  • sndfile 1.0.26
  • cairo 1.14.6
  • glu 9.0.0
  • libGL 11.2.2 (Slackware mesa package)
  • php 5.6.38

Trace output when built with make trace is attached below (running /usr/local/bin/lsp-plugins-limiter-mono as before).

There is an error message about loading the global configuration file, but that file was created (though empty) at $HOME/.config/lsp-plugins/lsp-plugins.cfg and it has user (not root) read permissions.

trace-output.txt

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 13, 2018

Hi!

Yes, it seems to be very strange. The very small set of fonts is rendered in the UI, all other text - not.
Seems that some system font can not be found. Have you tried to install different fonts for your distribution. By default, LSP plugins use the "Sans" font. Please ensure that you have the proper font installed in your system:
https://github.com/sadko4u/lsp-plugins/blob/db70248bc4a528dc51586638e9cd71259cf14b7a/src/ui/tk/sys/LSPTheme.cpp#L26

About the empty dialog: it's just a greeting dialog that normally should look like this:
default
But due to font problems you don't see any text.

About problem loading configuration file: it's a known regression, is already fixed in the devel branch, you may check out this branch and build from source.

@sadko4u sadko4u added the discuss Discussing the issue label Dec 13, 2018
@ghost
Copy link
Author

ghost commented Dec 13, 2018

Thanks! Yes, it definitely looks like a font problem. I have OpenSans installed:

screenshot-1

I added an lsp_trace statement below that line in LSPTheme.cpp (using devel branch) and verified that pFont->set_name("Sans") is being called.

I'll try installing some other font packages next.

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

I'll try installing some other font packages next.

Is there any progress?

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

Also please try this commit: c787598
I've noticed that even if change font name in theme initialization, by default the Sans font will be used. Now you can try to change default font name in LSPTheme class to something other and check if the font appears in the UI.

@sadko4u sadko4u self-assigned this Dec 14, 2018
@ghost
Copy link
Author

ghost commented Dec 14, 2018

Thanks, but same result with this commit. Here are some things I have tried:

  • Installing other TTF font packages with different versions of Sans.
  • Changing the font in LSPTheme.cpp to other font names that I have installed (such as Arial). Also tried changing the size (i.e., pFont->set_size(10)).
  • Uninstalling additional (large) font packages such as google-fonts so there aren't too many fonts installed.
  • Running the binaries on an older Slackware 14.1 system (which uses cairo 1.12).

Can you recommend any debugging steps or extra lsp_trace calls that I can try?

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

I think you should first look at this class:
https://github.com/sadko4u/lsp-plugins/blob/github-issue-17/src/ui/ws/x11/X11CairoSurface.cpp

I think that the call of function cairo_select_font_face fails there. There are multiple methods that utilize this function but these places are only ones that control font selection and rendering.
I believe something is wrong with this call so the font subsystem becomes broken.
At least you can comment-out calls of cairo_select_font_face and see what happens.

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

Also, I want to ask additional question: what's your system default locale. The problem can be related to the locale, too. Please show me the output of command:

locale

@ghost
Copy link
Author

ghost commented Dec 14, 2018

Same result after commenting out cairo_select_font_face (in four places). It returns void so there's no straightforward way to check if it succeeds that I'm aware of.

Here is the result of running locale:

LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE=C
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

I've done additional commit: 08bf812
Don't think that it will solve the problem but it would be a good try.
Second, we need to ensure that all font functions in X11CairoSurface receive valid strings in const char *text parameter. I think, it would be good to trace them with lsp_trace.

@ghost
Copy link
Author

ghost commented Dec 14, 2018

As you suspected, still no change with that commit. I'll sprinkle some lsp_trace calls throughout X11CairoSurface method calls to see what kind of text is being passed in.

@ghost
Copy link
Author

ghost commented Dec 14, 2018

So far, tracing the calls to cairo_select_font_face reveal nothing strange: the second argument (returned by f.get_name()) is always returning a valid string such as Arial or Sans.

I also tried passing in cairo:monospace (which, according to the api doc) should cause cairo to use an internal font family. Also tried sans-serif. Still, no text is displayed.

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

Was the text passed at the same time correct? I mean Have you seen the text that should be rendered in the console?
Also, please check whether the text over the group (Limiter and Signal on the screenshot) has disappeared or not.

@ghost
Copy link
Author

ghost commented Dec 14, 2018

Looks like you're onto something! Here's an output of tracing the text being passed into every call to cairo_show_text in that file:

[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text:
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: -inf
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: 0.00
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: -inf
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: -inf
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: ----------------
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: ----------------
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: ----------------
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: Limiter
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: Signal
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text:
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text:
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: -inf
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: 0.00
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: -inf
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: -inf
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: ----------------
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: ----------------
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: ----------------
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: Limiter
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text: Signal
[TRC][X11CairoSurface.cpp: 585] out_text: passed to cairo_show_text:

Limiter and Signal are being displayed (as well as -inf and 0.00).

@ghost
Copy link
Author

ghost commented Dec 14, 2018

Tracing calls to cairo_text_extents next ...

@ghost
Copy link
Author

ghost commented Dec 14, 2018

Text passed to cairo_text_extents:

[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents:
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents: WWW0
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents: +99.9
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents: +99.9
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents: +99.9
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents: +99.9
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents: Limiter
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents: Signal
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents:
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents: WWW0
[TRC][X11CairoSurface.cpp: 557] get_text_parameters: passed to cairo_text_extents:

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

Related to Limiter: do you see other messages in log: 'SC Preamp', 'Lookahead', 'Threshold', etc. like labels on this picture:
default

Another idea: maybe cairo is properly rendering font but it is too small because of DPI settings.
To obtain your screen DPI, you can launch the command:

xdpyinfo | grep -B 2 resolution

Mine is:

screen #0:
  dimensions:    1920x1080 pixels (609x343 millimeters)
  resolution:    80x80 dots per inch

Also it would be good to know what does X11CairoCanvas store into *tp in get_text_parameters function:

                tp->XBearing        = te.x_bearing;
                tp->YBearing        = te.y_bearing;
                tp->Width           = te.width;
                tp->Height          = te.height;
                tp->XAdvance        = te.x_advance;
                tp->YAdvance        = te.y_advance;

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

Also it would be good to see how unit test for the LSPString behave. This can be done:

make clean
make test
.build/lsp-plugins-test utest core.lspstring --verbose

You should get something similar:

--------------------------------------------------------------------------------
Launching unit test 'core.lspstring'
--------------------------------------------------------------------------------
s1 = This is some text
s2 = Всем привет!
s3 = 涼宮ハルヒの憂鬱:第一章.
s4 = ￐メ￑チ￐ᄉ￐ᄐ ￐﾿￑タ￐ᄌ￐ᄇ￐ᄉ￑ツ!
s5 = This is some text
s3 = some
s4 = some
s5 = 
s3 = SOME
s1 = THIS IS SOME TEXT
s4 = 
s1 = SOME
s3 = THIS IS SOME TEXT
s4 = 
s1 = ABAABBAAABBBAAAABBBB
s2 = CCCC
s3 = CC
s4 = abaaccccbbccccaaabbbaaaabbbb
s1 = ABAACCCCBBAAABBBAAAABBBB
s1 = ABAACCCCBBCCCCAAABBBAAAABBBB
s5 = BBBBCCCC
s4 = CCABAACCCCBB
s1 = ABAACCCCBBCCCCAAABBBAAAABBBBCCCC
s1 = CCABAACCCCBBCCCCAAABBBAAAABBBBCCCC
Unit test 'core.lspstring' finished, status=0
Unit test 'core.lspstring' execution time: 0.00 s

@ghost
Copy link
Author

ghost commented Dec 14, 2018

This is all that I am seeing currently:

screenshot-1

I have a dual monitor setup, here's the output of xdpyinfo | grep -B 2 resolution:

screen #0:
  dimensions:    3840x1200 pixels (1049x321 millimeters)
  resolution:    93x95 dots per inch

Here's the result of the unit tests - doesn't look good:

--------------------------------------------------------------------------------
Launching unit test 'core.lspstring'
--------------------------------------------------------------------------------
s1 = (null)
s2 = (null)
s3 = (null)
s4 = (null)
s5 = (null)
s3 = (null)
s4 = (null)
s5 = 
s3 = (null)
s1 = (null)
s4 = 
s1 = (null)
s3 = (null)
s4 = 
s1 = (null)
s2 = (null)
s3 = (null)
s4 = (null)
s1 = (null)
s1 = (null)
s5 = (null)
s4 = (null)
s1 = (null)
s1 = (null)
Unit test 'core.lspstring' finished, status=0
Unit test 'core.lspstring' execution time: 0.00 s

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

Wow, it seems that we've found a problem. Seems that LSPString is behaving badly: get_native() method returns null.

@ghost
Copy link
Author

ghost commented Dec 14, 2018

Looks like LSPString is getting null strings - here's a trace of the charset (third arg) being passed into LSPString::get_native:

[TRC][LSPString.cpp:1486] get_native: passed into get_native: (null)
[TRC][LSPString.cpp:1486] get_native: passed into get_native: (null)
[TRC][LSPString.cpp:1486] get_native: passed into get_native: (null)
[TRC][LSPString.cpp:1486] get_native: passed into get_native: (null)
[TRC][LSPString.cpp:1486] get_native: passed into get_native: (null)
[TRC][LSPString.cpp:1486] get_native: passed into get_native: (null)
...
[TRC][LSPString.cpp:1486] get_native: passed into get_native: (null)

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

The problem was the reason of invalid system character set detection.
Your locale has LC_CTYPE="en_US" but character set detector considered that locale should always be "lang_COUNTRY.CHARSET". By simply changing locale to yours I've reproduced the problem:

export LC_CTYPE="en_US"
.build/lsp-plugins-test utest core.lspstring --verbose

This commit should completely fix the problem: 75a56f5

@ghost
Copy link
Author

ghost commented Dec 14, 2018

I'm not seeing calls to LSPString::set_ascii(), but calls to LSPString::set_native look like this:

[TRC][LSPString.cpp:1319] set_native: passed into set_native: Begrenzer Mono: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Export settings...: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Import settings...: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Toggle rack mount: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: LSP  B1M: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: LSP: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Bypass: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: B1M: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 0 dB: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: -12: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: -24: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: -36: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: s: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 0: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 0.5: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 1: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 1.5: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 2: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 2.5: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 3: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: 3.5: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Pause: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Clear: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Mode:: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Classic: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Herm Thin: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Herm Wide: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Herm Tail: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Herm Duck: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Exp Thin: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Exp Wide: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Exp Tail: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Exp Duck: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Line Thin: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Line Wide: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Line Tail: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Line Duck: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Mixed Herm: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Mixed Exp: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Mixed Line: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: O/S:: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: None: (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Half x2(2L): (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Half x2(3L): (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Half x3(2L): (null)
[TRC][LSPString.cpp:1319] set_native: passed into set_native: Half x3(3L): (null)

So, yeah, something is apparently getting lost in LSPString.

@ghost
Copy link
Author

ghost commented Dec 14, 2018

Cool, I'll give it a shot ...

@ghost
Copy link
Author

ghost commented Dec 14, 2018

Fixed!

screenshot-2

Thank you sir! I am looking forward to trying out your awesome collection of plugins.
Best regards.

@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

Merged changes into devel branch: f36712d
Please use this commit because I've additionally fixed possible memory corruption problem in just refactored code.

@sadko4u sadko4u added the bug Something isn't working label Dec 14, 2018
@sadko4u sadko4u added this to the 1.1.5 milestone Dec 14, 2018
@sadko4u
Copy link
Collaborator

sadko4u commented Dec 14, 2018

Closing the issue. Changes will be in the upcoming 1.1.5 release.

@sadko4u sadko4u closed this as completed Dec 14, 2018
schnitzeltony added a commit to schnitzeltony/meta-musicians that referenced this issue Apr 25, 2019
* Steal the tune approach from [1] to create BUILD_PROFILE
* Add LDFLAGS to library builds

+ First time lsp-plugins don't crash \o/
- No texts are displayed - maybe [2] helps

[1] http://lists.openembedded.org/pipermail/openembedded-devel/2019-April/199347.html
[2] lsp-plugins/lsp-plugins#17

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
@schnitzeltony
Copy link

Sorry to get back to this.

Some background: Am building lsp-plugins with Openemenbedded/Yocto for a while. With 1.19 and some tweaks here and there it is the first time lsp-plugins don't crash immediately and seem to work (haven't listened yet...).

But unfortunately I don't see texts either.

After reading this thread I did some remote debugging and checked what

iconv_t init_iconv_to_wchar_t(const char *charset)

does. Have LANG=en_US.utf8 and it seems

            // Get system locale
            current = setlocale(LC_CTYPE, "");
            if (current != NULL)
                current = strchr(current, '.');

is doing the wrong thing:

lsp-charset

current ends up with '.utf8'. Isnt't there a thinko - shouln't it contain 'en_US'?

@sadko4u
Copy link
Collaborator

sadko4u commented Apr 27, 2019

No, it's a correct behaviour: we need to know the character set, so we need the ".utf8" string, not "en_US". But there can be another problem: it is possible that iconv function does not know anything about the 'utf8' character set because proper name of character set is 'UTF-8'. I've noticed this when got some locale tests crashing under FreeBSD.

@schnitzeltony
Copy link

Since my first post you are likely aware that I am an internationalization-rooky.

After endless debug sessions I found:

lsp-charset

On my Raspi it seems there are no charset conversions available: gconv_cache is NULL! Honestly I have no idea yet what is missing but I hacked it to work by disabling all the runtime iconv character conversion:

0001-Hack-remove-runtime-charset-conversions.patch.txt

@sadko4u
Copy link
Collaborator

sadko4u commented Apr 28, 2019

That's a quite dirty hack.
Let's examine the problem.
What's your system version?
Do you have /usr/lib[64]/gconv files on your system?

@sadko4u
Copy link
Collaborator

sadko4u commented Apr 28, 2019

Also try to run iconvconfig as a superuser and try plugins without your patch again.

@schnitzeltony
Copy link

That's a quite dirty hack.

Yeah - BUT I WANT LSP-PLUGINS ON RASPI :)

Let's examine the problem.
What's your system version?
Do you have /usr/lib[64]/gconv files on your system?

This seems the problem: I have only few libs there: CP1252.so / IBM*.so / ISO8859-*.so and no gconv-modules.cache

With your information, there is hope to find a way back to the path of goodness...

Thanks for support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discuss Discussing the issue
Projects
None yet
Development

No branches or pull requests

2 participants