Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-03-2012, 03:31 PM   #31
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 39
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by NiLuJe View Post
Stupid question: Did you link against libasound statically or dynamically? In any case, which version of libasound did you build against?

Try to build (dynamically) against the same version as the one shipped on your target, the ALSA API/ABI can be tricky sometimes...
I am not absolutely sure, I just kept as many defaults as I could. The libraries I linked against were the ones I found on my Kindle, which I duly copied to the gcc library path and reran. Anyway both attempts (with libasound cross-compiled by me and with libasound taken from the Kindle) were the same: app runs but no sound, and straces looked very much the same.
elRicharD is offline   Reply With Quote
Old 06-03-2012, 03:43 PM   #32
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 39
Karma: 10
Join Date: May 2012
Device: Kindle Touch
I am downloading Kindle src for my fw version and also the Sourcery stuff, there is only one version there to get. I will see what I can come up with now.
elRicharD is offline   Reply With Quote
Advert
Old 06-03-2012, 03:47 PM   #33
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by elRicharD View Post
I am not absolutely sure, I just kept as many defaults as I could. The libraries I linked against were the ones I found on my Kindle, which I duly copied to the gcc library path and reran. Anyway both attempts (with libasound cross-compiled by me and with libasound taken from the Kindle) were the same: app runs but no sound, and straces looked very much the same.
I just installed (Ubuntu) scratchbox2 (already had qemu installed) and have started asking google for help.

Will start out by trying to install the KT, v5.1.0 system image in a scratchbox2 instance plus a CS (a.k.a: MG) toolchain and see how far I get on this learning curve.

Hmm...
Will use the source for strace as a test victum. Should be a lot easier than cross-compiling mplayer.

Don't anyone hold their breath here, I am old and work very, very slowly.
(But I do take good notes - so that may (someday) help someone.)
knc1 is offline   Reply With Quote
Old 06-03-2012, 04:16 PM   #34
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 39
Karma: 10
Join Date: May 2012
Device: Kindle Touch
knc1, you might try with mpg123, it didn't cause trouble at all to me on compilation time, I just had to find the right options in configure and move the libasound lib files to the libpath for the compiler.

I really want to discover what is wrong. If you happen to build a nice environment to test this please document it the best you can, I will gladly follow and update any documentation you might generate, it would be of great use for the community for sure. Thanks!
elRicharD is offline   Reply With Quote
Old 06-05-2012, 05:10 PM   #35
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by elRicharD View Post
I really want to discover what is wrong. If you happen to build a nice environment to test this please document it the best you can, I will gladly follow and update any documentation you might generate, it would be of great use for the community for sure. Thanks!
Slowly but surely working on it. This answers the "what compiler" question (/bin/umount in KT-5.1.0 image):
Code:
bin $ objdump -sx umount
. . . .
Contents of section .comment:
 0000 4743433a 20284c69 6e61726f 20474343  GCC: (Linaro GCC
 0010 20342e35 2d323031 312e3035 2d302920   4.5-2011.05-0) 
 0020 342e352e 34203230 31313035 30352028  4.5.4 20110505 (
 0030 70726572 656c6561 73652900 4743433a  prerelease).GCC:
 0040 20285562 756e7475 2f4c696e 61726f20   (Ubuntu/Linaro 
 0050 342e342e 342d3134 7562756e 74753129  4.4.4-14ubuntu1)
 0060 20342e34 2e352032 30313030 39303920   4.4.5 20100909 
 0070 28707265 72656c65 61736529 00        (prerelease).   
. . . .
And it is built agains the Kernel Headers version 2.6.16 not against the 2.6.31-rt kernel version that is running the KT.
(This is not an 'error' - __Linux__ maintains backwards compatibility - regardless of what lab126 likes to do to the e-ink drivers).
knc1 is offline   Reply With Quote
Advert
Old 06-05-2012, 07:04 PM   #36
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@knc1: https://www.mobileread.com/forums/sho...7&postcount=22

