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 04-08-2020, 09:45 AM   #16
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Thanks for the pointer to Jessie. I had been looking at Stretch as that appeared to be the version using the kernel the PW4 is using. I guess they decided to use a newer kernel with the Jessie base.

Another thought. Debian strongly recommends the use of a package manager as opposed to attempting to manually download and install and mentions aptitude and synaptic. Obviously neither is currently on the PW4. Has anyone managed to install a package manager? Which one?

Dave
dhdurgee is online now   Reply With Quote
Old 04-08-2020, 12:02 PM   #17
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,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
While that's a given on any kind of classic Linux distro (even an LFS ;p), that's not really applicable here.

The Kindle is not a real Linux distro. It's a snapshot of one, heavily trimmed down for one specific purpose.

(Probably based on OpenEmbedded nowadays).

That makes this a terrible idea outside of a chroot.

Last edited by NiLuJe; 04-08-2020 at 12:05 PM.
NiLuJe is offline   Reply With Quote
Old 04-08-2020, 12:24 PM   #18
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by NiLuJe View Post
While that's a given on any kind of classic Linux distro (even an LFS ;p), that's not really applicable here.

The Kindle is not a real Linux distro. It's a snapshot of one, heavily trimmed down for one specific purpose.

(Probably based on OpenEmbedded nowadays).

That makes this a terrible idea outside of a chroot.
Understood. So I am left with doing what I need by hand if necessary with binaries from Jessie. Sounds like a lot of work.

On a related topic, I thought perhaps I am missing something. I planned to ssh into the pw4 while using the audio features Amazon provides and using top to see how they are doing so. But when I do so I get:

Code:
[root@kindle root]# top
Unknown HZ value! (8) Assume 100.
'xterm-256color': unknown terminal type.
[root@kindle root]#
That seems odd, so I did some searching the documented terminfo search path and do indeed find there is no /usr/share/terminfo/x/xterm-256color present. Shouldn't usbnet install it?

Dave
dhdurgee is online now   Reply With Quote
Old 04-08-2020, 01:43 PM   #19
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,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
It does, but in a custom terminfo db location in order to leave the rootfs untouched.

htop should enforce the relevant env var automatically, unlike the stock top.
NiLuJe is offline   Reply With Quote
Old 04-08-2020, 03:23 PM   #20
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by NiLuJe View Post
It does, but in a custom terminfo db location in order to leave the rootfs untouched.

htop should enforce the relevant env var automatically, unlike the stock top.
Ah, I see the wisdom of that.

Now I am looking into any side effects usbnet may have on the pw4.

I had selected in the KUAL menu to enable ssh via WiFi only and indeed I am able to ssh via WiFi and use the usbms to transfer books and other files to the pw4, but I find that if I ssh into the pw4 and then plug it in the usbms works but the ssh freezes. Is this expected?

I am also having an issue with voiceview, but as I only tried it once this might be operator error.

Dave
dhdurgee is online now   Reply With Quote
Old 04-08-2020, 03:46 PM   #21
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,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Yes, the sshd is hosted on the very partition that goes poof during USBMS.
NiLuJe is offline   Reply With Quote
Old 04-08-2020, 04:51 PM   #22
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by NiLuJe View Post
Yes, the sshd is hosted on the very partition that goes poof during USBMS.

Ah, a design limitation. Understood.

I finally got voiceview working with htop running. The related processes appear to be:

ivonattds
bsa_server
btd
audiomgrd

All of these live in /usr/bin and normally I would inspect them with fcl or mc for clues, as of course there is no manpage for any of them.

I assume one of these is doing the text-to-voice and assuming it is outputting in WAV it might be possible for mplayer to route its output there as well.

Dave
dhdurgee is online now   Reply With Quote
Old 04-09-2020, 12:10 PM   #23
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
It does appear from inspecting the above executables that they operate much as I suspected, but what is less obvious is how the text-to-voice process interfaces with the others. Is source code available for any of these?

Beyond that I do see references to /var/local and various sub-directories. Among these this one seems particularly interesting:

Code:
[root@kindle root]# ls -l /var/local/zbluetooth/
srwxrwxr-x    1 root     javauser         0 Apr  9 11:36 bt-daemon-socket
-rw-rw-r--    1 root     javauser       632 Apr  9 11:36 bt_config.xml
-rw-rw-r--    1 root     javauser      1727 Apr  9 11:37 bt_devices.xml
-rw-rw-r--    1 root     javauser       197 Jan 29 12:20 reconnect_devices.xml
I would imagine this provides a low level interface to the bluetooth device, but as far as I know mplayer does not include such support. One of the processes appears to be in part an audio mixer and perhaps this file offers a clue to someone familiar with programming one:

Code:
[root@kindle root]# cat  /var/local/system/bt_source_state.conf 

[BT_AUDIO_SOURCE_STATES_GROUP_NAME]
MAJOR_SOURCE_ASR=0
MAJOR_SOURCE_NON_ASR=1
COPY_FM_MAJOR_SOURCE_ASR=-1
COPY_FM_MAJOR_SOURCE_NON_ASR=-1
There are invocation options available for several of the processes, but not all. There are likely other clues to someone who, unlike me, has actually worked in this area. I can think of several possible ways for an interface to work, but I am prpbably not the best one to sniff out the clues as to which one is being used and how to take advantage of it for alternative uses.

Dave
dhdurgee is online now   Reply With Quote
Old 04-09-2020, 01:09 PM   #24
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
I thought of one more thing to check out besides VoiceView. I "bought" a free audible book on Amazon and downloaded it onto my pw4 to play. Using htop via ssh while playing it showed it to be using /usr/bin/playermgr in addition to those I had already identified. Inspecting this executable shows many references to gstreamer.

I am not familiar with gstreamer, but I imagine someone who is could inspect this execuable and sniff out how the audible book is being played via bluetooth. I don't see a reference to using mplayer with gstreamer, but I imagine there are players able to do so.

Any guidance appreciated.

Dave
dhdurgee is online now   Reply With Quote
Old 04-09-2020, 07:07 PM   #25
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
Try WireShark (for ARM, on the Kindle).


