Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Netsurf on Syllable
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop
View previous topic :: View next topic  
Author Message
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Wed Apr 29, 2015 7:32 am    Post subject: Netsurf on Syllable Reply with quote

Hi all:

This is primarily directed to Bogomips, who (I think) may be the only other soul in the universe to have ported Netsurf to Syllable.

I've managed to compile the SDL framebuffer version of Netsurf on Syllable - producing an executable that runs for awhile, but then stops (before any UI appears) and declares that the surface for SDL is unavailable.

To Bogomips: Do you remember anything special that you had to do? When you compiled libnsfb, did you statically link in SDL, or did you use the shared libSDL? The executable I built is looking for the shared lib, which does exist. Any ideas? I'd hate to actually have to look at the code Smile
Back to top
View user's profile Send private message
Bogomips



Joined: 23 Feb 2011
Posts: 307
Location: France

PostPosted: Wed Apr 29, 2015 9:00 am    Post subject: Reply with quote

Hello,

If I compile libnsfb in "static" mode , I get this error:
Unable to convert "sdl" to nsfb surface type.

But nsfb in "shared" mode, it's ok.
To compile "bezier" demo for example:

gcc bezier.c -o bezier -lSDL -lnsfb -I/resources/indexes/include/SDL
Back to top
View user's profile Send private message
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Thu Apr 30, 2015 6:10 am    Post subject: Reply with quote

[quote="Bogomips"]Hello,

If I compile libnsfb in "static" mode , I get this error:
Unable to convert "sdl" to nsfb surface type.

But nsfb in "shared" mode, it's ok.
To compile "bezier" demo for example:

gcc bezier.c -o bezier -lSDL -lnsfb -I/resources/indexes/include/SDL[/quote]

Thanks! I've always found that Netsurf required a little longer dance to bring it to the party. I'd like to fully update Webster, but that's a longer project because I'd want to see the latest Webkit.

Anyway, for others wanting to try Netsurf on Syllable, here's a quick hit list:

1 - use a short PKG_CONFIG_PATH. I used "export PKG_CONFIG_PATH=/usr/indexes/lib/pkgconfig::"

2 - Install optional Syllable resouce packages for libXML2, expat, freetype, and gperf. Make sure that symlinks to all of these are visible to your build environment.

3 - Download, and build from source: libpng15, bison2.6, and flex 2.5 (otherwise will get parse errors in nsgenbind build).

4 - Use CPAN to download a newer HTML::Parser (otherwise will get entities error).

4 - Make changes to netsurf/Makefile.config, and override at least these:
override NETSURF_FB_FONTLIB := freetype
override NETSURF_FB_FRONTEND := sdl
override NETSURF_FB_FONT_CURSIVE := CenturySchoolbook-Italic.ttf
override NETSURF_FB_FONT_FANTASY := CenturySchoolbook-Italic.ttf

5 - Add the math library (-lm) as png needs it, to either Makefile.config or the main Makefile. Similarly add -lrt (otherwise will see nsu_getmonotonic undefined reference error).

6 - Manually symlink libpng.so to libpng15.so.15 (or change the source built libpng.pc)

7 - Find a source for all the image-resource.c files, aka "image-caret.c" etc (I used the ones from a FreeBSD build).

7 - Build both the nslibs libraries and netsurf itself with the framebuffer target:
make TARGET=framebuffer

I'll add anything I missed in a second post. Maybe Bogomips did it differently? These are just what seemed to go pretty smoothly for me.
Back to top
View user's profile Send private message
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Thu Apr 30, 2015 7:01 am    Post subject: Netsurf Quick Hit List 2 Reply with quote

The latest Netsurf (version 3.3) does a better job of working with Syllable's old gcc. I'd suggest using the source for Netsurf 3.3 - because of issues I had when building with versions 2.9 and 3.0. If you want to use the older ones, you'll find that some gcc related things need to be changed (-nostart / -shared options), Wno-overlength-string warning, the "restrict" keyword, and a couple others.

Netsurf 3.3 works nicely with the framebuffer target for both the libaries and the nsfb executable builds. However; earlier versions of Netsurf mixed up the target and the prefix, requiring "sdl" to be specifed, else the build defaulted to gtk. Now, with Netsurf 3.3, "make TARGET=framebuffer" works for everything, so it's consistent. I highly advise the use of Netsurf version 3.3.

I think I may have overriden the BMP option in Makefile.config:
NETSURF_USE_BMP := no (although I don't think it's a problem)

Bogomips: I'm curious - which Netsurf source version you're using?
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Thu Apr 30, 2015 9:14 am    Post subject: Reply with quote

I can't escape the feeling that this would be easier with Builder. Smile
Back to top
View user's profile Send private message Visit poster's website
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Thu Apr 30, 2015 2:03 pm    Post subject: Reply with quote

[quote="Kaj"]I can't escape the feeling that this would be easier with Builder. Smile[/quote]

Hopefully - we can create a good Builder recipe from this experiment.

Anyway, this is from the latest compile/link and execution:

[[email protected]:~/netsurf-all-3.3/netsurf]./nsfb -v
1 netsurf_init 157: NetSurf version '3.3 (10th March 2015)'
2 NetSurf Syllable release 7 version 0.6
3 Loading Messages from netsurf-all-3.3/netsurf/!NetSurf/Resources/
4 image_cache_init 381: Image cache initilised with a limit of 3145728
5 html_css_fetcher_initialise 64: html_css_fetcher_initialise called for x-ns-css
6 fetch_curl_register 1244: curl_version libcurl/7.28.1 PolarSSL/1.3.6 zlib/1.2.3
7 user_agent_build_string 68: Built user agent "NetSurf/3.3 (syllable)"
8 fetch_curl_register 1330: note: cURL not linked against openssl
9 fetch_curl_initialise 114: Initialise cURL fetcher for http
10fetch_curl_initialise 114: Initialise cURL fetcher for https
11 fetch_data_initialise 65: fetch_data_initialise called for data
12 llcache_initialise 3288: llcache initialising with a limit of 9437184 bytes
13 gui.c: process_cmdline 460: argc 1, argv 0xffffb5b8
14 framebuffer.c framebuffer_initialise 399: The sdl surface is not available from libnsfb
15 gui.c die 109: Unable to initialise framebuffer

So, I guess I should try to compile and link libnsfb manually, and see if anything kicks up. Bogomips?
Back to top
View user's profile Send private message
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Thu Apr 30, 2015 4:02 pm    Post subject: Reply with quote

I think I may have found the problem. I fired up the debugger and stepped into framebuffer_initialise. GDB told me that the initial window was going to be 800x600x32bbp. I had set the command line args to 1024x768x16 because I'm using VESA on Qemu, and don't have any higher than 16. So - the program was ignoring my command line override of the default.

I looked at the release notes for Netsurf 3.3, and - sure enough - they made changes to the command line handling in this new version. So - it looks like they may have introduced a bug at the same time that they changed the handling. The problem had nothing to do with linking SDL. So, I'll dig into the comand line code.
Back to top
View user's profile Send private message
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Fri May 01, 2015 12:51 pm    Post subject: Reply with quote

Well, I'm happy to report that this post is being made with Netsurf on Syllable 6.7.

I think the command line handling issue may have been my fault instead of a bug in the original Netsurf source, but am not yet sure. Anyway, a couple other issues had to be resolved before this thing would launch. Netsurf is built in two major gulps. The first gulp builds the libraries, and the second gulp builds everything else.

The PKG_CONFIG_PATH variable is used in the first part, and works fine. The PKG_CONFIG_PATH environment variable is ignored in the second gulp (the build of Netsurf itself) except for Apple/Cocoa builds. For most other platforms, it looks at a GCC path. If you're not using the GCC path, and have a special one you want to use, then you must set the path in PKG_CONFIG _LIBDIR, for the framebuffer target.

Then, there was an issue in framebuffer_initialise(), where it called nsfb_type_from_name(fename). The result came back always as NSFB_SURFACE_NONE, instead of NSFB_SURFACE_SDL. I haven't decided why that happens yet, but for a quick test I just hardcoded fbtype to NSFB_SURFACE_SDL. The program seems to be working fine that way, so apparently nsfb_type_from_name() was returning a bogus result. Obviously, I need to find out what is really happening there :-)

Another problem I found is that the fonts described in Makefile.config must include the full path name plus the file name. Once I changed those items to point to the ttf files - Netsurf fired up and here I am. Yea!!
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Fri May 01, 2015 7:50 pm    Post subject: Reply with quote

Congratulations!
Back to top
View user's profile Send private message Visit poster's website
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Fri May 01, 2015 9:34 pm    Post subject: Reply with quote

Thanks Kaj

I do have one little issue left to deal with. I intended to use Netsurf with a build of curl compiled to use PolarSSL, but ran into problems with ipv6 functions causing segfaults. So, I've temporarily moved cURL back to OpenSSL. Anyway - what's the status of ipv6 on Syllable?
Back to top
View user's profile Send private message
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Sat May 02, 2015 7:02 am    Post subject: Reply with quote

Most people won't want to do all the headstanding I have described in this thread (well, it's really not so bad). But - it'd be nice to convert this (somewhat erratic) procedure to a Builder recipe. It there a "quick-start" guide that describes how to do that?

I answered my own question about the ipv6 situation. I recompiled curl with the --disable-ipv6 and --with-polarssl configuration options, and now I don't get the segfaults. So I should be in good shape to use polarssl, although at the moment I am still using the old curl library (with openssl).

Testing Netsurf on Syllable now for a day, I've found that it makes Syllable usable for me. Webster was just too frustrating to use because it tended to hang on big sites. The idea should be to fix Webster, but that's a long term project. Netsurf fills the gap nicely until a future time when Webster can be fixed. With Netsurf, most sites look as good as they do with any other browser. I was able to use Netsurf/Syllable to surf to big sites like CNN, DailyMail, Reuters, CBSNews and others that were troublesome for Webster. They load quickly (relative to Webster) and have not "frozen" like Webster often does on heavier sites.