Linux 2.6.16 is the minimum kernel version that the glibc was built to support. (Even when dynamically linked, trying to run a binary targeting a newer kernel than your host will not work, the loader will shout at you and abort ). (It's set via glibc's --want-kernel configure arg [it does require that the kernel headers you build against be at *least* equal to that, but you can safely build against more recent headers]).

(I usually use readelf over objdump, readelf -n usually does the trick to check the ABI, and readelf -p.comment to check the GCC tag if it exists)

NPTL apparently requires 2.6.9, so that's probably what's used on most current distros (it's gentoo's default). I tweak it on my boxes, that's why the kindletool builds require Kernel 2.6.38/2.6.39.

It's also configurable when building a toolchain via crosstool-ng, and I usually set it to the oldest Kernel used on the Kindle series the toolchain targets (2.6.22 in the case of the K2/K3 cpu).

Last edited by NiLuJe; 06-05-2012 at 07:21 PM.
NiLuJe is offline   Reply With Quote
Old 06-05-2012, 07:20 PM   #37
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NiLuJe View Post
It's set via glibc's --want-kernel configure arg [it does require that the kernel headers you build against be at *least* equal to that, but you can safely build against more recent headers]
Just as long as you don't expect to access kernel services newer than those that are defined in your glibc build.

And 2.6.16 did not do dynamic device creation, one of the things we could see in the strace that the application was expecting.

A path to getting this working might be to use the sources from the Amazon source archive (old versions) rather than the "newest and best" versions.

I suppose that you have noticed that JP's terminal emulator (and other projects here) are still being built using pthreads.
NPTL came to ARM EABI very late in the game.
knc1 is offline   Reply With Quote
Old 06-05-2012, 07:37 PM   #38
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@knc1: Well, of course I'm assuming you're running a kernel >= your kernel headers .

