deadbeef.
http://deadbeef.sourceforge.net/
deadbeef present several of the age old problems when building for the touch.
a) how do I build it (see below)
b) will the windows be randomly huge or lay over each other (see below)
c) will it support alsa (see below)
d) can it live on FAT (see below)
e) will its configs be wiped everytime I turn it off (see below)
f) will keyboard input work (see below)
g) does it have a single window interface (no floating toolbars)
until at least 6, and ideally 7, of those answers are "Yes or Easily" an app can't be properly released. People will complain.
However. as an interim solution i am sharing my build files and some rough notes.
a) how do I build it? (assuming linux machine)
I personally just debootstrap or multistrap down a built of debian lenny for the 3 (debootstrap pointed to
deb http://archive.debian.org/debian-archive/debian/ lenny main) or
wheezy for the Touch/Paperwhite(5).
Like:
sudo debootstrap --arch armel --foreign wheezy ./debian-armel http://http.debian.net/debian/
where debian-armel is some folder you want it in,
Then install qemu-user-static on your PC. Copy the qemu-arm-static to the /usr/bin folder of my mounted chroot filesystem and then chroot in. Like so:
me@minty16 /opt $
sudo updatedb
me@minty16 /opt $
locate qemu-arm-static
me@minty16 /opt $
sudo cp /usr/bin/qemu-arm-static /opt/debian-armel/usr/bin/
me@minty16 /opt $
cat /etc/issue
Quote:
Linux Mint 16 Petra \n \l
|
me@minty16 /opt $
sudo chroot /opt/debian-armel
I have no name!@minty16:/#
uname -a
Quote:
Linux minty16 2.6.32 #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 armv7l GNU/Linux
|
Quote:
I have no name!@minty16:/# cat /etc/issue
Debian GNU/Linux 7 \n \l
|
There we go. Arm debian on I686 PC.
Run the 2nd stage from inside the chroot (for the deboostrap stuff)
me@minty16 /opt $
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
LC_ALL=C LANGUAGE=C LANG=C sudo chroot /opt/debian-armel /debootstrap/debootstrap --second-stage
(takes a little while)
Then setup any remaining configures.
me@minty16 /opt $
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
LC_ALL=C LANGUAGE=C LANG=C sudo chroot /opt/debian-armel dpkg --configure -a
me@minty16 /opt $
sudo ln -sfn /opt/debian-armel/ /armelfs_debian
me@minty16 /opt $
sudo mount -t proc proc /armelfs_debian/proc
me@minty16 /opt $
sudo cp /etc/hosts /armelfs_debian/etc/
me@minty16 /opt $
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C sudo chroot /opt/debian-armel
root@minty16:/#
echo "deb http://ftp.debian.org/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list
root@minty16:/#
echo "deb-src http://ftp.debian.org/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list
root@minty16:/#
apt-get update
root@minty16:/#
apt-get install locales dialog
root@minty16:/#
dpkg-reconfigure locales
(en.GB_UTF8 for me)
This copies the networking, proc <sys> stuff across as required via an ln -s to a fixed folder for simplicity.
repeat until you have what you need to get in and out, with networking working.
Quote:
For the Multistrap route: follow the secondary stages for the multistrap stuff, depending on the bootstrapper you are using. we use debootstrap here.
|
as shown above, log out, log in, (of the chroot, not your main PC account) setup locales and dpkg configure -a (or w/e is required), (see link above for kindle 5 "next steps") - for example - if required add the apt sources manually in /etc/apt/sources.d/sources.list (archive.debian.org or something)\ and do an
apt-get update (shown above).
Once the image is nice and stable and you can log in and out of it you can either setup a mount script or just chroot in. If using an .img file a script is usually a good idea.
(login script for a 5 in a .img file)
logging into a non .img file is as simple as
cd to folder and
sudo chroot ./
Then I build any future sources inside this chroot armel image on my local machine "cross compiling natively". it allows for
apt-get build-dep <thing> and
apt-get source <thing> which is great for building things. without any actual cross-compilation invocations.
I use the
Exporting Binaries Easily from Debian Script that me and Brianinmaine whipped up to get the full exports. then I rip out the rubbish like pthreads, gcc, librt, libm, libresolv, etc... from the exports, this is usually required to prevent fundamental libs being overridden and the whole thing seggying in a big heap of death.
And then I manually try to replace as many of the exported files against the system libs (dull process, not required, propely configured the filechecker script
Exporting Binaries Easily from Debian does this for you... I never bother setting it up right)
by use of
--prefix=/mnt/us/extensions/<thing> and the creating of that empty dummy skeleton (</mnt/debian/>/mnt/us/extensions/<thing>) within the debian on the PC I can easily export into a structure that expects to live on the kindles FAT "/mnt/us" way of doing things.
To tell the app where to look for libs when it runs we pass a LD flag to the ./configure command.
Quote:
LDFLAGS="-Wl,-O1 -Wl,-rpath,/mnt/us/extensions/deadbeef/lib"
|
or in this case
Quote:
LDFLAGS="-Wl,-O1 -Wl,-rpath,/mnt/us/extensions/deadbeef/lib:/mnt/us/extensions/deadbeef/lib/deadbeef"
since it needs an extra, funny, lib location
|
as in
Quote:
CFLAGS=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -ffast-math -mfloat-abi=softfp" CXXFLAGS=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -ffast-math -mfloat-abi=softfp" LDFLAGS="-Wl,-O1 -Wl,-rpath,/mnt/us/extensions/deadbeef/lib:/mnt/us/extensions/deadbeef/lib/deadbeef" ./configure --prefix=/mnt/us/extensions/deadbeef --disable-gtk3 --disable-nls --enable-abstract-socket
|
ensures we reference the correct lib dirs at runtime without any messy LD_LIBRARY_PATH calls. That said we still want LD_LIBRARY_PATH modification to pick up our additional supporting libs we ripped from debian in our lib dir so deadbeef is unique in wanting this extra lib name. We handle this in the beef.sh loader for simplicities sake.
Each app has it's different niggles. figuring these out gets easier with practice.
GETTING THE SUPPORTING LIBS
we can apt-get bits we need like:
apt-get install intltool libtool automake
sadly there is no
apt-get build-dep deadbeef
so in pinch do:
apt-get build-dep audacity && apt-get build-dep aqualung
they should cover the same bases.
run
./configure --help or
./configure and see what you are missing of that which you wanted. The above technique worked for my needs. Ogg, Mp3, wav, wmv etc.. etc.. )
I went with --disable-gtk3 --disable-nls --enable-abstract-socket to get around a bind issue and cut down on extras.
do a
make && make install
your program appears in </mnt/debian>/mnt/us/extensions/<thing>/
where /mnt/debian is the location of your armel debian root via qemu on your host PC.
the script I referenced earlier
Exporting Binaries Easily from Debian will then rip out all the required libs and shove them in one folder. (settable in the script, I choose /export) and then it is up to you to dump the exported "lib" folder contents into the folder you referred to in the
"LDFLAGS="-Wl,-O1 -Wl,-rpath,/mnt/us/extensions/deadbeef/lib" (after ripping out the pthreads, gcc, librt, libm, libresolv, etc...)
so - that is to say - create a "lib" dir if you don't have one created by the make of your app in your armel output folder
/mnt/us/extensions/<thing>/ like
/mnt/us/extensions/<thing>/lib
(which is
</mnt/debian/>/mnt/us/extensions/<thing>/ from the parent OS remember)
and shove the exported libs (from the
Exporting Binaries Easily from Debian tool) into it.
Then copy all of the folder and its contents from
</mnt/debian/>/mnt/us/extensions/<thing>/ into
/mnt/us/extensions/<thing>/ on your kindle. via USB or ssh.
I personally will zip it before I transfer it and unzip it into the kindle /mnt/us/extensions/ dir. This unrolls symbolic links in a sane way to hard files and stops the permission denied errors that trying to create a sym link on FAT will give you.
you are ready to test it via ssh.
Spoiler:
[root@kindle bin]#
cd /mnt/us/extensions/deadbeef/bin
[root@kindle bin]#
./beef.sh
Quote:
starting deadbeef 0.6.1
server_start
loading plugins from /mnt/us/home/root/.local/lib32/deadbeef
loading plugins from /mnt/us/home/root/.local/lib/deadbeef
loading plugins from /mnt/us/extensions/deadbeef/lib/deadbeef
plug_load_all: scandir found 178 files
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/adplug.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/alac.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/alsa.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/converter.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/converter_gtk2.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/dca.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/ddb_ao.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/ddb_dumb.so
found gui plugin ddb_gui_GTK2.so
added GTK2 gui plugin
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/ddb_mono2stereo.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/ddb_shn.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/dsp_libsrc.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/ffap.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/ffmpeg.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/flac.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/gme.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/hotkeys.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/m3u.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/mms.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/mpgmad.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/musepack.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/nullout.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/oss.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/pltbrowser_gtk2.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/shellexec.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/shellexecui_gtk2.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/sid.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/sndfile.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/supereq.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/tta.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/vorbis.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/vtx.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/wavpack.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/wildmidi.so
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/wma.so
checking GUI plugin: GTK2
selected GUI plugin not found or failed to load, trying to find another GUI plugin
plugin not found or failed to load
plugin not found or failed to load
loading plugin /mnt/us/extensions/deadbeef/lib/deadbeef/ddb_gui_GTK2.so
libWildMidi(WM_BufferFile:640): ERROR Unable to stat /etc/timidity/freepats/freepats.cfg (No such file or directory)
selected output plugin: ALSA output plugin
INFO: loading playlist root
INFO: from file /mnt/us/home/root/.config/deadbeef/playlists/0.dbpl
INFO: loading playlist root
INFO: from file /mnt/us/home/root/.config/deadbeef/playlists/1.dbpl
gtkui plugin compiled for gtk version: 2.24.10
|
And we are running