I noticed Netsurf was using about 3-5 megabytes of memory on smaller sites (like Syllable.org), and 20-25 megabytes of memory on the bigger sites like DailyMail.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Sat May 02, 2015 12:24 pm    Post subject: Reply with quote

Right, there's no IPv6 in Syllable. Someone was working on it, but he disappeared. Some programs don't detect that and indeed need to be told to disable IPv6.

There's no real guide to writing Builder recipes, but have you seen the skeleton.recipe? It's an overview of all directives, that I often use for making new recipes.

NetSurf sounds good. I never understood why "modern" browsers use so much memory. Did NetSurf improve its rendering lately? I tried it some months ago on Linux and the text rendered shifted. It was also quite slow on large pages.

The big problem is of course that it doesn't support JavaScript, while Webster does but often chokes on it.
Back to top
View user's profile Send private message Visit poster's website
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Sat May 02, 2015 1:54 pm    Post subject: Reply with quote

Kaj - Thanks, I'll have a look at skeleton.recipe, and see if I can make it work.

I've seen the shifted/doubled rendering on Linux Netsurf/Gtk, but not on the framebuffer version of Netsurf for any of the platforms I use it on (Haiku, Linux, FreeBSD, and (now) Syllable). I have polarssl working on all them them too! The one thing that's a problem with Netsurf/framebuffer-sdl is that it doesn't bubble up any indication of an invalid certificate if it finds one. So, that would have to be fixed at some point, in terms of its SSL/TLS operation.

I think Netsurf/framebuffer-sdl preloads pages before display, so it makes it seem like a longer time, but my experience the past two days is that it's somewhat quicker than Webster on page loads of big sites, and (the more important thing for me) it doesn't freeze.

Since it doesn't freeze - that kinda says that Webster could be reformulated to behave better, and it's not going to be impossible to solve due to any kernel issues.

The javascript is still an option that is turned off by default. It's a very primative version of javascript. Surprisingly though - most sites do render pretty nicely, even without javascript. This may be because the major sites are using big CMS systems now - and those systems do a pretty good job of providing decent pages for js-challenged browsers.

Netsurf does have some segfault issues listed on their bug page, but I haven't experienced any of those yet (the ipv6 fault was a curl issue). It's nice that Netsurf is under strong development now, as can be seen by looking at their bug reporting page:

http://bugs.netsurf-browser.org/mantis/view_all_bug_page.php

- Ron
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Sat May 02, 2015 2:54 pm    Post subject: Reply with quote

Odd - I guess they're serious about RISC OS being their main platform. Smile

Webster's framework around WebKit is incomplete. I think most hangs are due to JavaScript events not being wired up. They occur because WebKit supports them, but Webster doesn't handle them.
Back to top
View user's profile Send private message Visit poster's website
Ronaldlees



Joined: 15 Oct 2014
Posts: 148

PostPosted: Sun May 03, 2015 9:34 am    Post subject: Reply with quote

[quote="Kaj"]Odd - I guess they're serious about RISC OS being their main platform. Smile

Webster's framework around WebKit is incomplete. I think most hangs are due to JavaScript events not being wired up. They occur because WebKit supports them, but Webster doesn't handle them.[/quote]
--------------------

Yes - they're serious about RISC OS. Many of them go all the way back to the BBC toy days. I like the development environment there ( it's a very strong one on https://www.riscosopen.org ). But - a lot of the bugs they're fixing are on the Linux Gtk and Amiga versions (most of which filter through to the framebuffer/* code).

I've looked at skeleton.recipe, and am trying to digest it. Netsurf will require several recipes. First, a recipe is needed for Bison-2.6. This upgrade should not bother previously built programs (using the current Syllable Bison-2.3). I think. A recipe is needed for Flex-2.5.37. Again, this should not bother existing programs (currently Syllable has version Flex-2.3). Fingers crossed.

A recipe is needed for libpng-1.5.22. But - as libpng-1.5.22 would derail previously built apps, the library built by this recipe would have to exists side-by-side somehow with Syllable's current libpng-1.2. Syllable really should upgrade its libpng anyway, because version 1.2 is seriously vulnerable to exploits via carefully crafted png images.

A recipe for the more recent libXML2 package should not cause an issue either (I don't think). Probably not.

Syllable's current curl-7.18/OpenSSL library works with Netsurf-3.3, but Syllable could have an optional package for Curl-7.xx (whatever is most recent) - built with either PolarSSL-1.36 or with OpenSSL-1.0.2 (since Syllable's openSSL is quite old). So - that would be three more recipes to add as optional dependencies of Netsurf. The polarSSL recipe would be new to Syllable, so would not conflict with anything. But - the new curl package would have to exist side-by-side with the current Syllable version 7.18. The new curl version breaks Webster. Sure - we could change Webster to use the new curl, but I'm not sure I want to go down that rabbit hole just to make Netsurf run. Then may as well fix Webster and add new Webkit (a see you in six months proposition).

The updated Perl module import from CPAN is pretty painless, although I haven't looked to see how builder handles it.

Any comments?

- Ron
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group