I was speaking mostly from an x86/x86_64 POV, so I may be missing some stuff on the embedded/ARM front. (And I do use NPTL threading in my ARM TC, linux threads haven't been supported in the main glibc release tarballs since quite a while, if I remember correctly).

And pthreads doesn't necessarily means !NPTL, it supports both LT & NPTL, but it's been a while since I've seen a system with both threading implementation installed...

Last edited by NiLuJe; 06-05-2012 at 07:42 PM.
NiLuJe is offline   Reply With Quote
Old 06-05-2012, 08:32 PM   #39
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NiLuJe View Post
@knc1: Well, of course I'm assuming you're running a kernel >= your kernel headers .
Have been thinking a bit more about what I wrote . . . .
That was probably a poor example to have used as an example.

But the principle remains, if your c library has no connection to a feature, your code can't use it because of the missing code path in the library.

And for the case of the KT-v5.1.0 the kernel is newer (I.E: supporting of) the older header defined functions.
I don't expect any problems on this front.

Unless we build something against 3.0 headers and expect it to work on 2.6.31
knc1 is offline   Reply With Quote
Old 06-10-2012, 10:48 AM   #40
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 39
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Today I spent a little more of my time trying to compile mpg 123.

First I uncompressed the alsa package the kindle uses and compiled that version of alsa with this command:

Code:
./configure CC=/home/richard/Desktop/arm-2011.09/bin/arm-none-linux-gnueabi-gcc --host=x86_64 --target=arm-linux && make
Then I copied the src/.libs files I found into the /lib/gcc/arm-none-linux-gnueabi/.libs folder.

Then I compiled mpg123:
Code:
./configure CC=/home/richard/Desktop/arm-2011.09/bin/arm-none-linux-gnueabi-gcc --host=x86_64 --target=arm-linux --with-default-audio=alsa --with-cpu=generic_nofpu --enable-modules=no && make
I copied it to the Kindle and voilá! It worked without doing anything!

This was probably the alsa lib I was using to compile mpg123... But the good thing is that it works. The bad thing is that it stops playing after a while when I suspend the Kindle. I think I saw an app or something that prevented that from happening somewhere.

I am uploading the mpg123 executable, I deployed it in /mnt/us aka the root folder of the kindle and ran it.

Thanks to everyone for their help and support!
Attached Files
File Type: zip mpg123.zip (616.4 KB, 374 views)
elRicharD is offline   Reply With Quote
Old 06-10-2012, 11:04 AM   #41
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Please post the full output of:
Code:
/home/richard/Desktop/arm-2011.09/bin/arm-none-linux-gnueabi-gcc --version
knc1 is offline   Reply With Quote
Old 06-10-2012, 12:53 PM   #42
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 39
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by knc1 View Post
Please post the full output of:
Code:
/home/richard/Desktop/arm-2011.09/bin/arm-none-linux-gnueabi-gcc --version
Code:
richard@EliteBook-8530p:~/Desktop/arm-2011.09/bin$ ./arm-none-linux-gnueabi-gcc --version
arm-none-linux-gnueabi-gcc (Sourcery CodeBench Lite 2011.09-70) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
elRicharD is offline   Reply With Quote
Old 06-10-2012, 12:54 PM   #43
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 39
Karma: 10
Join Date: May 2012
Device: Kindle Touch
The ubuntu one returns


richard@EliteBook-8530p:~$ arm-linux-gnueabi-gcc-4.6 --version
arm-linux-gnueabi-gcc-4.6 (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
elRicharD is offline   Reply With Quote
Old 06-10-2012, 03:21 PM   #44
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Both of those are new enough that you should be able to use:
-mfloat-abi=softfp -mfpu=vfp
And still run on either the ARMv6l (VFPv2) or the ARMv7l (VFPv3) even with the rest of the Kindle libraries built as 'softfloat'.

If you have a chance, give that a try on your compile command line and see if the resultant binary will still run on your Kindle.
It should make a difference to mpeg123 when you use the floating point hardware.

Edit: Still haven't found a reference to that: 'l' (ell) but the only thing I have found so far is that it probably indicate VFPlite (the 'slow' VFP hardware - which trades silicon area for clock cycles).

And I am not sure if even gcc-4.6 has instruction scheduling for the VFPlite (slow FPU) hardware. Need to RTFM but I don't expect to find it before gcc-4.7

Last edited by knc1; 06-10-2012 at 05:13 PM.
knc1 is offline   Reply With Quote
Old 06-10-2012, 08:25 PM   #45
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 39
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by knc1 View Post
Both of those are new enough that you should be able to use:
-mfloat-abi=softfp -mfpu=vfp
And still run on either the ARMv6l (VFPv2) or the ARMv7l (VFPv3) even with the rest of the Kindle libraries built as 'softfloat'.

If you have a chance, give that a try on your compile command line and see if the resultant binary will still run on your Kindle.
It should make a difference to mpeg123 when you use the floating point hardware.
I will. Does that add any compatibility/performance improvement? Should I add those directives to the ./configure on mpg123?

Thanks!
elRicharD is offline   Reply With Quote
Reply

Tags
launcher add-ons


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MPlayer for Kindle: AAC/FLAC/MP3/OGG/WAV/... support, local and streaming ! Smarter Kindle Developer's Corner 143 08-25-2017 09:31 AM
Problem with MPlayer volume on Kindle Touch thuongquoc Amazon Kindle 0 03-26-2012 09:43 PM
Troubleshooting Setting Radio Address in Mplayer for kindle3 yueyingqishi Amazon Kindle 1 02-06-2012 12:09 PM
Kindle MPlayer Control over SSH (WiFi) antario Amazon Kindle 5 09-22-2011 03:23 PM
Kindle 3, Nook Simple Touch, Kobo Touch and Libra Pro Touch jbcohen Which one should I buy? 4 06-18-2011 08:58 PM


All times are GMT -4. The time now is 10:05 AM.


MobileRead.com is a privately owned, operated and funded community.