(pictured)
b) Will the windows be randomly huge or lay over each other?
To combat the naming scheme designed by amazon I personally use the following technique.
extract the attached files to /var/tmp/root/.config/awesome
(like sftp://<kindle-ip>/var/tmp/root/.config/awesome/rc.lua and
sftp://root@<kindle-ip>/var/tmp/root/.config/awesome/lab126LayerLogic.lua for example)
and then kill awesome. (
killall -9 awesome, for example)
the window manager will restart - subsequent loading of windows not matching the naming scheme will be fronted. Complicated application with multiple simultaneous windows are not supported. however file selection/ popups are handled.
if you DO get a window that is huge, (ABOUT SCREEN) you can truncate the text before the
make in about.txt (in this case) or more generally remove that item from the menu or pass it a gtk maximum window size in the code. usually only ABOUT screens are a pain.
c) will it support alsa
assuming you included libasounsd2-dev you will be golden
d) can it live on FAT
it can. to get around the symlink issue on fat. tar.gz the folder when it is exported in </mnt/debian>/mnt/us/extensions/<thing>/ and then unzip that into /mnt/us/extensions/<thing>/ on the kindle, this will neatly unroll the symlinks resulting in a larger supporting library file total but no hassles. you can also electively remove all the links not required by the proggy. I have done both in the past, it is up to you.
e) will its configs be wiped everytime I turn it off
by default yes. however you could try setting the $HOME variable to something of your liking before you call the application or switch it permanently (as I have) in your /etc/passwd file on the kindle. Both XDG_CONFIG_HOME and HOME are honoured.
f) will keyboard input work
currently no, the GTK_IM_MODULE=kindle is being ignored as far as I can tell, this may be as a result of the fronting mechanism, further investigation would be required.
That's why I personally am not releasing it. but these are my notes for someone who might want to.
tbh Im fine using mine without it.
g) does it have multiple windows
No it doesn't, fortunately, because only single window apps are
currently supported.
In this build I have edited interface.c in the plugins/gtkui folder to elide the unhelpful HELP window that wont pop down. which ends up in plugin /mnt/us/extensions/deadbeef/lib/deadbeef/ddb_gui_GTK2.so
ADDING A DSP in preferences
hangs the UI. yep that would require too many levels of nested windows. Any action that requires two levels of windows will hang it.
Any action.
CONFIGURE CUSTOM SHELL COMMAND currently breaks our "one window + a popup" model and
renders the app unusable. they can be configured in the .config I believe instead.
I might have missed something else that explodes it. but its usable, minus the keyboard.
I did have an idea to scroll thru the available windows with a two fingered swipe... but that isnt implemented here...
So all the negatives said:
When the app is in place on the kindle I run it like:
beef.sh:
That can be setup to allow "tap out" on the power button, that code is elided here.
I've updated this guide with the links to the howto's but in a nutshell this is a
crash course in building something and running it maverick style on the kindle touch/paperwhite
Finally: Don't anyone complain about something missing I mentioned.
You can easily grab the files to build it yourself here:
http://deadbeef.sourceforge.net/download.html
None of the tools mentioned cost any money. Use them.
This is just an interim development release POC.
Trying to make building for the touch / PW (and eventually kindle 3) easy for everyone.
Take from this what is intended. a HOWTO "get going fast" not a perfect multi-format player