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 

DirectFB
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop
View previous topic :: View next topic  
Author Message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Sun May 27, 2012 8:37 pm    Post subject: Reply with quote

#define PTHREAD_COND_INITIALIZER \
{ 0, 0, 0, NULL, 0 }

seems to be out of sync with its struct typedef, as well. These type changes have happened somewhere halfway, and the initialisers haven't been updated:

http://syllable.cvs.sourceforge.net/viewvc/syllable/syllable/system/sys/include/atheos/pthreadtypes.h?r1=1.4&r2=1.5
Back to top
View user's profile Send private message Visit poster's website
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Mon May 28, 2012 1:10 am    Post subject: Reply with quote

I know I am not in the same league as you guys but I thought this might be of interest

http://lists.busybox.net/pipermail/buildroot/2009-January/024483.html

Builds of DirectFB (version 1.2.6) are failing with an error message
that "PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP" is not defined (in
lib/direct/interface.c, amongst other files). I've traced this to a
difference in the ./configure script and the actual compilation - the
./configure script defines the "_GNU_SOURCE" symbol before checking for
the "PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP" macro, and thus finds it
defined. The actual library code does not define the "_GNU_SOURCE"
symbol (according to the changelog, this definition was in older
DirectFB versions, but has since been removed), and thus (via
<features.h> and <pthread.h>) "PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP"
is not defined during compilation.

I've got DirectFB to compile by adding a "#define _GNU_SOURCE 1" to the
start of "config.h", and now the DirectFB demo programs are compiled and
seem to be working.
Back to top
View user's profile Send private message
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Mon May 28, 2012 6:23 am    Post subject: Reply with quote

[quote="Kaj"]It says:

configure: WARNING:
*** PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not defined! Dead locks might occur!

Versions up to 1.2.1 only warn for it during configure, but later versions refuse to run with a similar runtime error. There are also other runtime symptoms in versions after 1.0.0, but this must be the leading cause.[/quote]

Sorry my previous post would make a bit more sense if I had of quoted the comment above - Around version 1.2.6 the define for _GNU_SOURCE was changed.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Mon May 28, 2012 6:49 am    Post subject: Reply with quote

Thanks, that's very helpful.

The solution for Syllable should be the other way around, though. On Linux, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is available, and detected when _GNU_SOURCE is defined. On Syllable, only PTHREAD_MUTEX_INITIALIZER is available, so the question is why DirectFB wants to use the Linux version. It looked like it was hardcoded, but if it's detected by configure, something else is going on.

Further, it stands to reason that DirectFB would need a PTHREAD_RECURSIVE_MUTEX_INITIALIZER. This is not specified by the standard, and I have doubts that our PThreads implementation could initialise it properly.
Back to top
View user's profile Send private message Visit poster's website
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Mon May 28, 2012 8:33 am    Post subject: Reply with quote

Well, DirectFB does hardcode the use of PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP. The configure test does nothing but issue a warning. I've made an attempt at defining it in pthread.h and now it doesn't complain about it anymore, and I can compile the latest DirectFB 1.4.16.

However, it still crashes with an assortment of other errors. It complains that it can't set thread scheduling priority. That should be easy to patch out of DirectFB. But it crashes when GLibC detects an invalid pointer in a memory map operation:

*** glibc detected *** dfbscreen: munmap_chunk(): invalid pointer: 0xffffb158 ***

It seems our new mmap implementation is insufficient. There are also other packages that don't detect mmap as being suitable, or produce errors later, such as FontConfig.
Back to top
View user's profile Send private message Visit poster's website
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Mon May 28, 2012 3:01 pm    Post subject: Reply with quote

I've checked a new pthread.h into CVS that fixes PTHREAD_MUTEX_INITIALIZER and PTHREAD_COND_INITIALIZER and implements PTHREAD_RECURSIVE_MUTEX_INITIALIZER and PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP.
Back to top
View user's profile Send private message Visit poster's website
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Tue May 29, 2012 3:30 pm    Post subject: Reply with quote

If you're getting errors during mmap related operations, keep an eye on the kernel log and see if there are any warning: I put a few in to log un-handled features.
Back to top
View user's profile Send private message Send e-mail
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Tue May 29, 2012 5:06 pm    Post subject: Reply with quote

OK. I compiled DirectFB on 0.6.6, though, and the error is still the same, so the availability of mmap doesn't seem to matter.
Back to top
View user's profile Send private message Visit poster's website
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Tue May 29, 2012 5:21 pm    Post subject: Reply with quote

On 0.6.7, only the crash info is in the kernel log, and it doesn't reference any mmap functions.
Back to top
View user's profile Send private message Visit poster's website
Bogomips



Joined: 23 Feb 2011
Posts: 307
Location: France

PostPosted: Wed May 30, 2012 3:39 am    Post subject: Reply with quote

