Some Newbie Questions


Esn

(:";
Joined
Mar 5, 2003
Messages
3,239
Location
Toronto, Canada
Website
esn.newgrounds.com
I figure I should make a single thread for some basic newbie questions that I have.

I'm trying to port a few programs and roughly following the steps of mcobit's tutorial while using Stuckie's new Lenny Dev Extend.

1) With Solfege, I did everything up to "make install", but when I tried to run it, I got a bunch of gtk/gdk display errors. What's wrong here?

Code:
esn-openpandora:~/solfege-3.18.8$ cd /mnt/utmp/solfege
esn-openpandora:/mnt/utmp/solfege$ ./bin/solfege
/var/lib/python-support/python2.5/gtk-2.0/gtk/__init__.py:72: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/mnt/utmp/solfege/share/solfege/solfege/esel.py:135: GtkWarning: gdk_screen_get_width: assertion `GDK_IS_SCREEN (screen)' failed
  max_exercise_label_width = int(gtk.gdk.screen_width() * 0.90)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:28: Warning: invalid (NULL) pointer instance
  gtk.Dialog.__init__(self)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:28: Warning: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
  gtk.Dialog.__init__(self)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:38: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  scrollwin = gtk.ScrolledWindow()
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: GtkWarning: gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  scrollwin.add(self.g_text)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: PangoWarning: pango_context_set_font_description: assertion `context != NULL' failed
  scrollwin.add(self.g_text)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: PangoWarning: pango_context_set_base_dir: assertion `context != NULL' failed
  scrollwin.add(self.g_text)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: PangoWarning: pango_context_set_language: assertion `context != NULL' failed
  scrollwin.add(self.g_text)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed
  scrollwin.add(self.g_text)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  scrollwin.add(self.g_text)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: GtkWarning: gdk_screen_get_display: assertion `GDK_IS_SCREEN (screen)' failed
  scrollwin.add(self.g_text)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: GtkWarning: gdk_keymap_get_for_display: assertion `GDK_IS_DISPLAY (display)' failed
  scrollwin.add(self.g_text)
/mnt/utmp/solfege/share/solfege/solfege/tracebackwindow.py:42: Warning: g_object_get: assertion `G_IS_OBJECT (object)' failed
  scrollwin.add(self.g_text)
Segmentation fault
esn-openpandora:/mnt/utmp/solfege$

2) The readme of one program tells me that it uses some other programs and that these should be "on the executable path". What does that mean, exactly, in this context?

3) When configuring one program, I get the message "Searching font files ... TrueType font-spec not found". What exactly do I do here? I searched the Debian repo for various "ttf" packages, but I'm not sure that that's what it means... there are very many of them. I installed a few, but nothing changed.

4) I configured "eatuner" and then did "make", but got a whole lot of errors that I'm not sure what to make of:
Code:
esn-openpandora:~/eatuner$ make
make  all-recursive
make[1]: Entering directory `/home/esn/eatuner'
Making all in po
make[2]: Entering directory `/home/esn/eatuner/po'
make[2]: Leaving directory `/home/esn/eatuner/po'
Making all in intl
make[2]: Entering directory `/home/esn/eatuner/intl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/esn/eatuner/intl'
Making all in src
make[2]: Entering directory `/home/esn/eatuner/src'
g++ -DHAVE_CONFIG_H -I. -I.. -I../intl -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1   -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DLOCALEDIR=\"/mnt/utmp/eatuner/share/locale\"   -g -O2 -MT analyser.o -MD -MP -MF .deps/analyser.Tpo -c -o analyser.o analyser.cc
analyser.cc:21:19: error: fftw3.h: No such file or directory
In file included from analyser.h:27,
                 from analyser.cc:24:
tunerconfig.h: In member function 'void config::settatype(tuner_audio_type)':
tunerconfig.h:132: error: 'NULL' was not declared in this scope
tunerconfig.h: In member function 'tuneraudio& config::getaudio()':
tunerconfig.h:136: error: 'NULL' was not declared in this scope
tunerconfig.h: In member function 'void config::resettaudio()':
tunerconfig.h:167: error: 'NULL' was not declared in this scope
In file included from analyser.cc:24:
analyser.h: At global scope:
analyser.h:61: error: ISO C++ forbids declaration of 'fftw_complex' with no type
analyser.h:61: error: expected ';' before '*' token
analyser.cc: In constructor 'analyser::analyser()':
analyser.cc:30: error: 'NULL' was not declared in this scope
analyser.cc:30: error: class 'analyser' does not have any field named 'out'
analyser.cc: In destructor 'analyser::~analyser()':
analyser.cc:35: error: 'NULL' was not declared in this scope
analyser.cc:36: error: 'fftw_free' was not declared in this scope
analyser.cc:37: error: 'out' was not declared in this scope
analyser.cc:37: error: 'NULL' was not declared in this scope
analyser.cc:38: error: 'fftw_free' was not declared in this scope
analyser.cc: In member function 'bool analyser::calc(smpl_seq&)':
analyser.cc:42: error: 'fftw_plan' was not declared in this scope
analyser.cc:42: error: expected `;' before 'p'
analyser.cc:50: error: 'fftw_free' was not declared in this scope
analyser.cc:51: error: 'out' was not declared in this scope
analyser.cc:52: error: 'fftw_free' was not declared in this scope
analyser.cc:53: error: 'fftw_malloc' was not declared in this scope
analyser.cc:54: error: 'out' was not declared in this scope
analyser.cc:54: error: 'fftw_complex' was not declared in this scope
analyser.cc:54: error: expected primary-expression before ')' token
analyser.cc:54: error: expected `;' before 'fftw_malloc'
analyser.cc:67: error: 'p' was not declared in this scope
analyser.cc:67: error: 'out' was not declared in this scope
analyser.cc:67: error: 'FFTW_FORWARD' was not declared in this scope
analyser.cc:67: error: 'fftw_plan_dft_r2c_1d' was not declared in this scope
analyser.cc:68: error: 'fftw_execute' was not declared in this scope
analyser.cc:69: error: 'fftw_destroy_plan' was not declared in this scope
analyser.cc: In member function 'double analyser::calcAmpl(int)':
analyser.cc:166: error: 'out' was not declared in this scope
make[2]: *** [analyser.o] Error 1
make[2]: Leaving directory `/home/esn/eatuner/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/esn/eatuner'
make: *** [all] Error 2
 
Last edited by a moderator:
about 2)

I assume that in this context the executable path is a list of directories that is searched for the command that you for example type in a termal. For example open a terminal and type "mount". It should be found automatically and print some information about what is mounted at the moment, Forget about it's output right now. I just wanted to show you, that this command is being found, no matter in which directory you are. To find the location of a command you can use the command "whereis", which also should be found no matter in which directory you are.

Code:
whereis mount

You can see what directories are being search for commands by typing

[echo $PATH]

PATH is a so called environment variable. To see others write "echo $" (do not press return) and press TAB twice (hold the fn key and press SPACE twice). That will list you all environment variables that are currently assigned. But let's leave them alone at this point.
All this is related to the shell you use. There are several different shells, but the one that is mostly used is BASH (bourne again shell). When you open a terminal, by default a bash-shell is started in the terminal-window. I can only scratch the surface of all this as everything together is quite complex to explain. Search the web for details. You can modify the PATH-variable like any other variable. As quick example type the following:

Code:
testvar=test; echo $testvar

That creates a variable "testvar" and gives it the value "test". the echo-command then prints the value ($testvar) of this variable "testvar". You COULD set PATH the same way, but be careful. If you do set it to some nonsense, then no commands (except those which are build into the shell like 'cd') are being found anymore. However an assignment of this type only lasts in the current bash-shell. If you close the terminal window and open a new one, then PATH has it's old value back.

There are ways to change environment variable in a global way and to set them on boot, but that's too much right now too. Basically when a program says that an command that it need is not in the path, then usually the program is simply not installed in your system.
 
About 3: Not sure there. Fonts in Xorg is a topic of it's own. And it gets probably more complex if you try to port a game/application and pack it into a PND without installing a font to the system. I couldn't say much here and better say nothing before saying something wrong.

About 4: Compiling is a topic that easily confuses me. But as far as i can tell the program you try to compile is missing some libraries. The way of solving this is to install the libraries, compile the programm that you want to port and include the libraries in the PND. I never did that myself so far. You could try

http://repo.openpandora.org/?page=detail&app=cdevtools.freamon.40n8e

and read the link forum-thread which is mentioned there. Maybe it helps you.

Probably the output of "configure" also told you that some library is missing. You can try if that library is in the angstrom-repo and install it with the "opkg"-command (_IF_ you do, you would have to find the "-dev"-version of it, which also installs the source-code). Note that there is some risk of breaking your system when installing packages with opkg. For example of you install a newer version that is currently installed, then something that ran before does not run anymore.

In this example it seems as "fftw" (http://www.fftw.org/) is missing for the compilation to MAYBE work. I checked and notice that it is indeed available in angstrom-repo. You could install it (it's dev-version) by typing (as root):

Code:
opkg install fftw-dev

But there is also stuff like fftwf-dev and fftwl-dev and libfftw3. Can't tell right now which is the one you should install. In anyway, if you succeeded to compile the program, this way, then that for the start would leave you with the ability to run the ported application on YOUR system. Sometimes you won't have the luck to find the library in the Angstrom-repo and would have to try compiling it on your own.
In order to make a working PND you still would have to include the libraries and tell the programm to use them from a different directory (the PND) than from the pre-configured paths of the system. Or to use static libraries, which i think means that they are included in the binary-file of the compiled programm. Unfortunately i only know the theories about this.
 
About 1:

Not sure here. Seems to me like some library, which the program needs to run, is either outdated or missing at all.
 
Thanks for your answers, Lomaxx. Especially #2 - useful to know.

Concerning #s 1 & 4: if missing libraries are the problem, why didn't it get mentioned during the "configure" stage? I thought it wouldn't let me finish "configure" if any libraries were missing. Indeed, I had to "sudo apt-get install" ("apt-get" not "opkg" because I'm using a Debian extend here), several libraries before configure would finish.

Oh, also,

Question 5) if I download the source and there is no "autogen" file and no "configure" file inside, how do I build the package?

and 6)
Sometimes you won't have the luck to find the library in the Angstrom-repo and would have to try compiling it on your own.
In order to make a working PND you still would have to include the libraries and tell the programm to use them from a different directory (the PND) than from the pre-configured paths of the system. Or to use static libraries, which i think means that they are included in the binary-file of the compiled programm. Unfortunately i only know the theories about this.
Is there anywhere where I can see a step-by-step tutorial showing an example of this? Compiling libraries on your own that aren't in the repo, that is.

and 7) Is there an easy way to turn Java programs that already work on my Pandora (as .jar executables) into PNDs?
 
1) I don't know. There's a fault with the program and it's crashing - it's not a missing library. I'll try and compile it myself and see what I get.

4) All those errors stem from the fact that you're missing fftw3. It's often useful (particularly on the Pandora's small screen) to add "-Wfatal-errors" to the CFLAGS line in the Makefile - this makes the compiler stop at the first error, and not try to continue. You should be able to fix it via
Code:
 sudo apt-get install libfftw3-dev
apt-get will sort out any other dependencies.
Configure scripts often pick up the big stuff, but they're usually pretty generic, and not guaranteed to point out everything you might be missing.

5) At the very least, a package should have a 'configure.ac' and a 'Makefile.am'. In which case, you can run 'autoconf' to get your configure script. More info is at: http://en.wikipedia.org/wiki/GNU_build_system

6) Debian's repository is massive - you should never need to compile your own library if you're using the Debian Extend (if it's not in the repository, it probably doesn't exist). That said, libraries compile the same way as applications do (./configure + make + make install). Takes f.o.r.e.v.e.r. on the Pandora though.
 
4) Thank you freamon, that fixed it. So I successfully passed the configure/make/make install stage, but when I try to run it, I get another Gtk error, like for solfege (though the error is different).

Code:
esn-openpandora:/mnt/utmp/eatuner$ ./bin/eatuner
eatuner 0.41 - free music instruments tuner
Copyright (C) 2008 Zasenko Sergey
Bug-report: d3fin3@gmail.com


(eatuner:5710): Gtk-WARNING **: cannot open display: :0.0

(eatuner:5710): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eatuner:5710): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Again, this is in the Lenny Debian extend.
 
I downloaded the eatuner code and compiled it with my cdevtools pnd (although I had to add fftw3-dev aswell, which was a lot more fiddly than just being able to run apt-get - I'm jealous of dev extends ;) ). The good news is that there's nothing wrong with the code - I ran the executable after no problem.

I'm guessing that the errors you're getting are because you're trying the run the executable from within the dev extends - i.e. whilst you've still got it mounted. My suggestion would be to create a directory somewhere completely outside of the dev extends (on another SD card perhaps) and install eatuner there. So if your other SD card was on '/media/mmcblk1p1' and the install directory was called 'eatunerpnd', you would run
Code:
./configure --prefix=/media/mmcblk1p1/eatunerpnd
make
make install

Because libfftw3 isn't part of Pandora's OS, you'd then need to create a 'media/mmcblk1p1/eatunerpnd/lib' directory and copy the library there (there's probably 2 files - something like libfftw3.so.3.2.2 (the real library file) and libfftw3.so.3 (the symlink to the real library file).
After that, unmount the dev extends and then go to '/media/mmcblk1p1/eatunerpnd' and run 'LD_LIBRARY_PATH=./lib ./bin/eatuner' and it should work.

Incidentally, I realise you've been following mcobit's tutorials and normally install to /mnt/utmp, but - without meaning any disrespect to mcobit - I think he may have got the wrong idea here. The fact that any pnd you might make will likely be mounted on the user's /mnt/utmp directory isn't relevant (indeed, there should be nothing stopping a user from changing his pnd_run.sh script to mount pnds somewhere else - they should still work where-ever they're mounted, so hard-coding /mnt/utmp into your programs is not - in my opinion - good practise).
 
freamon said:
I downloaded the eatuner code and compiled it with my cdevtools pnd (although I had to add fftw3-dev aswell, which was a lot more fiddly than just being able to run apt-get - I'm jealous of dev extends ;) ). The good news is that there's nothing wrong with the code - I ran the executable after no problem.

I'm guessing that the errors you're getting are because you're trying the run the executable from within the dev extends - i.e. whilst you've still got it mounted. My suggestion would be to create a directory somewhere completely outside of the dev extends (on another SD card perhaps) and install eatuner there. So if your other SD card was on '/media/mmcblk1p1' and the install directory was called 'eatunerpnd', you would run
Code:
./configure --prefix=/media/mmcblk1p1/eatunerpnd
make
make install

Because libfftw3 isn't part of Pandora's OS, you'd then need to create a 'media/mmcblk1p1/eatunerpnd/lib' directory and copy the library there (there's probably 2 files - something like libfftw3.so.3.2.2 (the real library file) and libfftw3.so.3 (the symlink to the real library file).
After that, unmount the dev extends and then go to '/media/mmcblk1p1/eatunerpnd' and run 'LD_LIBRARY_PATH=./lib ./bin/eatuner' and it should work.

Incidentally, I realise you've been following mcobit's tutorials and normally install to /mnt/utmp, but - without meaning any disrespect to mcobit - I think he may have got the wrong idea here. The fact that any pnd you might make will likely be mounted on the user's /mnt/utmp directory isn't relevant (indeed, there should be nothing stopping a user from changing his pnd_run.sh script to mount pnds somewhere else - they should still work where-ever they're mounted, so hard-coding /mnt/utmp into your programs is not - in my opinion - good practise).

I believe the intention is to avoid the program writing to the /home directory, which is on the NAND on the Pandora and gets filled up quickly.

Regarding libraries, I did "ldd ../bin/eatuner" to find out what it's using (following mcobit's tutorial) and copied everything listed there into eatuner-pnd/eatuner/lib. Of the two you mentioned, only libfftw3.so.3 was listed, so I only copied that one over. But you say that it's only the symlink? If so, how can I tell which file a symlink links to? I guess I'd need to copy over all of those as well.

Anyway, I followed the tutorial to the end and made a PND, but if I only copied over the symlinks instead of the real libraries, it's no wonder that it doesn't work. I get the following .out file when I try to run it:

Code:
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/mmcblk0p1/pandora/menu//eatuner.pnd -e ./eatuner.sh -b eatuner
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Inappropriate ioctl for device
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Success
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Success
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
not mounted on loop yet, doing so
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
LoopMountedon: 
losetup: could not find any free loop device

job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
usedminor 9
freeminor 10
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Filetype is Squashfs
Mounting PND (mount -t squashfs) :
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
mount: Cannot allocate memory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
The PND File-system is not mounted ! - Union wont work anyway
The Union File-system is not mounted !

Still, I feel like I'm getting closer... probably almost there.
 
Last edited by a moderator:
It's not missing libraries that are the problem - your PND is failing to mount, so it never gets as far as running the executable (or its associated libraries). The error message seems a bit generic though, so it's difficult to know what's gone wrong. I'm downloading Stuckie's dev extends now, so I'm not saying things based on guesswork, and then I'll hopefully be able to give a proper answer.
 
OK - to begin at the beginning. I've my pandora, and it's got a SD card in it - mounted at /media/mmcblk0p1. The contents of that card are:
Code:
debian.lennydev.20110626.extend
debian.lennydev.20110626.zip
eatuner/
eatuner-0.41.tgz
pandora/
pandora/menu/DebianDevExtend.pnd
pandora/appdata/
'eatuner/' contains the source code for that application.


I launch DebianDevExtend.pnd, choose the .extend file and it gives me a terminal. It says it can't resolve host andrew-openpandora (fair enough - it's chrooted into a new environment, so no longer has access to the file on the nand where that's defined).

Hmmm... so after the chroot, it now treats /tmp/debextend/ on the nand as its new root directory (i.e. '/'), so from within this environment, I can't access anything other than my home directory on the nand - I've therefore no access to the original /media/mmcblk0p1 (my SD card). OK - so I'll escape from this environment for a moment by starting up another terminal and do this:
Code:
cp /media/mmcblk0p1/eatuner-0.41.tgz /tmp/debextend/home/debian/
exit
Back in the dev-extends, I've now got eatuner-0.41.tgz in /home/debian/ which I can extract to give me the eatuner code. From within, /home/debian/eatuner/, I'll do
Code:
./configure --prefix=/home/debian/eatunerpnd
Bummer - missing GTK development headers. Okay then:
Code:
sudo apt-get install libgtk2.0-dev
Flipping heck - that's a lot of files. Trying configure again and ... oh, I've run out of space. I'll try again with the 1gb version of DevExtends. Back in a minute.
 
I can just upload a zip of my folder with all the files in it that I PND'd up. That seems like it would be a quicker way to tell what's wrong... I'll go do that now.
 
Ok, here's the folder with everything:
http://www.speedyshare.com/files/29299647/eatunerpnd.tar.gz

If the PND doesn't even mount, I guess the first problem must be with something really basic...

If you're using the Debian extend, by the way, note that there's a step-by-step guide for setting it up with a home extend on the Pandorawiki.

As for copying files between Angstrom and the Debian extend, I've mostly done that with the Xfe file manager.
 
That's a better idea yeah - I'll have a look now. In the meantime (because it may be useful to others aswell) I'll post the full text of my experiences with Dev-Extends and eatuner:

RESTART WITH 1GB VERSION OF DEV-EXTENDS
OK - to begin at the beginning. I've my pandora, and it's got a SD card in it - mounted at /media/mmcblk0p1. The contents of that card are:
Code:
debian.lennydev.20110629.1gb.extend
debian.lennydev.20110629.1gb.zip
eatuner-0.41.tgz
pandora/
pandora/menu/DebianDevExtend.pnd
pandora/appdata/

I launch DebianDevExtend.pnd, choose the .extend file and it gives me a terminal. It says it can't resolve host andrew-openpandora (fair enough - it's chrooted into a new environment, so no longer has access to the file on the nand where that's defined).

Hmmm... so after the chroot, it now treats /tmp/debextend/ on the nand as its new root directory (i.e. '/'), so from within this environment, I can't access anything other than my home directory on the nand - I've therefore no access to the original /media/mmcblk0p1 (my SD card). OK - so I'll escape from this environment for a moment by starting up another terminal and do this:
Code:
cp /media/mmcblk0p1/eatuner-0.41.tgz /tmp/debextend/home/debian/
exit
Back in the dev-extends, I've now got eatuner-0.41.tgz in /home/debian/ which I can extract to give me the eatuner code. From within, /home/debian/eatuner/, I'll do
Code:
./configure --prefix=/home/debian/eatunerpnd
Bummer - missing GTK development headers. Okay then:
Code:
sudo apt-get install libgtk2.0-dev
Flipping heck - that's a lot of files, but configure now works. Now to do
Code:
make
... and it reports fftw3 is missing, but it works after doing
Code:
sudo apt-get install libfftw3-dev
Running
Code:
make install
puts the application in /home/debian/eatunerpnd.

I'm pretty much done with Dev-Extends now, so I'll escape from this environment by opening another terminal, and putting the eatuner app somewhere more accessible:
Code:
cp -r /tmp/debextend/home/debian/eatunerpnd /media/mmcblk0p1/
cd /media/mmcblk0p1/eatuner

Now to find out what libraries it can use from Pandora's OS, and what it needs from Debian - ultimately so that I can make it into a free-standing PND that anyone with a Pandora can run. Still in the new terminal (away from the Dev-Extends enviroment)
Code:
/tmp/debextend/usr/bin/ldd ./bin/eatuner
Turns out the vast majority of the necessary libraries are found in Pandora OS's /usr/lib, and its only libfftw3.so.3 that's not found.
Doing
Code:
ls -l /tmp/debextend/usr/lib/libfftw3.so.3
reveals that libfftw3.so.3 is just a symlink to the real library libfftw3.so.3.1.2, so we'll need both:
Code:
mkdir lib
cp --no-dereference /tmp/debextend/usr/lib/libfftw3.so.3 lib/
cp /tmp/debextend/usr/lib/libfftw3.so.3.1.2 lib/

And now I'm finished with Dev-Extends, so I'll swap back to that terminal and exit out of it.

Back in /media/mmcblk0p1/eatunerpnd/, I need to create a script (called eatuner.sh) to launch the app:
Code:
#!/bin/bash

pwd=$(pwd)
export HOME=$pwd
export LD_LIBRARY_PATH=$pwd/lib

./bin/eatuner
and make it executable with chmod 0777 eatuner.sh.

Next it needs a PXML file - something like:
<?xml version="1.0" encoding="UTF-8"?>
<PXML xmlns="http://openpandora.org/namespaces/PXML">
<package id="eatuner.esn">
<author name="Zasenko Sergey" website="http://sourceforge.net/projects/eatuner/"/>
<version major="0" minor="4" release="1" build="0" type="beta"/>
<titles>
<title lang="en_US">eatuner</title>
</titles>
<descriptions>
<description lang="en_US">free music instruments tuner</description>
</descriptions>
<icon src="icon/eatuner.png"/>
</package>

<application id="eatuner.esn" appdata="eatuner">
<exec command="eatuner.sh" background="true" standalone="true"/>
<author name="Zasenko Sergey" website="http://sourceforge.net/projects/eatuner/"/>
<version major="0" minor="4" release="1" build="0" type="beta"/>
<osversion major="1" minor="0" release="0" build="0"/>
<titles>
<title lang="en_US">eatuner</title>
</titles>
<title lang="en_US">eatuner</title>
<descriptions>
<description lang="en_US">free music instruments tuner</description>
</descriptions>
<description lang="en_US">free music instruments tuner</description>
<icon src="icon/eatuner.png"/>
<licenses>
<license name="GPLv3" url="http://www.gnu.org/licenses/gpl.html" sourcecodeurl="http://gcc.gnu.org/"/>
</licenses>
<previewpics>
<pic src="preview/eatuner.jpg"/>
</previewpics>
<info name=eatuner readme" type="text/plain" src="docs/readme.txt"/>
<categories>
<category name="Audio">
<subcategory name="Tuner"/>
</category>
</categories>
</application>
</PXML>

From /media/mmcblk0p1, it can be pnd'd up with

Code:
/usr/pandora/scripts/pnd_make.sh -p eatuner.pnd -d eatunerpnd -x eatunerpnd/PXML -i eatunerpnd/icon/eatuner.png -c

Once the pnd is moved into pandora/menu, it's runnable from the Accessories menu.
 
Esn: I downloaded your build directory. Firstly, all the messages you had with 'Error retrieving current directory' didn't appear when I ran the pnd so I'm afraid I think that's something to do with your filesystem (maybe backup and reformat your SD card?).

Secondly, you don't need all those libs in your 'lib' directory - they create dependency problems and stop the pnd unmounting cleanly. It's just libfftw3 you need (either one file like you've got - a real library called libfftw3.so.3, or 2 files - a real library called libfftw3.so.3.1.2 and a symlink to it called libfftw3.so.3, it doesn't matter).

Thirdly, maybe you could change your script to be like the one in my post above, so /mnt/utmp isn't hard-coded in?

But other than that, I remade your pnd without all the extra lib files, and it worked. :)
 
freamon said:
Esn: I downloaded your build directory. Firstly, all the messages you had with 'Error retrieving current directory' didn't appear when I ran the pnd so I'm afraid I think that's something to do with your filesystem (maybe backup and reformat your SD card?).
Yeah... I've been having some other problems lately, so I guess I should try another reflash of the firmware. And I'll check the SD card for any errors again, just in case. (I reformatted it only recently, so if it does turn out to have any errors the likely culprit would be the extends)

Secondly, you don't need all those libs in your 'lib' directory - they create dependency problems and stop the pnd unmounting cleanly. It's just libfftw3 you need (either one file like you've got - a real library called libfftw3.so.3, or 2 files - a real library called libfftw3.so.3.1.2 and a symlink to it called libfftw3.so.3, it doesn't matter).
Ah, thanks for the tip. So is there a quick and easy way to find out which libraries it needs that are NOT already on the NAND?

Thirdly, maybe you could change your script to be like the one in my post above, so /mnt/utmp isn't hard-coded in?
Well, mcobit's rationale for doing it that way is so that the program doesn't save any configurations or anything on the NAND. If he's right about that, then I think most Pandora owners would prefer it done that way, because space in the actual /home directory (which is on the NAND) is very limited. Is he right about that, then?

But other than that, I remade your pnd without all the extra lib files, and it worked. :)
Well, that's encouraging. :) Ok, I'll try it again soon.
 
Last edited by a moderator:
Ok... does this PND work for anyone? It doesn't for me, but maybe that's because my OS is messed up. I made it using PNDTools.

The .out file after I try to run it says:
Code:
=======================================================================================
PND             : /media/mmcblk1p1/pandora/menu/eatuner.pnd
PND_FSTYPE      : Squashfs
APPDATADIR      : /media/mmcblk1p1/pandora/appdata/eatuner
APPDD_FSTYPE    : vfat
PND_CPUSPEED    : <unset>
EXENAME         : scripts/eatuner.sh
ARGUMENTS       : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs "/dev/loop0" "/mnt/utmp/eatuner"
Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/mmcblk1p1/pandora/appdata/eatuner=rw+nolwh":"/mnt/pnd/eatuner=rr" none "/mnt/utmp/eatuner"
[SUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application (scripts/eatuner.sh ) ----------
/usr/pandora/scripts/pnd_run.sh: line 544: ./scripts/eatuner.sh: No such file or directory
[ FAILED]--- Starting the application (scripts/eatuner.sh ) ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[SUCCESS]--- Waiting the Union to be available ----------
rmdir: failed to remove `/mnt/utmp/eatuner': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[SUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[SUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 3

