Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: Mmmm on February 24, 2006, 12:05:56 PM

Title: Simulator problems
Post by: Mmmm on February 24, 2006, 12:05:56 PM
I just can't get the simulator to compile in linux...
I'm getting loads of undefined reference errors... this is how it starts:
Code: [Select]
LD rockboxui
/home/Martin/build/_rockbox/sim/libcomsim.a(io.o)(.text+0x7b9): In function `sim_codec_load_ram':
/home/Martin/build/_rockbox/uisimulator/common/io.c:354: undefined reference to `dlopen'
/home/Martin/build/_rockbox/sim/libcomsim.a(io.o)(.text+0x7e3):/home/Martin/build/_rockbox/uisimulator/common/io.c:362: undefined reference to `dlerror'

Then it goes on to lots more undefined references with X in the name:
Code: [Select]
/usr/lib/libSDL.a(SDL_x11events.o)(.text+0x969): In function `X11_KeyToUnicode':
: undefined reference to `XLookupString'
/usr/lib/libSDL.a(SDL_x11events.o)(.text+0xa2b): In function `X11_SetKeyboardState':
: undefined reference to `XQueryPointer'
/usr/lib/libSDL.a(SDL_x11events.o)(.text+0xc2e): In function `.L127':
: undefined reference to `XQueryKeymap'
/usr/lib/libSDL.a(SDL_x11events.o)(.text+0xc97): In function `X11_PumpEvents':
: undefined reference to `XNextEvent'
/usr/lib/libSDL.a(SDL_x11events.o)(.text+0xf20): In function `.L168':
: undefined reference to `XCheckTypedEvent'
This goes on for pages and pages (full log file attached)

I've only just installed linux so I thought I'd probably not installed a certain package, but as far as I can tell I've got all the Xlib packages and SDL packages..

Anyone have any ideas?  ???

[attachment deleted by admin, too old]
Title: Re: Simulator compiling problems
Post by: bk on February 24, 2006, 07:47:36 PM
What distribution are you using? It sounds like your LDOPTS are screwed up and you may have some packages missing from your Linux install (you shouldn't be getting unreferenced symbol errors from within the SDL libs). If you're using Fedora or some RPM-based distro, make sure you have all the relevent *-devel packages installed (sdl-devel, xorg-devel, glibc-headers, etc).
Title: Re: Simulator compiling problems
Post by: Mmmm on February 25, 2006, 10:54:33 AM
I'm using SUSE9.2 which is an RPM based distro...
I have:

sdl-devel 1.2.9-1
glibc-devel 2.3.3-118
but no xorg-devel...ooh..maybe that's it, I'll give that a go..Thanks
All I needed was a list of what should be installed...
 :D
Title: Re: Simulator compiling problems
Post by: Mmmm on February 25, 2006, 11:06:36 AM
 :(

oh well... it didn't work, I still get the same error
Now I also have:

xorg-x11-devel 6.8.1-15.4

Is there anything else that I should make sure I have?
Title: Re: Simulator compiling problems
Post by: bk on February 25, 2006, 01:44:18 PM
You are getting undef ref errors in your SDL installation which makes me think that whatever SDL packages you installed weren't compiled for your distribution, or you have some other dependency problem. In any event, I suspect your SDL packages are the root of the problem.

EDIT: Problem #1 is that you have different versions of sdl and sdl-devel installed. Problem #2 is that (according to google), the sdl that shipped with SUSE 9.2 was buggy wrt ALSA and possibly other things as well. Uninstall your SDL packages, reinstall SDL and make sure it is at least 1.2.8. Also make sure you update any dependencies.
Title: Re: Simulator compiling problems
Post by: Mmmm on February 25, 2006, 03:05:00 PM
WOOOOOOOOOOOOOOHOOOOOOOOOOOOOOOOOOO

Bk, you are my hero!!!

I could only find SDL 1.2.7-41.1 but that works fine, it compiles very nicely now....

thankyouthankyouthankyouthankyouthankyou....  :D

Ok, now for the next problem..

below is a screen shot of the simulator...hmmmm seems the bmp file is not loading.. what do you think?

[attachment deleted by admin, too old]
Title: Re: Simulator compiling problems
Post by: bk on February 25, 2006, 03:32:04 PM
Yeah, the player bmps don't load for me either. I assumed that was intentional since the old X11 sim didn't have the pretty bmps either.

Glad to hear you got it working.
Title: Re: Simulator compiling problems
Post by: Llorean on February 25, 2006, 03:33:25 PM
Yeah, at the moment I think you have to actually use a command line parameter to get the background image, or something. I don't know what it is, but I know that by default it intentionally doesn't display it. I'm not 100% sure you can, but I think you can.
Title: Re: Simulator compiling problems
Post by: Bagder on February 25, 2006, 04:15:09 PM
./rockboxui --background
Title: Re: Simulator compiling problems
Post by: nicolinux on February 26, 2006, 05:40:39 AM
Ah, I see you have fixed your problems ! I still have mine but I hope I'll be able to resolve it ! ;)
Title: Re: Simulator compiling problems
Post by: Mmmm on February 26, 2006, 07:48:12 AM
Yep....

./rockboxui --background did the trick as you can see below!

How come this doesn't load by default? I suppose it's not really important eh?

[attachment deleted by admin, too old]
Title: Re: Simulator compiling problems
Post by: Bagder on February 26, 2006, 08:27:08 AM
Quote
How come this doesn't load by default?

Since it is just eye candy fluff with no useful purpose.
Title: Re: Simulator compiling problems
Post by: Llorean on February 26, 2006, 08:32:07 AM
I have to ask, is there a text or text-like file somewhere other than the source that tells the button->key mappings for any given simulator, or is it just the backgrounds and the source?

I'll admit I haven't looked around too much for this yet since I just thought of it, but since you mentioned that the image is "eye candy fluff" but it's also a quick easy way to reference the controls. Is there another way?
Title: Re: Simulator compiling problems
Post by: Bagder on February 26, 2006, 08:38:27 AM
I have to ask, is there a text or text-like file somewhere other than the source that tells the button->key mappings for any given simulator, or is it just the backgrounds and the source?

I don't think we have a document for it (yet). Most the sims do output a brief key mapping explanation on stdout when you start it though.
Title: Re: Simulator compiling problems
Post by: Llorean on February 26, 2006, 08:40:43 AM
Which would be fine, except I think the SDL sim doesn't show stdout in the console on cygwin at least. Well, no worries either way, I've gotten the hang of the sims I use.
Title: Re: Simulator compiling problems
Post by: Mmmm on February 26, 2006, 11:12:50 AM
Ok then simulator is working very nicely except it wont play ogg files!
Code: [Select]
We open the real file 'archos/.rockbox/.playlist_control'
Adding 01. Prelude.ogg
Adding 02. Allemande.ogg
Adding 03. Courante.ogg
Adding 04. Sarabande.ogg
Adding 05. Menuette.ogg
Adding 06. Gigue.ogg
We open the real file 'archos/Bach/Cello Suites ogg class/Cello Suite 1/01. Prelude.ogg'
We open the real file 'archos/.rockbox/codecs/vorbis.codec'
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
Also tested with mp3 and flac and they are fine... but I get this with ogg every time.
Title: Re: Simulator problems
Post by: bk on February 26, 2006, 11:30:26 AM
You can use gdb to diagnose crashes (if you're interested). You'll need a debug build for this (choose (D)evel build, enable (D)ebug and (S)imulator).

$ gdb ./rockboxui
[...]
(gdb) run
[ Do whatever in the sim to cause it to crash ]
Program received signal SIGSEGV
(gdb) backtrace

That will tell you exactly where the fault occurred and the calling stack that led up to it.

When you're done:

(gdb) k
Kill the program being debugged? (y or n) y
(gdb) q
$

Title: Re: Simulator problems
Post by: Mmmm on February 26, 2006, 11:40:35 AM
I'll give that a go, ta...
So bk, it plays oggs ok on yours then? the build I'm simulating works ok on the actual player as do the files i'm trying to play.
Title: Re: Simulator problems
Post by: bk on February 26, 2006, 11:49:53 AM
Nope, broken here also. Looks like it could be another threading issue since it's crashing on accessing errno.
Title: Re: Simulator problems
Post by: Mmmm on February 26, 2006, 11:54:34 AM
Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1096375216 (LWP 27682)]
_get_next_page (vf=0x41595830, og=0x41595730, boundary=Unhandled dwarf expression opcode 0x93
) at vorbisfile.c:64
64        errno=0;
(gdb) backtrace
#0  _get_next_page (vf=0x41595830, og=0x41595730, boundary=Unhandled dwarf expression opcode 0x93
) at vorbisfile.c:64
#1  0x4179b2a0 in _fetch_headers (vf=0x41595830, vi=0x820dd2c, vc=0x820dd4c,
    serialno=0x41595874, og_ptr=0x0) at vorbisfile.c:247
#2  0x4179d740 in _ov_open1 (f=Variable "f" is not available.
) at vorbisfile.c:704
#3  0x4179d7eb in ov_open_callbacks (f=0x80902a0, vf=0x41595830, initial=0x0,
    ibytes=0, callbacks=
      {read_func = 0x4179a298 <read_handler>, seek_func = 0x4179a2bc <initial_seek_handler>, close_func = 0x4179a34e <close_handler>, tell_func = 0x4179a358 <tell_handler>}) at vorbisfile.c:774
#4  0x4179a538 in codec_start (api=0x80902a0) at vorbis.c:165
#5  0x08075df9 in codec_load_ram (codecptr=0x817aea0 "\177ELF\001\001\001",
    size=289517, ptr2=0x0, bufwrap=0, api=0x80902a0) at codecs.c:272
#6  0x08075ed1 in codec_load_file (
    plugin=0x808c533 "/.rockbox/codecs/vorbis.codec", api=0x80902a0)
    at codecs.c:303
#7  0x08071f90 in codec_thread () at playback.c:1978
#8  0x0808543a in runthread (data=0x8071f15) at thread-sdl.c:50
#9  0x40070dbb in SDL_RunThread () from /usr/lib/libSDL-1.2.so.0
#10 0x4007125d in RunThread () from /usr/lib/libSDL-1.2.so.0
#11 0x400c07f3 in start_thread () from /lib/tls/libpthread.so.0
#12 0x4018462a in clone () from /lib/tls/libc.so.6
This what you're getting too? Who's the chief simulator person around here?  :D