Hi,in fact,I'm not sure of where the bug comes,for it's said glib works well on ARM. Are you familiar with Android NDK devel.(It's rather diff. from the common ARM cross compiling.)?Do you have Android SDK/NDK and Android device that you can test the native program?<br>
You can recreate it by these:<br>1.I use the android NDK provided by Mozzila which has nearly full C++ support:<br><span style="font-size: medium;"><span style="color: rgb(0, 0, 255);"><span style="color: rgb(136, 136, 136);"><span style="color: rgb(0, 0, 0);"></span></span></span></span><a href="http://ftp.mozilla.org/pub/mozilla.org/mobile/source/android-ndk-r4c-0moz3.tar.bz2" target="_blank">http://ftp.mozilla.org/pub/mozilla.org/mobile/source/android-ndk-r4c-0moz3.tar.bz2</a><br>
and I have modified <span><span>Andrew Ross's agcc to partner with this NDK:<br><a href="http://blog.csdn.net/rozenix/archive/2011/02/28/6212994.aspx" target="_blank">http://blog.csdn.net/rozenix/archive/2011/02/28/6212994.aspx</a><br>
2. Then I cross compile glib2.28.1 onto Android in this order:<br>libbind-6.0.tar.gz libiconv-1.13.1.tar.gz <br>gettext-0.18.1.1.tar.gz glib-2.28.1.tar.gz<br> Also I port pixman and openssl onto android.<br>3. So I disable the audio channels and build snappy onto android with this script under spice-gtk/gtk:<br>
#!/bin/bash<br>COMMON_DIR=../common<br>SPICE_GLIB_SRC="coroutine_gthread.c spice-util.c spice-session.c spice-channel.c spice-glib-enums.c spice-marshal.c generated_demarshallers.c generated_demarshallers1.c generated_marshallers.c generated_marshallers1.c gio-coroutine.c channel-base.c channel-main.c channel-display.c channel-display-mjpeg.c channel-cursor.c channel-inputs.c decode-glz.c decode-jpeg.c decode-zlib.c $COMMON_DIR/mem.c $COMMON_DIR/marshaller.c $COMMON_DIR/canvas_utils.c $COMMON_DIR/sw_canvas.c $COMMON_DIR/pixman_utils.c $COMMON_DIR/lines.c $COMMON_DIR/rop3.c $COMMON_DIR/quic.c $COMMON_DIR/lz.c $COMMON_DIR/region.c $COMMON_DIR/ssl_verify.c"<br>
CPP_FLAGS="-DHAVE_CONFIG_H -DSW_CANVAS_CACHE -D_REENTRANT -I. -I.. -I../common -I/data/local/include/spice-1 -I/data/local/include/pixman-1 -I/data/local/include -I/data/local/include/glib-2.0 -I/data/local/lib/glib-2.0/include"<br>
C_FLAGS="-std=gnu99 -Wall -Wno-sign-compare -Wno-deprecated-declarations -Wl,--no-undefined -fPIC -DPIC "<br>LD_FLAGS="-L/data/local/lib/ -lpixman-1 -lm -lssl -lcrypto -ljpeg -lz -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 "<br>
echo "agcc -shared -o libspicec_glib.so $SPICE_GLIB_SRC $CPP_FLAGS $C_FLAGS $LD_FLAGS"<br>agcc -shared -o libspicec.so $SPICE_GLIB_SRC $CPP_FLAGS $C_FLAGS $LD_FLAGS<br>agcc -o snappy spice-cmdline.c snappy.c -DG_LOG_DOMAIN=\"GSpice\" -DSW_CANVAS_CACHE -DSPICE_GTK_LOCALEDIR=\"/usr/local/share/locale\" $CPP_FLAGS $C_FLAGS $LD_FLAGS -lspicec -lintl -liconv -L./<br>
then I copy lib*.so libspicec.so and snappy onto Android device and run,thus come the endless SIGBUS and SIGFAULT.<br> Can you help me on this? Thank you forward!<br> Rgrds.<br> <br>
</span></span><div class="gmail_quote">On Fri, Mar 18, 2011 at 6:52 PM, Alon Levy <span dir="ltr"><<a href="mailto:alevy@redhat.com" target="_blank">alevy@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Fri, Mar 18, 2011 at 06:26:09PM +0800, Shuxiang Lim wrote:<br>
> Hi,<br>
</div><div>> I have to say I cannot solve the glib bugs on Android 'cause it's too<br>
> arcane and too huge for me now. e.g such a statement will cause a segfault:<br>
> gobject/gtype.c :<br>
> return static_fundamental_type_nodes[utype >><br>
> G_TYPE_FUNDAMENTAL_SHIFT];<br>
> when utype==0; for why, I never know and can get no help..<br>
> So I shall face the decision again, return to C++? No! STL and class<br>
> hierarchies etc. is even more horrible! I have only one choice: remove the<br>
> glib from the spice-gtk now.<br>
> Anybody can give some suggestions on this?<br>
> Good weekend.<br>
<br>
</div>Can I recreate this in qemu-arm? can you give instructions?<br>
<br>
Regarding converting to no glib, I don't know how hard it would be.<br>
<div><div></div><div><br>
> On Fri, Mar 18, 2011 at 5:15 PM, Alon Levy <<a href="mailto:alevy@redhat.com" target="_blank">alevy@redhat.com</a>> wrote:<br>
><br>
> > On Fri, Mar 18, 2011 at 02:09:38PM +0800, Shuxiang Lim wrote:<br>
> > > Ok,my prediction is right, this segfault is solved by disabling NLS (the<br>
> > use<br>
> > > of gettext(). etc..)in glib.<br>
> > > Yet then Bus Error comes: I know,it's mainly caused by the typecast for<br>
> > ARM<br>
> > > has no same alignment style as x86.The question is: is there a way to fix<br>
> > > this in the arm-gcc option other than rewrite the typecast statements<br>
> > into<br>
> > > memcpy()?(There are huge amount of such statements in glib.). The -O0<br>
> > option<br>
> > > doesnot work.<br>
> > > Rgrds.<br>
> ><br>
> > This is strange, as I know glib is used by maemo, running on n900, which is<br>
> > an arm.<br>
> ><br>
> > No idea, sorry.<br>
> ><br>
> > > On Fri, Mar 18, 2011 at 11:52 AM, Shuxiang Lim <<a href="mailto:shohyanglim@gmail.com" target="_blank">shohyanglim@gmail.com</a><br>
> > >wrote:<br>
> > ><br>
> > > > Hi,all,caution of the radioactive rays!<br>
> > > > I feel rather frustrated though...Now I have ported libglib2.0 and<br>
> > its<br>
> > > > deps(libintl,libiconv...) onto android as well as libspicec-glib.so and<br>
> > > > snappy.<br>
> > > > But when run,the snappy got only SEGFAULT and killed.<br>
> > > > *#LD_LIBRARY_PATH=/data/local/lib ./snappy -h 192.168.1.31 -p 5900 -o<br>
> > > > ahoo.ppm*<br>
> > > > *[1] + Stopped (signal) LD_LIBRARY_PATH=/data/local/lib ./snappy<br>
> > -h<br>
> > > > 192.168.1.31 -p 5900 -o ahoo.ppm<br>
> > > > [1] Segmentation fault LD_LIBRARY_PATH=/data/local/lib ./snappy<br>
> > -h<br>
> > > > 192.168.1.31 -p 5900 -o ahoo.ppm*<br>
> > > ><br>
> > > > Tracing the process,I found the SEGFAULT came from the<br>
> > > > glib:g_object_new()!:<br>
> > > > gtk/spice-session.c:<br>
> > > > addr = g_object_new (G_TYPE_NETWORK_ADDRESS, "hostname", s->host,<br>
> > "port",<br>
> > > > port, NULL);<br>
> > > > -->libgobject:gobject/gtype.c<br>
> > > > g_object_new()-->g_type_class_ref()-->type_class_init_Wm()<br>
> > > > -->libgio:gio/gnetworkaddress.c<br>
> > > > g_network_address_class_init()-->CRASSSSHHHH.<br>
> > > ><br>
> > > > Now I'm still tracing the bug... It may come from the i18n string ops,<br>
> > but<br>
> > > > if other bug occurs in glib,the future is dim... For I really has no<br>
> > time<br>
> > > > and energy to hack the arcane and exotic glib(or it's caused by the<br>
> > > > incorrect use of glib method in spicec?).(forgive such adjectives,to<br>
> > me,it's<br>
> > > > true)<br>
> > > > I really yearn for the spicec in PURE C and Modularized:<br>
> > > > 1.Offer the switch to disable (do not POSIX-likedly depend on) locale,<br>
> > > > libiconv, libintl, sys/shm.h, pwd.h, pthread,i18n,<br>
> > wchar_t,regex,gettext,...<br>
> > > > for none of them can be found in android!<br>
> > > > 2. Be as far away as we can from the other libs like the<br>
> > > > glib/gtk,pulseaudio/alsalib...<br>
> > > > 3. Completely modularize spicec into libspicec and spicec (this is<br>
> > what I<br>
> > > > am working for)<br>
> > > > as the data layer and the UI layer to ease the porting.<br>
> > > ><br>
> > > > Is there any plan about these now? Can anybody help to do the step 1<br>
> > or<br>
> > > > step 2 above?<br>
> > > > Or, the simplest: the way to safely turn off locale and i18n in glib?<br>
> > > > Pardon my whining and wish me Goodluck!<br>
> > > > And again I shall desperately curse Android and bless Meego!<br>
> > > > Regards.<br>
> > > ><br>
> > > ><br>
> > > > On Thu, Mar 10, 2011 at 9:07 AM, Shuxiang Lim <<a href="mailto:shohyanglim@gmail.com" target="_blank">shohyanglim@gmail.com</a><br>
> > >wrote:<br>
> > > ><br>
> > > >><br>
> > > >> That's true. But the audio output as well as the image output is<br>
> > unexposed<br>
> > > >> or disabled for C/C++ apps in Android.So I plan to dwindle the work to<br>
> > > >> implement the image first,if success, the audio work will be easy to<br>
> > follow.<br>
> > > >><br>
> > > >> Regards.<br>
> > > >><br>
> > > >> On Wed, Mar 9, 2011 at 6:22 PM, Attila Sukosd <<br>
> > <a href="mailto:attila.sukosd@gmail.com" target="_blank">attila.sukosd@gmail.com</a>>wrote:<br>
> > > >><br>
> > > >>> Could you maybe give access to other devs to aid the development?<br>
> > > >>><br>
> > > >>> Rgrds,<br>
> > > >>><br>
> > > >>> Attila<br>
> > > >>><br>
> > > >>><br>
> > > >>> On Wed, Mar 9, 2011 at 11:18 AM, Shuxiang Lim <<a href="mailto:shohyanglim@gmail.com" target="_blank">shohyanglim@gmail.com</a><br>
> > >wrote:<br>
> > > >>><br>
> > > >>>> Yep, I walked around this but to face more chored and nasty troubles<br>
> > in<br>
> > > >>>> porting Pulseaudio lib, time limited, so I decided to DISABLE the<br>
> > > >>>> audio(playback/record) channels first. Thus the porting of<br>
> > libspicec_glib.so<br>
> > > >>>> is finished(along with all its dependences) and<br>
> > androidVNCViewer(whose UI<br>
> > > >>>> will be peeled to become spicec's) proj. has been built:<br>
> > > >>>> *#file libspicec_glib.so *<br>
> > > >>>> libspicec_glib.so: ELF 32-bit LSB shared object, ARM, version 1<br>
> > (SYSV),<br>
> > > >>>> dynamically linked, not stripped<br>
> > > >>>> *#arm-eabi-readelf -d libspicec_glib.so *<br>
> > > >>>> Dynamic section at offset 0x774a4 contains 27 entries:<br>
> > > >>>> Tag Type Name/Value<br>
> > > >>>> 0x00000001 (NEEDED) Shared library: [libc.so]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library: [libm.so]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > > >>>> [libpixman-1.so.0]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > > >>>> [libssl.so.1.0.0]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > > >>>> [libcrypto.so.1.0.0]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > [libjpeg.so.62]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library: [libz.so]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > > >>>> [libglib-2.0.so.0]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > > >>>> [libgio-2.0.so.0]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > > >>>> [libgobject-2.0.so.0]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > > >>>> [libgmodule-2.0.so.0]<br>
> > > >>>> 0x00000001 (NEEDED) Shared library:<br>
> > > >>>> [libgthread-2.0.so.0]<br>
> > > >>>> 0x00000010 (SYMBOLIC) 0x0<br>
> > > >>>> ....<br>
> > > >>>> Now comes the last adventure of Native interfaces exposing and UI<br>
> > > >>>> building!<br>
> > > >>>> Regards.<br>
> > > >>>><br>
> > > >>>><br>
> > > >>>> On Wed, Mar 9, 2011 at 3:57 PM, Shuxiang Lim <<a href="mailto:shohyanglim@gmail.com" target="_blank">shohyanglim@gmail.com</a><br>
> > >wrote:<br>
> > > >>>><br>
> > > >>>>> Well, I think I may try the "--with-coroutine=gthread" in spice-gtk<br>
> > > >>>>> configuring to walk around that...<br>
> > > >>>>><br>
> > > >>>>><br>
> > > >>>>> On Wed, Mar 9, 2011 at 11:10 AM, Shuxiang Lim <<br>
> > <a href="mailto:shohyanglim@gmail.com" target="_blank">shohyanglim@gmail.com</a>>wrote:<br>
> > > >>>>><br>
> > > >>>>>> Hi,I need help!<br>
> > > >>>>>> Now I've managed to divided spicec-gtk into two parts<br>
> > > >>>>>> libspicec.so(based on libpixman.so,libglib-2.0.so...No relation to<br>
> > X11 at<br>
> > > >>>>>> all) and spicec(based on libspicec.so and libgtk.so...). And the<br>
> > glib2.0<br>
> > > >>>>>> porting to Android is also completed. But I'm blocked in compiling<br>
> > libspicec<br>
> > > >>>>>> onto Android at the begining for the continuation.c uses the<br>
> > functions in<br>
> > > >>>>>> <ucontext.h> :setcontext(),getcontext()..., which are some<br>
> > thread-related<br>
> > > >>>>>> funcs as I know,and, definitely unsuprisingly, Android libc<br>
> > doesn't have<br>
> > > >>>>>> them! Is there a way to drop or replace the use of such funcs? Or<br>
> > should I<br>
> > > >>>>>> manually write setcontext from scratch?<br>
> > > >>>>>> RGRDs.<br>
> > > >>>>>><br>
> > > >>>>>><br>
> > > >>>>>> On Mon, Mar 7, 2011 at 5:14 PM, Alon Levy <<a href="mailto:alevy@redhat.com" target="_blank">alevy@redhat.com</a>><br>
> > wrote:<br>
> > > >>>>>><br>
> > > >>>>>>> On Mon, Mar 07, 2011 at 09:08:28AM +0800, Shuxiang Lim wrote:<br>
> > > >>>>>>> > Option 1: use spice-gtk with a gtk android backend<br>
> > > >>>>>>> > a) compiling gtk for it would be possible.<br>
> > > >>>>>>> > b) write a partial gtk backend, good enough for spice-gtk.<br>
> > > >>>>>>> > c) no changes to spice-gtk.<br>
> > > >>>>>>> > Yep,that's really a good hope,but it's another project(too<br>
> > huge<br>
> > > >>>>>>> and far<br>
> > > >>>>>>> > away for me now):<br>
> > > >>>>>>> > Project:"GTK for Android.". So now I can use only the Android<br>
> > SDK<br>
> > > >>>>>>> to finish<br>
> > > >>>>>>> > the UI(the new native UI APIs in NDK is not reliable in<br>
> > versions).<br>
> > > >>>>>>><br>
> > > >>>>>>> Yeah, I think you're right, I can't find anyone already working<br>
> > on<br>
> > > >>>>>>> this by<br>
> > > >>>>>>> simple web search. Maybe spice-gtk's non ui objects are dependent<br>
> > > >>>>>>> only on<br>
> > > >>>>>>> gobject / stuff that is easy to just drop in (ugly, but still<br>
> > more<br>
> > > >>>>>>> maintainable<br>
> > > >>>>>>> then basing your work on spicec, long term).<br>
> > > >>>>>>><br>
> > > >>>>>>> > And also you've referred that "spicec is already platform<br>
> > > >>>>>>> independent",<br>
> > > >>>>>>> > that's true to Linux and Windows,but not to Android,for such<br>
> > > >>>>>>> independence is<br>
> > > >>>>>>> > based on the C++ independence over the os which cannot stand<br>
> > > >>>>>>> through the<br>
> > > >>>>>>> > JAVA UIed android.So there is no way to just add a subdir<br>
> > ./android<br>
> > > >>>>>>> under<br>
> > > >>>>>>> > spice/client along with ./x11 and ./windows. It should be a<br>
> > > >>>>>>> combined proj.<br>
> > > >>>>>>> > of C/C++ and Java. (That's why I hate Android and yearn for<br>
> > > >>>>>>> Maemo/Meego.)<br>
> > > >>>>>>><br>
> > > >>>>>>> Definitely easier to port to Maemo :)<br>
> > > >>>>>>><br>
> > > >>>>>>> > Regards.<br>
> > > >>>>>>> ><br>
> > > >>>>>>> > On Fri, Mar 4, 2011 at 7:04 PM, Alon Levy <<a href="mailto:alevy@redhat.com" target="_blank">alevy@redhat.com</a>><br>
> > > >>>>>>> wrote:<br>
> > > >>>>>>> ><br>
> > > >>>>>>> > > On Fri, Mar 04, 2011 at 06:21:19PM +0800, Shuxiang Lim wrote:<br>
> > > >>>>>>> > > > Hi, friends,<br>
> > > >>>>>>> > > > Thanks for your replies. It's definitely right till now<br>
> > > >>>>>>> I've been<br>
> > > >>>>>>> > > > working a tougher way compared to spice-gtk.And actually<br>
> > I've<br>
> > > >>>>>>> considered<br>
> > > >>>>>>> > > to<br>
> > > >>>>>>> > > > steer my way to the latter in fear of the troublesome and<br>
> > > >>>>>>> crippled C++<br>
> > > >>>>>>> > > > support in Android NDK:C is more "simple and safe" in<br>
> > Android<br>
> > > >>>>>>> than C++.<br>
> > > >>>>>>> > > > But,AFAIK,there is no gtk port for Android yet. And the<br>
> > biggest<br>
> > > >>>>>>> obstacle<br>
> > > >>>>>>> > > is<br>
> > > >>>>>>> > > > the framework of Android:in its design,all UI should be<br>
> > done in<br>
> > > >>>>>>> JAVA<br>
> > > >>>>>>> > > powered<br>
> > > >>>>>>> > > > by SKIA libs.Therefore the port of UI libs(GTK,etc) will be<br>
> > > >>>>>>> choked by the<br>
> > > >>>>>>> > > > I/O level because Android don't completely expose them at<br>
> > > >>>>>>> all!(I once<br>
> > > >>>>>>> > > > managed to port Xfbdev onto it,but that's not commercially<br>
> > > >>>>>>> practical at<br>
> > > >>>>>>> > > all,<br>
> > > >>>>>>> > > > it's just a geeky trick maybe,an app in Android SHOULD NOT<br>
> > do<br>
> > > >>>>>>> this.) Only<br>
> > > >>>>>>> > > > the algorithm/data computing-related C/C++ libs are<br>
> > welcomed to<br>
> > > >>>>>>> be the<br>
> > > >>>>>>> > > JNI<br>
> > > >>>>>>> > > > servants to JAVA UI apps in Android.<br>
> > > >>>>>>> > > > You see, in such aspect, there is not too much diff<br>
> > between<br>
> > > >>>>>>> the C++<br>
> > > >>>>>>> > > way<br>
> > > >>>>>>> > > > and gtk way in the porting of UI part.<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > I'm going to try to prove that wrong by grepping hoping it<br>
> > makes<br>
> > > >>>>>>> sense, I<br>
> > > >>>>>>> > > never<br>
> > > >>>>>>> > > actually coded in gtk:<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > $ git grep GObjectClass<br>
> > > >>>>>>> > > gtk/channel-cursor.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> > > G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/channel-display.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> > > G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/channel-inputs.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> > > G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/channel-main.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/channel-playback.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> > > G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/channel-record.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> > > G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/spice-audio.h: GObjectClass parent_class;<br>
> > > >>>>>>> > > gtk/spice-channel.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> G_OBJECT_CLASS<br>
> > > >>>>>>> > > (klass);<br>
> > > >>>>>>> > > gtk/spice-channel.h: GObjectClass parent_class;<br>
> > > >>>>>>> > > gtk/spice-gstaudio.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> > > G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/spice-pulse.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/spice-session.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> > > G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > > gtk/spice-session.h: GObjectClass parent_class;<br>
> > > >>>>>>> > > gtk/spice-widget.c: GObjectClass *gobject_class =<br>
> > > >>>>>>> G_OBJECT_CLASS(klass);<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > otoh:<br>
> > > >>>>>>> > > U playa:spice-gtk alon (master)$ git grep --name-only<br>
> > GdkWindow<br>
> > > >>>>>>> > > gtk/spice-widget-cairo.c<br>
> > > >>>>>>> > > gtk/spice-widget.c<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > (if you grep Window you get false negatives because of the<br>
> > > >>>>>>> compression<br>
> > > >>>>>>> > > window).<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > Anyway, this is a lame attempt to prove the gtk stuff that<br>
> > does<br>
> > > >>>>>>> ui (read:<br>
> > > >>>>>>> > > uses X)<br>
> > > >>>>>>> > > is separated in the code/architecture level :)<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > > So for me the shining light of spicec-gtk is not in<br>
> > "GTK"<br>
> > > >>>>>>> but in "C".<br>
> > > >>>>>>> > > I<br>
> > > >>>>>>> > > > dare not to say I'm clear about every nook in spicec at<br>
> > all. My<br>
> > > >>>>>>> best hope<br>
> > > >>>>>>> > > is<br>
> > > >>>>>>> > > > that the IO in spicec shall be straight and succinct ,the<br>
> > inner<br>
> > > >>>>>>> > > > graphic/sound computing(decompress,etc) shall have NO<br>
> > relation<br>
> > > >>>>>>> with upper<br>
> > > >>>>>>> > > UI<br>
> > > >>>>>>> > > > libs at all, so I can pipe the Finished image flow into UI<br>
> > > >>>>>>> through JNI<br>
> > > >>>>>>> > > > interfaces and direct the user input backward. (That's why<br>
> > I<br>
> > > >>>>>>> can borrow<br>
> > > >>>>>>> > > the<br>
> > > >>>>>>> > > > UI from AndroidVNCViewer)<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > Yeah, I think it is generally so, but again, it's so in<br>
> > spice-gtk<br>
> > > >>>>>>> too, and<br>
> > > >>>>>>> > > that's<br>
> > > >>>>>>> > > our only future supported client (*).<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > (*) plans do change.<br>
> > > >>>>>>> > > ><br>
> > > >>>>>>> > > > libspicec.so(do most jobs)<br>
> > > >>>>>>> > > > <==finishedimages/audio>>===<<inputs==>spicec.java.ui(only<br>
> > UI)<br>
> > > >>>>>>> > > ><br>
> > > >>>>>>> > > > Am I right? Is there any design that will frustrate this in<br>
> > > >>>>>>> spicec or<br>
> > > >>>>>>> > > > spice-gtk?<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > spicec is already separated at the platform level, since it<br>
> > uses<br>
> > > >>>>>>> low level<br>
> > > >>>>>>> > > libraries directly, unlike spice-gtk (X and GDI). So you<br>
> > would<br>
> > > >>>>>>> basically<br>
> > > >>>>>>> > > be adding a platform/android.<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > In gtk I really haven't done android development, ever, at<br>
> > least<br>
> > > >>>>>>> not in the<br>
> > > >>>>>>> > > C level, but I was hoping:<br>
> > > >>>>>>> > > Option 1: use spice-gtk with a gtk android backend<br>
> > > >>>>>>> > > a) compiling gtk for it would be possible.<br>
> > > >>>>>>> > > b) write a partial gtk backend, good enough for spice-gtk.<br>
> > > >>>>>>> > > c) no changes to spice-gtk.<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > Option 2 is of course to make spice-gtk also have platform<br>
> > > >>>>>>> separation,<br>
> > > >>>>>>> > > while<br>
> > > >>>>>>> > > still using gtk/gobject for all stuff that would Just Work<br>
> > when<br>
> > > >>>>>>> doing 1.a<br>
> > > >>>>>>> > > (the<br>
> > > >>>>>>> > > data structures, the signals, the macros, the<br>
> > introspection?).<br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > > Regards.<br>
> > > >>>>>>> > > ><br>
> > > >>>>>>> > > ><br>
> > > >>>>>>> > > > On Fri, Mar 4, 2011 at 4:36 PM, Alon Levy <<br>
> > <a href="mailto:alevy@redhat.com" target="_blank">alevy@redhat.com</a>><br>
> > > >>>>>>> wrote:<br>
> > > >>>>>>> > > ><br>
> > > >>>>>>> > > > > On Fri, Mar 04, 2011 at 03:38:51PM +0800, Shuxiang Lim<br>
> > wrote:<br>
> > > >>>>>>> > > > > > Hi all,<br>
> > > >>>>>>> > > > > > I'm trying these days to port spicec into<br>
> > Android.But<br>
> > > >>>>>>> it's a<br>
> > > >>>>>>> > > rather<br>
> > > >>>>>>> > > > > TOUGH<br>
> > > >>>>>>> > > > > > way to go because the structure of spicec and android<br>
> > are<br>
> > > >>>>>>> desperately<br>
> > > >>>>>>> > > > > > inappropriate:the linux version of spicec is based on<br>
> > the<br>
> > > >>>>>>> X11,which<br>
> > > >>>>>>> > > is<br>
> > > >>>>>>> > > > > not<br>
> > > >>>>>>> > > > > > available in Android,thus the UI of spicec should be<br>
> > > >>>>>>> rewritten from<br>
> > > >>>>>>> > > > > > scratch...More troublesome is that the UI part and data<br>
> > > >>>>>>> part in<br>
> > > >>>>>>> > > current<br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > > Haven't looked at your proposal below yet, but did you<br>
> > check<br>
> > > >>>>>>> the<br>
> > > >>>>>>> > > spice-gtk<br>
> > > >>>>>>> > > > > work? maybe it is easier to start from that? are gtk<br>
> > > >>>>>>> libraries<br>
> > > >>>>>>> > > available on<br>
> > > >>>>>>> > > > > android? not talking about X. spice-gtk has objects for<br>
> > > >>>>>>> connection and<br>
> > > >>>>>>> > > > > channels<br>
> > > >>>>>>> > > > > that afaik don't do any output, that's separate from the<br>
> > > >>>>>>> actual widget<br>
> > > >>>>>>> > > that<br>
> > > >>>>>>> > > > > uses X. Also, gtk 3 has backends - did anyone do a<br>
> > backend<br>
> > > >>>>>>> for android?<br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > > Since going forward we plan to ditch the spicec client,<br>
> > that<br>
> > > >>>>>>> would be<br>
> > > >>>>>>> > > > > really<br>
> > > >>>>>>> > > > > preffered. Now that I see what you have planned it sounds<br>
> > > >>>>>>> good, but<br>
> > > >>>>>>> > > better<br>
> > > >>>>>>> > > > > to use spice-gtk.<br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > > of course that's not to say we won't love to see this<br>
> > working<br>
> > > >>>>>>> anyway :)<br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > > > spicec is entangled in the hierarchical system in C++!<br>
> > So<br>
> > > >>>>>>> my plan is<br>
> > > >>>>>>> > > > > this:<br>
> > > >>>>>>> > > > > > first split the spicec into two parts,data and<br>
> > UI,transform<br>
> > > >>>>>>> the data<br>
> > > >>>>>>> > > part<br>
> > > >>>>>>> > > > > > into libspicec.so;then rewrite the UI part in JAVA.<br>
> > > >>>>>>> Besides, I should<br>
> > > >>>>>>> > > > > also<br>
> > > >>>>>>> > > > > > tinker some problems caused by the Crippled NDK C++<br>
> > support<br>
> > > >>>>>>> and the<br>
> > > >>>>>>> > > Lamed<br>
> > > >>>>>>> > > > > > bionic c lib in android .<br>
> > > >>>>>>> > > > > > And now the first step is roughly done,hence the<br>
> > change<br>
> > > >>>>>>> of the<br>
> > > >>>>>>> > > spicec<br>
> > > >>>>>>> > > > > > structure:<br>
> > > >>>>>>> > > > > > From<br>
> > > >>>>>>> > > > > ><br>
> > > >>>>>>> > > |-->playback<br>
> > > >>>>>>> > > > > > thread<br>
> > > >>>>>>> > > > > ><br>
> > > >>>>>>> > > |-->cursor<br>
> > > >>>>>>> > > > > > thread<br>
> > > >>>>>>> > > > > > spicec:spicec process(application process)-->main<br>
> > > >>>>>>> thread->|-->*record<br>
> > > >>>>>>> > > > > thread<br>
> > > >>>>>>> > > > > > *<br>
> > > >>>>>>> > > > > ><br>
> > > >>>>>>> > > |-->inputs<br>
> > > >>>>>>> > > > > > thread<br>
> > > >>>>>>> > > > > ><br>
> > > >>>>>>> > > |-->display<br>
> > > >>>>>>> > > > > > thread<br>
> > > >>>>>>> > > > > > To:<br>
> > > >>>>>>> > > > > > ===========================><br>
> > > >>>>>>> > > > > > |-->libspicec.so:application<br>
> > > >>>>>>> thread-->main<br>
> > > >>>>>>> > > > > > thread------>|<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > | |<--display<br>
> > > >>>>>>> thread<--|<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > | |--->|<--cursor<br>
> > > >>>>>>> > > > > > thread<---|<------------------|<br>
> > > >>>>>>> > > > > > | | |<--inputs<br>
> > > >>>>>>> thread<---|<br>
> > > >>>>>>> > > > > > spicec:spicec process--->| | |<--playback<br>
> > > >>>>>>> thread<-|<br>
> > > >>>>>>> > > > > > | |<br>
> > > >>>>>>> > > > > > | |<br>
> > > >>>>>>> > > > > > | |<br>
> > > >>>>>>> > > > > > <---------------------------------------------|<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > |-->spicec:platform<br>
> > > >>>>>>> > > > > > thread------------------------------>|<br>
> > > >>>>>>> > > > > ><br>
> > > >>>>>>> > > > > > The hierarchical relationship has been unleashed with<br>
> > one<br>
> > > >>>>>>> > > thread(record<br>
> > > >>>>>>> > > > > > channel) deleted and two new threads (app and platform)<br>
> > > >>>>>>> created. The<br>
> > > >>>>>>> > > > > first<br>
> > > >>>>>>> > > > > > as the "data thread",the other as the "work thread"<br>
> > which<br>
> > > >>>>>>> is driven<br>
> > > >>>>>>> > > by<br>
> > > >>>>>>> > > > > the<br>
> > > >>>>>>> > > > > > signals from the first thread as well as its sub<br>
> > threads<br>
> > > >>>>>>> and<br>
> > > >>>>>>> > > requested to<br>
> > > >>>>>>> > > > > do<br>
> > > >>>>>>> > > > > > the UI-related work:<br>
> > > >>>>>>> > > > > ><br>
> > > >>>>>>> > > > > > platform thread:------------>blocked and waiting:-->job<br>
> > > >>>>>>> > > > > > request-<--------------|<br>
> > > >>>>>>> > > > > > | |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > ^ |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > | |<br>
> > > >>>>>>> > > > > ><br>
> > |<----------|-<-|<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > |<br>
> > |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > platform thread over<----------if(job==die)<--|<br>
> > > >>>>>>> send req.<br>
> > > >>>>>>> > > blocked<br>
> > > >>>>>>> > > > > > and waiting<br>
> > > >>>>>>> > > > > > |<br>
> > ^<br>
> > > >>>>>>> |<br>
> > > >>>>>>> > > > > > |<br>
> > > >>>>>>> > > > > > |<br>
> > |<br>
> > > >>>>>>> |<br>
> > > >>>>>>> > > > > > ^<br>
> > > >>>>>>> > > > > > |<br>
> > |<br>
> > > >>>>>>> |<br>
> > > >>>>>>> > > > > > _________|_________<br>
> > > >>>>>>> > > > > > |<br>
> > |<br>
> > > >>>>>>> |<br>
> > > >>>>>>> > > > > > | app/plbk/cusor<br>
> > > >>>>>>> > > > > > thd<br>
> > > >>>>>>> > > > > > |<---job done----dojob()<--else--|<br>
> > |<br>
> > > >>>>>>> |->go<br>
> > > >>>>>>> > > on->|<br>
> > > >>>>>>> > > > > > __________________<br>
> > > >>>>>>> > > > > > |<br>
> > |<br>
> > > >>>>>>> > > > > > |------------------------------->feed<br>
> > back-->|<br>
> > > >>>>>>> > > > > ><br>
> > > >>>>>>> > > > > ><br>
> > > >>>>>>> > > > > > So the next work is to expose the native JNI interface<br>
> > in<br>
> > > >>>>>>> platform<br>
> > > >>>>>>> > > thread<br>
> > > >>>>>>> > > > > to<br>
> > > >>>>>>> > > > > > the UI written in Android SDK. I try to use the UI<br>
> > > >>>>>>> > > > > > frame of AndroidVNCViewer in<br>
> > > >>>>>>> > > > > > <a href="http://code.google.com/p/*android*-*vnc*-viewer/,then" target="_blank">code.google.com/p/*android*-*vnc*-viewer/,then</a> the<br>
> > work of<br>
> > > >>>>>>> platform<br>
> > > >>>>>>> > > > > > thread will be replaced by UI but the msg<br>
> > > >>>>>>> > > > > > communication to libspicec will be remained. That's the<br>
> > > >>>>>>> easiest way I<br>
> > > >>>>>>> > > can<br>
> > > >>>>>>> > > > > > envisage except rewriting all parts in spicec from<br>
> > scratch.<br>
> > > >>>>>>> > > > > > It's tough too, for I have poor experiance in Java...<br>
> > > >>>>>>> > > > > > Anyway, is there any other guy working on this? Is<br>
> > my<br>
> > > >>>>>>> way<br>
> > > >>>>>>> > > > > feasible??Any<br>
> > > >>>>>>> > > > > > Ideas or help is appreciated.<br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > > See above for ideas, don't read them as a criticism, I<br>
> > think<br>
> > > >>>>>>> this is<br>
> > > >>>>>>> > > > > fantastic<br>
> > > >>>>>>> > > > > what you've done so far. I remember someone posting "we<br>
> > are<br>
> > > >>>>>>> working on<br>
> > > >>>>>>> > > > > andriod<br>
> > > >>>>>>> > > > > in our spare time" post to spice-devel, please grep the<br>
> > > >>>>>>> archive.<br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > > Alon<br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > > > Best regards.<br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > > > _______________________________________________<br>
> > > >>>>>>> > > > > > Spice-devel mailing list<br>
> > > >>>>>>> > > > > > <a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
> > > >>>>>>> > > > > ><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > > > ><br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > > > _______________________________________________<br>
> > > >>>>>>> > > > Spice-devel mailing list<br>
> > > >>>>>>> > > > <a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
> > > >>>>>>> > > > <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
> > > >>>>>>> > ><br>
> > > >>>>>>> > ><br>
> > > >>>>>>><br>
> > > >>>>>>> > _______________________________________________<br>
> > > >>>>>>> > Spice-devel mailing list<br>
> > > >>>>>>> > <a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
> > > >>>>>>> > <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
> > > >>>>>>><br>
> > > >>>>>>><br>
> > > >>>>>><br>
> > > >>>>><br>
> > > >>>><br>
> > > >>>> _______________________________________________<br>
> > > >>>> Spice-devel mailing list<br>
> > > >>>> <a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
> > > >>>> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
> > > >>>><br>
> > > >>>><br>
> > > >>><br>
> > > >><br>
> > > ><br>
> ><br>
> > > _______________________________________________<br>
> > > Spice-devel mailing list<br>
> > > <a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
> > > <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
> ><br>
> ><br>
<br>
> _______________________________________________<br>
> Spice-devel mailing list<br>
> <a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
<br>
</div></div></blockquote></div><br>