All I did is remove every library except for libfftw3.so.3, and made the PXML a bit more detailed. So... what freamon did basically, except mine doesn't work.
 
eeek:
/usr/pandora/scripts/pnd_run.sh: line 544: ./scripts/eatuner.sh: No such file or directory

You've got an extra 'eatuner' folder in your pnd (so eatuner is at ./eatuner/scripts/eatuner.sh). But the binary inside the pnd works.
 
Esn said:
So is there a quick and easy way to find out which libraries it needs that are NOT already on the NAND?
I made a post earlier you might have missed:

freamon said:
[After the make install stage,] I'm pretty much done with Dev-Extends now, so I'll escape from this environment by opening another terminal, and putting the eatuner app somewhere more accessible:
cp -r /tmp/debextend/home/debian/eatunerpnd /media/mmcblk0p1/
cd /media/mmcblk0p1/eatuner


Now to find out what libraries it can use from Pandora's OS, and what it needs from Debian - ultimately so that I can make it into a free-standing PND that anyone with a Pandora can run. Still in the new terminal (away from the Dev-Extends enviroment)
/tmp/debextend/usr/bin/ldd ./bin/eatuner

Turns out the vast majority of the necessary libraries are found in Pandora OS's /usr/lib, and its only libfftw3.so.3 that's not found.
Doing
ls -l /tmp/debextend/usr/lib/libfftw3.so.3

