SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-08-2016, 03:39 PM
troll5501 troll5501 is offline
Sage Advanced User
 
Join Date: Jun 2006
Posts: 136
Freetype Font UnsatisfiedLinkError in Linux

I've been investigating another issue in V9 on Linux. When my extender connects, I get a bunch of these errors:

Code:
Tue 2/2 0:26:10.529 [MiniUIServerConnection@1decba4d] Error loading Freetype Font; trying to load Java font instead; error=java.lang.UnsatisfiedLinkError: sage.FreetypeFont.loadFreetypeLib0()J
I've tracked down the issue to the leading underscores in the JNICALL functions in native/crosslibs/Freetype/sage_FreetypeFont.c and sage_FreetypeFont.h. If I remove the leading underscores and rebuild the library, the issue is resolved.

Interestingly, there is another copy of the sage_FreetypeFont.h file in native/include that does *not* have the leading underscores.

Can anyone confirm if removing the leading underscores is the correct fix, and will it cause any problems for the Windows build? I can't find any other code in the project that has them.
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage
SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit
Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender
Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7
Reply With Quote
  #2  
Old 02-09-2016, 03:42 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
Yeah, that fixes the problem. I never figured out why this was an issue...but did figure out how to fix it (just like you).

I'm fairly sure you need the underscores for the Windows version though...but what's very odd is the other GNU stuff compiled on Windows with JNI didn't have that issue (imageloader library). This one was totally a mystery to me.

If you want to make a version of it that's conditional on OS for the underscores, I'd definitely approve that commit.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #3  
Old 02-10-2016, 03:01 AM
troll5501 troll5501 is offline
Sage Advanced User
 
Join Date: Jun 2006
Posts: 136
I think I figured this out. Using gcc/MinGW, I was able to build a working Windows DLL from the same code I used on Linux--without the underscores--and it works fine in V7.1.9 on XP. The issue appears to be related to some linker options that are needed to satisfy the underscore requirement for Windows.

I built two versions of the DLL using different linker options. The first one used similar options to what was in the original Makefile.win, and it failed when I tested it in SageTV:

Code:
Wed 2/10 3:19:34.181 [AWT-EventQueue-0@888e6c] Error loading Freetype Font; trying to load Java font instead; error=java.lang.UnsatisfiedLinkError: sage.FreetypeFont.loadFreetypeLib0()J
Wed 2/10 3:19:34.270 [AWT-EventQueue-0@888e6c] Error loading Freetype Font; trying to load Java font instead; error=java.lang.UnsatisfiedLinkError: sage.FreetypeFont.loadFreetypeLib0()J
Wed 2/10 3:19:34.270 [AWT-EventQueue-0@888e6c] Error loading Freetype Font; trying to load Java font instead; error=java.lang.UnsatisfiedLinkError: sage.FreetypeFont.loadFreetypeLib0()J
Then I changed the linker options, and this time it worked:

Code:
Wed 2/10 3:21:33.668 [AWT-EventQueue-0@888e6c] Creating new FreeType font face for fonts\DejaVuSans size=15 style=0 from=C:\Program Files\SageTV\SageTV\fonts\DejaVuSans.ttf
Wed 2/10 3:21:33.670 [AWT-EventQueue-0@888e6c] Loading new font to cache font=MetaFont[fonts\DejaVuSans, size=15, style=0, height=17.0, ascent=14.0, descent=4.0, leading=-1.0, class=class sage.FreetypeFont]
Wed 2/10 3:21:33.697 [AWT-EventQueue-0@888e6c] Deriving FreeType font face for fonts\DejaVuSans size=22 style=0 from=C:\Program Files\SageTV\SageTV\fonts\DejaVuSans.ttf
I will organize my changes and get them submitted soon.
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage
SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit
Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender
Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7
Reply With Quote
  #4  
Old 02-10-2016, 07:59 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by troll5501 View Post
I think I figured this out. Using gcc/MinGW, I was able to build a working Windows DLL from the same code I used on Linux--without the underscores--and it works fine in V7.1.9 on XP. The issue appears to be related to some linker options that are needed to satisfy the underscore requirement for Windows.
Unrelated, but, related to minggw did you run this from linux or windows? I'd like to get the various cross platform libs recompiling (for windows) but on linux host. I know it's possible, I just haven't done it. Wondering if you were on windows using mingw or on linux.
Reply With Quote
  #5  
Old 02-10-2016, 01:14 PM
troll5501 troll5501 is offline
Sage Advanced User
 
Join Date: Jun 2006
Posts: 136
Quote:
Originally Posted by stuckless View Post
Unrelated, but, related to minggw did you run this from linux or windows? I'd like to get the various cross platform libs recompiling (for windows) but on linux host. I know it's possible, I just haven't done it. Wondering if you were on windows using mingw or on linux.
I ran it from Windows 7. I've never tried the cross-platform compile either, but it sounds like it would be helpful.
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage
SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit
Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender
Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Font question Ikarius SageTV Studio 1 09-02-2009 06:54 AM
Linux (Ubuntu 7.10) - Placeshifter font too long ltitran SageTV Linux 9 04-09-2008 06:00 AM
Placeshifter has java.lang.UnsatisfiedLinkError vhurst SageTV Placeshifter 0 02-28-2007 01:21 AM
Font Size TripleTapper SageTV Media Extender 4 12-12-2006 03:19 PM
Font size for EPG srothwell SageTV Software 4 08-04-2004 01:00 PM


All times are GMT -6. The time now is 05:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.