SDL-Qtopia : QPaintDevice: Must construct a QApplication before a QPaintDevice

Hi!

I’m struggling from working with an application including SDL on Zaurus.

I cross-compiled the source of application and I succeed to play wav
file by using SDL. However, when I execute the video file(mp4, mpeg1,
avi, etc , I already have their codec) on Zaurus, I got an error message
as follows._______________________________________________________________

QPaintDevice: Must construct a QApplication before a QPaintDevice.

Aborted.


Zaurus support Qt and I separately cross-compiled SDL after reading
README-Qtopia. And I tried to test SDL-ipkg in the Internet instead of
using SDL in my source. But it is always same. For my information, it
seems that SDL is correctly cross-compiled, because the music (wav) is
played well.

In the previous letters, I read writings about QPaintDevice error. But
it seems that the letters do not include the exact solution about that
problem.

Is there anyone who can comment on this error?

I’m struggling from working with an application including SDL on Zaurus.

I cross-compiled the source of application and I succeed to play wav
file by using SDL. However, when I execute the video file(mp4, mpeg1,
avi, etc , I already have their codec) on Zaurus, I got an error message
as follows.

QPaintDevice: Must construct a QApplication before a QPaintDevice.
Aborted.

I get the same error with my program. I think the Zaurus version of the SDL
in cvs is broken an didn’t work for graphics output.

On http://www.gnurou.org/software/zaurus/ you can get a working version of
the SDL for the Zaurus including development files. Maybe this works for you.
This version is not the same as the actual version in cvs. Unfortunally this
version misses the SDL_WM_IconifyWindow function which I need. :frowning:

Btw. There is a interesting class for video output on the Zaurus available
under http://www.warmi.net/zaurus/blits.shtml

But in my opinion a working and complete SDL for the Zaurus would be much
better.–
@Bernd_Lachner

+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!

blachner at gmx.de writes:

I’m struggling from working with an application including SDL on Zaurus.

I cross-compiled the source of application and I succeed to play wav
file by using SDL. However, when I execute the video file(mp4, mpeg1,
avi, etc , I already have their codec) on Zaurus, I got an error message
as follows.

QPaintDevice: Must construct a QApplication before a QPaintDevice.
Aborted.

Doh. Silly bug. Apply the patch attached to the SDL_Qtopia_main.cc
file.

Sam: Please apply this to CVS–
[ Below is a random fortune, which is unrelated to the above message. ]
You own a dog, but you can only feed a cat.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_Qtopia_main.diff
Type: text/x-patch
Size: 624 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030325/274289c2/attachment-0007.bin

Doh. Silly bug. Apply the patch attached to the SDL_Qtopia_main.cc file.
I tried the patch and I recompiled the SDL and the program, but it didn’t
work.

O.K. No message “QPaintDevice: Must construct a QApplication before a
QPaintDevice. Aborted.” is printed anymore, but the program freezes now
completely. Only a reboot of the Zaurus helps.

It seems the program stops in SDLMain before it comes to its own main routine.
Have someone had success with the patched SDL version?

Best regards

Bernd Lachner

Bernd Lachner writes:

Doh. Silly bug. Apply the patch attached to the SDL_Qtopia_main.cc file.
I tried the patch and I recompiled the SDL and the program, but it didn’t
work.

O.K. No message “QPaintDevice: Must construct a QApplication before a
QPaintDevice. Aborted.” is printed anymore, but the program freezes now
completely. Only a reboot of the Zaurus helps.

It seems the program stops in SDLMain before it comes to its own main routine.
Have someone had success with the patched SDL version?

I successfully ran a test on x86 using it but I couldn’t try it on the
sharp. I’ll see if I can figure something out.–
[ Below is a random fortune, which is unrelated to the above message. ]
Q: What do you call a blind pre-historic animal?
A: Diyathinkhesaurus.

Q: What do you call a blind pre-historic animal with a dog?
A: Diyathinkhesaurus Rex.

Bernd Lachner writes:

Doh. Silly bug. Apply the patch attached to the SDL_Qtopia_main.cc file.
I tried the patch and I recompiled the SDL and the program, but it didn’t
work.

O.K. No message “QPaintDevice: Must construct a QApplication before a
QPaintDevice. Aborted.” is printed anymore, but the program freezes now
completely. Only a reboot of the Zaurus helps.

It seems the program stops in SDLMain before it comes to its own main routine.
Have someone had success with the patched SDL version?

I just tried my own project-in-progress on the Zaurus using SDL and it
works perfectly. I.e if you have a problem it might be something else
(checked with gdb?).–
[ Below is a random fortune, which is unrelated to the above message. ]
You recoil from the crude; you tend naturally toward the exquisite.

I just tried my own project-in-progress on the Zaurus using SDL and it
works perfectly. I.e if you have a problem it might be something else
(checked with gdb?).
No, I didn’t checked it with gdb. I will try to check it, but at the moment
the gdb I installed on the Zausus misses libncurses and I didn’t find a
working libncurses till now. If someone know where I can get a package with a
working gdb and a package with a working ncurses lib, please write me.

Maybe I try it with remote debugging and gdbserver, but I have no expreience
with remote debugging and also none with gdb directly.

Btw. I compiled Frodo gain with the old (1.2.5 cvs) SDL and installed both on
the Zaurus and it worked well, but without iconify.

I compiled the same Frodo source with the actual (1.2.6 cvs with your patch)
an installed both on the Zaurus and the Zaurus freezes when I start Frodo.

So I think the problem must be related with the new SDL or SDLmain. Maybe I
compile the new SDL int the wrong way, but I do it similar to 1.2.5 cvs.

Bernd Lachner writes:

