IRC Log Viewer » #firebreath » 2012-07-22

IRC Nick Time (GMT-7) Message
jshanab_ 09:07 OK guys I am getting desperate. It looks like something is wrong with the current build system on MAC, but I am not sure. (I am rather new to MAC)
If anyone here can verify on Mac for me, It would really help. Xcode 4.3.3 and cmake 2.8.8
I take the most recent FB and run fbgen. I mv the project and prep it. I open the xcode proj and start the build. xcode closes unexpectedly (aka crashes)
jshanab_ 14:07 When I create a new project with fbgen from the newest source, Does it no longer have a plugin_auto target? There seems to be a bunch of targets missing. On windows I have 23 on Mac I have 10
OMG, the "combined project" on Mac. How does that work. Everytime I run prep it wipes out the combined for the other project O work on? How do I switch back and forth working on multiple projects?
Grimshaw 17:07 hey! anyone happens to have tips for me on using mutex like mechanisms?
I have tried everything
but when i have 3 objects in one page, in firefox
i just get a crash
mutexes, locks, manual synchronization
hell
taxilian 18:07 Grimshaw: where is the crash occurring?
if it's a shared memory issue a critical section (boost::mutex and boost::mutex::scoped_lock) should do ya
ahh, dinner time. gotta run.
jshanab_ 18:07 Grimshaw. I have a lot of those threading issues as my plugin displays many videos, 1 instance per video on a single page.
Grimshaw boost has great synchronization primitives
Grimshaw 18:07 well
what about any amount of plugin instances in one page?
jshanab_ 18:07 I have had 40
Grimshaw 18:07 im trying to make initialization a sequential job
by mutexing all the process
at least i tried
but it still crashes
while without many objects in the same page it doesnt
: /
jshanab_ 18:07 what do you mean by initialization? your onPluginReady handler?
In one area I have had to use a static mutex to lock a static object shared by all my plugins. (DirectX initialzation)
"all my plugin instances"
Grimshaw 18:07 im trying something, will come back to you soon :)
jshanab_ 18:07 K
While I am here. Does anyone know if I can get the NSWindow* from the FBPluginWindow* passed to onWindowAttatched event? (On Mac of course)
Grimshaw 18:07 if im not mistaken
you could get that from the handle id
using the api of the os
but im not experienced enough in mac :)
jshanab_ 18:07 I see the call to the baseclass to store the NSWindow, but there is no baseclass implemnetation that I can find. so the getWindowRef is a bit upclear. Do i call getWindowRef and then cast it to NSWindow* ?
I am definitly not experienced in mac! Way more windows and linux
Grimshaw 18:07 ensure that with dynamic_cast
btw do youu render dx right?
is it one thread per instance?
jshanab_ 18:07 I am not sure I need to dynamic_cast.
Grimshaw 18:07 the cast will help you check the validity of the NSWindow*
as a valid cast for the window ref of course
should be NULL if the cast failed
if the runtime type info is enabled in the compiler
jshanab_ 18:07 Yes, and furthormore all directX is on one thread. So instead of a function doing something, a function sets a protected flag so the display code detects the flag and reacts. 2 threads accessing the same DX ctx is crash
Grimshaw 18:07 what if you had one context per thread?
its sensible, once the window is not shared either
directX code in such a multithreaded "queue" doesnt slow it down~?
jshanab_ 18:07 That might have been unclear. Each instance has a thread that runs displaying video frames. Other threads load data and of course there is the main one coming from browser Javascript requests. I mean each instance has a display thread and ALL directX commands are on that thread
Grimshaw 18:07 ohhh
i see :D
its a good approach
but i dont get why this crashes
dear lord.
something must be clashing in the windowAttach event
where i startup a new thread for GL
jshanab_ 18:07 Once ctx per instance and 1 thread per ctx. There is Not necessarily a 1: on class instances to threads in c++ :-)
Grimshaw 18:07 ive mutexed the whole method
so each initializes at a time
jshanab_ 18:07 What is the stack trace?
Grimshaw 18:07 i dont get to see it with firefox
because i cant attach to plugin container
jshanab_ 18:07 Grimshaw only if that mutex is static
Grimshaw 18:07 because it imediatly crashes
that mutex IS static :)
jshanab_ 18:07 First save yourself some trouble and disable that damn plugin container then attach
Grimshaw 18:07 what do you mean?
jshanab_ 19:07 about find ipc and disable it
Grimshaw 19:07 run firefox in a single process mdoe?
jshanab_ 19:07 Damn tooting
Grimshaw 19:07 got it, will do
but now i made an experience
funny one
basically put all the attach method under a lock
mutex lock
and it crashed before
then before the unlock is done
i put a sleep method with 1 second delay
jshanab_ 19:07 Allow me to call your attention to http://www.firebreath.org/display/documentation/Debugging+Plugins
Grimshaw 19:07 so the plugins initialize 1 second after each other
and it works nice
i think this confirms a clash in the initialization part.
jshanab_ 19:07 Then that confirms you are missing something to protect
Grimshaw 19:07 i wonder
jshanab_ 19:07 I still am not sure where or what you are refering to with initialize. CTOR, onPLuginReady, static Inti?
Grimshaw 19:07 window attach
i start my game engine from its handle
before that i have nothing useful to do
ill make initializations a sequential task once this works
jshanab_ 19:07 Ah. Well (and of course that is what I am working on next) Ther may or maynot be a guarenteed dilevery order. It may for example not be done with something else you are assuming is. gotta check that
Grimshaw 19:07 and then care for shared files etc
i ve read in the docs
that window attach implies a ready browser_host
which is all i need
im pretty sure i think :D
jshanab_ 19:07 For example if a second instance is using something in OPENGL while the other is initializing, you must protect the init AND the usage
Grimshaw 19:07 that shouldnt be true if the contexts are different, right?
opengl does the separation itself i think
one thread cant even draw with opengl without a context activation
i think that is pretty clear, since i sometimes can make a lot of instances in chrome
and they all draw at the same time correctly
jshanab_ 19:07 On that I cannot be sure. You must call the set current ctx. I have been fighting SDL, SFML, DirectX only now am I trying OpenGL
Grimshaw 19:07 i use SFML too :)
and im calling that by the way
jshanab_ 19:07 Once you attach and are connected to MS symbol server, the stack trace will help. That and Parallel stacks board
Grimshaw 19:07 parallel stacks board?
what is that? :D
jshanab_ 19:07 I had trouble with SFML in some browsers and tried SDL. Got everything working and then ie9 came out and broke SDL. THen tried DirectX that worked well and again ie9 broke it. You have no idea how close we are to saying "Standards compliant browsers only"
What version of VS do you have?
Grimshaw 19:07 2010
i know your pain brother
its awful
by the way what is your plugin?
jshanab_ 19:07 2010 Pro,ultimate,expess?
Grimshaw 19:07 pro
using a single process in firefox will make a difference in my final product?
anything may break when changing back?
jshanab_ 19:07 Security camera video from push,pull.
Grimshaw 19:07 not bad!
jshanab_ 19:07 SIngle process mode is just to help debugging. It makes life easier.
pro shul have in the debug windows section a "parallel stacks" item. It opens a window that looks kinda like viso in which you can inspect all the stacks. Every thread has one. Mark "just my code" in hte threads panel and it will filter the drawing. (hope you have a 30" monitor)
To my knowledge even in multiprocess mode a single page runs in a single process. It is just so a page crashing does not stop the browser.
Grimshaw 19:07 im working with the debugger now to find what whats happening
that parallel stack will come handy
jshanab_ 19:07 Handy but a hog. Just like the symbol server.
Grimshaw 19:07 I just want to get this going..
by the way
what problems did you find with SFML?
jshanab_ 19:07 Resizing went to flashing white square. Shader would not work so I used it for single camera and then used directx for multi.
Grimshaw 19:07 only that?
jshanab_ 19:07 I spent the last few weeks porting the plugin to iOS and it came out better and faster, shader worked perfect. OpenGL ES is sweet
Grimshaw 19:07 oh these plugins work in iOS too?
jshanab_ 19:07 no. The analogy though is interewsting. plugin = app. instead of javascript calling plugin you have widgits on a view calling plugin. I have joked with taxillain about extending the framework to create a iOS app.
I took my plugin code and translated from c++ and boost to NS* and objective-C
Grimshaw 19:07 ohhh
so the concept of having a plugin doesnt really apply?
you dont load a library dinamicly anymore?
jshanab_ 19:07 Having never done Mac,IOs or objective C I had it playing video in 2 weeks
Grimshaw 19:07 i wish to work with iOS as well
but i dont own a mac
sucks to be me :D
jshanab_ 19:07 The browsers on phones don't have plugins. THere is talk of Desktop browsers going that route also.
Work bought me a 13" macbook air and it is sleek and damn fast
Grimshaw 19:07 want to work there too :)
jshanab_ 19:07 OMG, have you seen the new macbook pros ? they are using the 220dpi screen on a 15" notebook 2880 x 1200
Not like we don't need more people! But I am not the man
Grimshaw 19:07 ahah :)
i see the point :)
i like mac, even tough i never used one for myself
neither any apple product actually
jshanab_ 19:07 Good luck Grimshaw. I am gonna watch an old DVD and kick it. I started on apple when I got my apple 2 but went PC, then Linux and just 2 years ago came back. Now I work on 4 platforms. linux,windows,mac,iphone,droid
Grimshaw 19:07 im an android man too :D
and thats 5 platforms
xD
jshanab_ 19:07 Mac is like linux + windows. All the power of Linux all the polish of windows. If they just didn't screw with the control key I would be a lot happier
Grimshaw 19:07 thanks brother, good watching :D
jshanab_ 19:07 'night