reveals that libfftw3.so.3 is just a symlink to the real library libfftw3.so.3.1.2, so we'll need both:
mkdir lib
cp --no-dereference /tmp/debextend/usr/lib/libfftw3.so.3 lib/
cp /tmp/debextend/usr/lib/libfftw3.so.3.1.2 lib/


And now I'm finished with Dev-Extends, so I'll swap back to that terminal and exit out of it.

Thirdly, maybe you could change your script to be like the one in my post above, so /mnt/utmp isn't hard-coded in?
Well, mcobit's rationale for doing it that way is so that the program doesn't save any configurations or anything on the NAND. If he's right about that, then I think most Pandora owners would prefer it done that way, because space in the actual /home directory (which is on the NAND) is very limited. Is he right about that, then?

He's right about the need to avoid writing to the NAND. But the script below does exactly the same as his, without using /mnt/utmp/eatuner - this is the value that 'pwd' (Present Working Directory) will have when the pnd is launched. Both scripts do the same thing (export HOME so the user's nand isn't written to, but the one below is more flexible)

freamon said:
Back in /media/mmcblk0p1/eatunerpnd/, I need to create a script (called eatuner.sh) to launch the app:
#!/bin/bash

pwd=$(pwd)
export HOME=$pwd
export LD_LIBRARY_PATH=$pwd/lib