So I think the problem must be related with the new SDL or SDLmain. Maybe I
compile the new SDL int the wrong way, but I do it similar to 1.2.5 cvs.

Well, as I said, I have used this exact SDL for my own recent
development. This does prove that SDL does work so it might be some
specific functionality or feature (or even bug) in frodo as well.–
[ Below is a random fortune, which is unrelated to the above message. ]
A is for Apple.
– Hester Pryne

Well, as I said, I have used this exact SDL for my own recent
development. This does prove that SDL does work so it might be some
specific functionality or feature (or even bug) in frodo as well.

Yes, mabe that is the case. I will try to find the bug with gdb/gdbserver in
the next days.

Please can you put a IPK of the SDL version you use and an package with the
development files on the net for downloading, like its done on
http://www.gnurou.org/software/zaurus/ . In this way I can check if something goes wrong
with patching and compiling the acual SDL. If you have time to make the
packages an you don’t want to put it on the net, you can send it to my email address
directly.–
@Bernd_Lachner

+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!

If it is to much work for you to make a SDL IPK and a developer archive,
please send the necessary binary files and the header to my email adsress. I
will make the packages.–
@Bernd_Lachner

+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!

blachner at gmx.de writes:

If it is to much work for you to make a SDL IPK and a developer archive,
please send the necessary binary files and the header to my email adsress. I
will make the packages.

You don’t need me to make an ipk or send you binaries. I use SDL CVS
with the patch I sent you, using the normal Embedix cross
compiler. There’s nothing special to it and nothing that can go wrong
in the compilation. I long ago stepped down from making SDL binaries
since I don’t want to deal with the hassle (and actually don’t use it
for my own games - I use audio/mixer but not video, input etc).

As for the SDL on http://www.gnurou.org/software/zaurus/ - the patch
against CVS as specified is flawed. For example it has a forced
keyboard grabbing (which CVS handles using SDL_WM_GrabInput) and most
likely will not properly release the keys after exiting (a workaround
is needed).

I don’t know what the heck the change of qApp to myapp is all about
(that is entirely redundant - qApp is a Qt global pointer to the
current application). Uh, actually, after reading the patch again I
see that ANOTHER application object is created, using invalid
argv. That is entirely broken and it will cause problems. The
application is created in the SDL_main. The only valid patch I can see
is the Hyper_L and Hyper_R mappings (which doesn’t matter on any
current Qtopia platforms, since even if they have a keyboard they
don’t have any Hyper_X keys).

Alexandre, can you please apply the one line patch to CVS that I
posted earlier (it’s not yet appliced in the CVS), and rebuild your
packages without your patch (well, except Hyper_X I supposse)? Also
send the Hyper_X patch to Sam so it can be applied to CVS. The rest of
your patch is invalid and should be reverted.–
[ Below is a random fortune, which is unrelated to the above message. ]
You will visit the Dung Pits of Glive soon.

O.K. I now have learned a little about remote debugging on the Zaurus and I
have found where the program crashes. When the program call SDL_PollEvent a
segmetation fault in this function occurs. This only happens with 1.2.6 CVS
versions of the SDL not with previous versions.

Unfortunately, till now, I have not learned enough about remote debugging
and gdb to step into the SDL code of SDL_PollEvent. I don’t know how I can
view the related source cod. So I don’t know where it crashes exactly in
SDL_PollEvent.

David, maybe you have a idea why it crashes in SDL_PollEvent and how it can
be solved?–
@Bernd_Lachner

+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!

blachner at gmx.de writes:

O.K. I now have learned a little about remote debugging on the Zaurus and I
have found where the program crashes. When the program call SDL_PollEvent a
segmetation fault in this function occurs. This only happens with 1.2.6 CVS
versions of the SDL not with previous versions.

Unfortunately, till now, I have not learned enough about remote debugging
and gdb to step into the SDL code of SDL_PollEvent. I don’t know how I can
view the related source cod. So I don’t know where it crashes exactly in
SDL_PollEvent.

David, maybe you have a idea why it crashes in SDL_PollEvent and how it can
be solved?

Sounds like you didn’t correctly link with SDL_main and that the
QPEApplication isn’t correctly setup…?–
[ Below is a random fortune, which is unrelated to the above message. ]
I must have a prodigious quantity of mind; it takes me as much as a
week sometimes to make it up.
– Mark Twain, “The Innocents Abroad”

Sounds like you didn’t correctly link with SDL_main and that the
QPEApplication isn’t correctly setup…?

Hmm. SDL_main is linked to the program. The debugger starts at the SDL_main
main function. As far I can see in the debugger, all in SDL_main main
function is executed.

How can I else check, if the program is linked correctly with SDL_main or if
QPEApplication is correctly setup?–
@Bernd_Lachner

+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!

Hello David,

O.K. now I learned a little bit more about gdb and cross debugging and I
stepped in the
SDL code.

It crashes in SDL_sysevents.cc in qApp->processEvents(). Below is the part
of the code
where it crashs. This is called by SDL_PollEvents / SDL_PumpEvents /
video->PumpEvents
/ QT_PumpEvents.

void QT_PumpEvents(_THIS)
{
if(!qApp) {
return;
}
// printf(“processing events: %p\n”, qApp);
//qApp->processOneEvent(); // wait for a event
qApp->processEvents(); // and process all outstanding ones

The debugger prints:

Program received signal SIGSEGV, Segmentation fault.
memcpy (dstpp=0x407db080, srcpp=0x40825448, len=480) at
…/sysdeps/generic/memcpy.c:55
in …/sysdeps/generic/memcpy.c
Current language: auto; currently c

This crash seems to be inside the Qt libraries. Any idea? Btw. I use the
original Sharp
ROM but I think the SDL should work on this.

Best regards

Bernd Lachner–
@Bernd_Lachner

+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!