Hello,
I recompiled DirectFB-1.0.0 on Syllable 0.6.6. Now, all animations in DFB-examples 1.0.0 work. But sometimes, I have to restart the animation because it crashes but not all the time.When I want to close the window by clicking on the corner or when I press "esc", the animation stops and the window remains open. I can also go over the window with the mouse but I can not click. I compiled with MMX and with shared libraries only. DirectFB continues to refuse the window manager "default". I continue with this version because I've noticed that on Linux, support for SDL don't work well or not at all with newer versions of DirectFB.
On Linux, I use only the version 1.0.0 and I even got a version of QT3 (v3.2.2) which works very well above SDL. For QT4, apparently version 1.0.0 is more than enough.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Wed May 30, 2012 5:29 am    Post subject: Reply with quote

Qt has a DirectFB backend? I thought it was only available as older patched versions from the DirectFB project.

There are other errors on Syllable from DirectFB versions above 1.0.0, so it's indeed the version to start with. The problem is that it is insufficient for the latest versions of Cairo and GTK.

When DirectFB doesn't find PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, it uses normal mutexes instead of recursive mutexes. This leads to deadlocks when they're used in a nested fashion, and that's what DirectFB warns for. So when your demos hang, that's most likely the cause. You should be able to solve this by taking the new system/sys/include/pthread.h from CVS and putting it in /system/development/headers/. On 0.6.6, you should also make a symlink in that directory from syllable/ to atheos/.
Back to top
View user's profile Send private message Visit poster's website
Bogomips



Joined: 23 Feb 2011
Posts: 307
Location: France

PostPosted: Wed May 30, 2012 7:27 am    Post subject: Reply with quote

Yes indeed, there is a patch for QT3.2.2 here: http://qt-directfb.sourceforge.net/

In fact, it's not really a patch but a source completely changed but it works very well on SDL and DirectFB 1.0.0.

For QT4: http://doc.trolltech.com/4.6/qt-embeddedlinux-directfb.html

I followed this topic, I have already tried the new "pthread.h" but it changes nothing. In fact I replaced "syllable / ..." by "atheos / ..." in the file.

When you change the file "pthread.h", you should not normally recompile "libpthread" by adding these changes also in the library ?
Back to top
View user's profile Send private message
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Wed May 30, 2012 8:18 am    Post subject: Reply with quote

[quote="Bogomips"]Hello,
When I want to close the window by clicking on the corner or when I press "esc", the animation stops and the window remains open. I can also go over the window with the mouse but I can not click. [/quote]

You mention the directfbrc file before I found a list of options like.

http://linux.die.net/man/5/directfbrc

mouse-source=<device>
Specify the serial mouse device.
[no-]mouse-gpm-source
Enables using GPM as mouse input repeater.
[no-]motion-compression
Usually DirectFB compresses mouse motion events. This means that subsequent mouse motions are delivered to the application as a single mouse motion event. This leads to a more responsive but less exact mouse handling.
mouse-protocol=<protocol>
Specifies the mouse protocol to use. The following protocols are supported:

MS Two button mouse using the Microsoft mouse protocol.
MS3 Three button mouse using an extended Microsoft mouse protocol.
MouseMan Three button mouse using a different extension to the Microsoft mouse protocol introduced by Logitech.
MouseSystems The most commonly used protocol for three button mice.
PS/2 Two/three button mice of the PS/2 series.
IMPS/2 Two/three button USB mice with scrolling wheel using the Microsoft Intellimouse protocol.



Kaj - There are also some options to turn on or off like

Enables the output of the DirectFB banner at startup. This is on by default.
[no-]debug
Enables debug output. This is on by default but you won't see any debug output unless you compiled DirectFB with debugging support.
[no-]debugmem
Enable memory allocation tracking.
[no-]debugshm
Enable shared memory allocation tracking.
[no-]trace

window-surface-policy=<policy>
systemonly Window surfaces are stored in system memory.
videoonly Window surfaces are stored in video memory.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Wed May 30, 2012 8:44 am    Post subject: Reply with quote

[quote="Bogomips"]I followed this topic, I have already tried the new "pthread.h" but it changes nothing. In fact I replaced "syllable / ..." by "atheos / ..." in the file.[/quote]

It should at least get rid of the warning during configuring? If not, something is wrong with pthread.h.

Do you still get hangs? Then our PThreads implementation may not properly handle static initialisation of recursive mutexes.

[quote="Bogomips"]When you change the file "pthread.h", you should not normally recompile "libpthread" by adding these changes also in the library ?[/quote]

Normally yes, but the current changes don't affect the library.

Thanks for the links.
Back to top
View user's profile Send private message Visit poster's website
Bogomips



Joined: 23 Feb 2011
Posts: 307
Location: France

PostPosted: Wed May 30, 2012 9:13 am    Post subject: Reply with quote

By using the new "pthread.h", I have no warning during the execution of "configure". Now, I must try "Default" instead of "Unique".
So, I search on the web if there is a solution to correct this message: "Could not get default context of primary layer ... Fusion IPC error detected!"
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 Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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