./bin/eatuner

and make it executable with chmod 0777 eatuner.sh.
 
Last edited by a moderator:
Thanks again for all the info. I did actually see the earlier post, but I discounted it because I had done "ldd" from within the Debian terminal. I didn't realize that the function of "ldd" is not just to tell me which libraries it uses, but to tell me which libraries it uses that are not included in the OS (and of course, if I typed it in from the Debian extend as I did, I got a lot of extra hits).

freamon said:
eeek:
/usr/pandora/scripts/pnd_run.sh: line 544: ./scripts/eatuner.sh: No such file or directory

You've got an extra 'eatuner' folder in your pnd (so eatuner is at ./eatuner/scripts/eatuner.sh). But the binary inside the pnd works.
Oh, I know now what happened... I dragged the whole folder into PNDTools, so that's why an extra eatuner folder was created in the directory structure. Fixed.

I also made the eatuner.sh file in the way you recommended - without hardcoding it to /mnt/utmp.

This PND now works. Huzzah! Finally! :)

However, the program is not yet functional, because it doesn't recognize microphone input (I set up the mixer settings as I do when recording into Audacity to test it). I think the problem is that the "preferences" menu will not open, for some reason. I think if I could open its preferences menu, I could set up the location of the recording device (as it's done in Audacity).

I'll try to take a look at its sourcecode, but this might be beyond me.

P.S. mcobit answered question #2 in my first post quite nicely here.
 
Last edited by a moderator:
Back
Top