On Linux (which is the Kindle's system), wireshark does more than just your Ethernet card.
On Linux, Wireshark can manage nearly any interface, including BlueTooth.
For example:
https://opensource.com/article/20/1/...k-linux-tshark
about the second section down the page.
knc1 is offline   Reply With Quote
Old 04-09-2020, 09:02 PM   #26
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by knc1 View Post
Try WireShark (for ARM, on the Kindle).


On Linux (which is the Kindle's system), wireshark does more than just your Ethernet card.
On Linux, Wireshark can manage nearly any interface, including BlueTooth.
For example:
https://opensource.com/article/20/1/...k-linux-tshark
about the second section down the page.
It might come to that at some point, but I am looking at something that might offer a solution. Looking at strings in playermgr I see "audiblesrc" and "mixersink" and lsof when playing an audible book shows "/usr/lib/gstreamer-0.10/libgstaudiblesrc.so.1.0" and "/usr/lib/gstreamer-0.10/libgstmixersink.so.1.0" as being accessed. So it appears to me that knowing how to make use of this "mixersink" we could use another source with it.

I downloaded the Kindle open source code for my pw4 and inspecting the archive appears to show that gstreamer-0.10 is included there. My difficulty at this point is my lack of knowledge of how to extract the source for that particular interface knowing where it ends up on the pw4. A pointer from someone more familiar with this would be helpful.

Any suggestions?

Dave
dhdurgee is online now   Reply With Quote
Old 04-10-2020, 05:23 PM   #27
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
I downloaded the kindle source for my pw4 and searched it for the code for the mixersink without success. This led me to pull the strings for that library binary where I unfortunately found:

Code:
EINK-specific Mixer GStreamer sink
Proprietary
eink
http://www.amazon.com/
audio/x-raw-int, rate = (int) [ 1, MAX ], channels = (int) { 1, 2 }
So much for source code. This does appear to be exactly what is needed to feed an audio stream to and have it wind up output to the bluetooth headset or, looking at strings in another of the active processes, an OTG USB connected audio output.

The lsof shows the stdin,stdout and stderr handles and an open /var/run/playermgr.pid file plus four sockets, three FIFO pipes and the audible file being played. These must form the interface to the mixer sink and the player GUI displayed on the pw4 and its controls.

Is there at this point a reasonable source code reconstructor that could allow deducing which of these are actually the mixer sink interface? Is there a debug tool that would allow tracing all calls to the library?

Once again I wonder if I have the skills to track down what is necessary make use of this mixer sink library interface and code an alternative front end to feed other audio to it.

Dave
dhdurgee is online now   Reply With Quote
Old 04-10-2020, 08:31 PM   #28
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 dhdurgee View Post
I downloaded the kindle source for my pw4 and searched it for the code for the mixersink without success. This led me to pull the strings for that library binary where I unfortunately found:

Code:
EINK-specific Mixer GStreamer sink
Proprietary
eink
http://www.amazon.com/
audio/x-raw-int, rate = (int) [ 1, MAX ], channels = (int) { 1, 2 }
So much for source code.

. . . .

Dave
Maybe not.
gStreamer is GNU LGPL
IE: proprietary code can link to/from it at runtime.
But if this "sink" code is compiled into gStreamer, then the code is no longer proprietary.

Now that question can be resolved using one of the ELF header file viewers.
Hmm...
"readelf" would be one of the tools.
Note: you don't have to have the tool(s) on the Kindle, when you find the library (or executable) file you are interested in, just copy it to somewhere that you do have the tools.
There is most likely even "web interface" sites that will run readelf for you (if you happen to be "Windows handicapped".

I wrote too soon, there is a "work-alike" tool for readelf on other systems now:
Ref: http://elfparser.com/download.html
knc1 is offline   Reply With Quote
Old 04-10-2020, 09:50 PM   #29
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by knc1 View Post
Maybe not.
gStreamer is GNU LGPL
IE: proprietary code can link to/from it at runtime.
But if this "sink" code is compiled into gStreamer, then the code is no longer proprietary.

Now that question can be resolved using one of the ELF header file viewers.
Hmm...
"readelf" would be one of the tools.
Note: you don't have to have the tool(s) on the Kindle, when you find the library (or executable) file you are interested in, just copy it to somewhere that you do have the tools.
There is most likely even "web interface" sites that will run readelf for you (if you happen to be "Windows handicapped".

I wrote too soon, there is a "work-alike" tool for readelf on other systems now:
Ref: http://elfparser.com/download.html
I have access to it, but understanding its output is another thing entirely. Attached to this post is a zip containing the readelf output and the binary itself in case there are other tools you want to investigate it with.

If we can determine how to use this library we should be able to play any audio stream by converting it to an acceptable WAV stream and routing it to the mixer to pass on to the connected audio output.

Thank you four your guidance any any assistance you may offer me in this effort.

Dave
Attached Files
File Type: zip libgstmixersink.so.1.0.zip (14.4 KB, 227 views)

Last edited by dhdurgee; 04-10-2020 at 09:54 PM.
dhdurgee is online now   Reply With Quote
Old 04-11-2020, 01:40 AM   #30
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,731
Karma: 6681393
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
The actual meat of the code is in libmixerAPI.so.1. Also, you should be able to compile gst-launch and try piping raw audio into it.
geek1011 is offline   Reply With Quote
Reply

Tags
audiobook, bluetooth, jailbreak, m4b, mp3


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with finding audiobook metadata on Amazon angelyne Calibre 6 10-21-2018 08:52 AM
Listen Audiobook Player question Hrafn Audiobook Hardware & Software 0 06-16-2018 02:36 AM
Listen Up - We've got a brand new audiobook forum Alexander Turcic Announcements 11 09-10-2014 06:18 PM
Amazon Ebooks and downloaded Audiobook ErikaGC Kindle Fire 1 06-10-2013 12:13 PM
Sony & Amazon, etc. - Why No Wifi or Bluetooth? poohbear_nc News 8 08-26-2009 04:29 PM


All times are GMT -4. The time now is 10:40 PM.


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