Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-01-2012, 05:18 PM   #196
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
To show media player UI through LIPC, one should issue following commands. First, to set information, which will be displayed in UI:
Code:
lipc-set-prop -s com.lab126.pillow configureChrome '{"appId": "com.lab126.mediaplayer", "mediaBar": {"clientParams": {"trackCount": 1, "volume": 11, "trackInfo": {"trackIndex": 1, "title":"Media title", "artist": "Media artist"}, "playerState": 3}, "name":"media_player_bar"}}'
Here parameters trackCount, volume, trackIndex, title, artist and playerState could be changed. I think, it's easily understandable, what each of them relates to, except playerState which, I guess, relates to value of property control of com.lab126.mediaplayer.

This command will create media player UI window, if it wasn't created yet or was closed.

Then, to show media player UI window, issue:
Code:
lipc-set-prop -i com.lab126.winmgr chromeState 1
Window can still be hidden after setting this property. I don't know why, but it's easy to check programmaticaly, whether it's shown. Just issue:
Code:
lipc-get-prop -i com.lab126.winmgr chromeState
If returned value is 0, then window isn't shown yet and you should repeat command for it's showing (set chromeState property again).

Even stock KT program check this property after it's setting (and repeat setting if it's equals to zero), so this isn't bug, I assume.

To hide media player UI window, issue:
Code:
lipc-set-prop -i com.lab126.winmgr chromeState 0
Media player UI window sometimes is not only hidden, but totally closed after this command.

Unfortunately, all this information will not help so much. As ixtab said, all media player logic is implemented in Java through OSGi bundle (located at /opt/amazon/ebook/lib/{MediaPlayer,MediaPlayer-impl}.jar and registered on LIPC bus as com.lab126.mediaplayer). UI is only dumb view, which is displaying information from Java app and forwarding events (key presses etc.) to Java app.

Also, for me UI didn't made anything useful when it had been started from LIPC manually.

Also, media player OSGi bundle isn't loaded automatically on Framework starting. It's only starting when user first goes to Experimental screen from menu and selects MP3 Player.

Last edited by eureka; 06-01-2012 at 05:35 PM.
eureka is offline   Reply With Quote
Old 06-01-2012, 07:56 PM   #197
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Sorry for continued offtopic...

Thanks to this post from Russian forum, I've found an alternative way to show mp3 playing UI through LIPC:
Code:
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.audiblePlayer/mnt/us/music/any.mp3?action=startplay
The /mnt/us/music/any.mp3 part could be changed to any (absolute) filesystem path.

The player interface is a bit different from MP3 player bar (because it's not [experimental] MP3 player, it's a stock Audible player) and it can't been sent to background.

You can also resume playing after exiting from player. Just replace action=startplay with action=resume.

If you'll remove part after ? (including ?) player will be only loaded (without immediate playing of mp3 file).
eureka is offline   Reply With Quote
Old 06-01-2012, 08:10 PM   #198
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,070
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by eureka View Post
Sorry for continued offtopic...

Thanks to this post from Russian forum, I've found an alternative way to show mp3 playing UI through LIPC:
Code:
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.audiblePlayer/mnt/us/music/any.mp3?action=startplay
The /mnt/us/music/any.mp3 part could be changed to any (absolute) filesystem path.

The player interface is a bit different from MP3 player bar (because it's not [experimental] MP3 player, it's a stock Audible player) and it can't been sent to background.

You can also resume playing after exiting from player. Just replace action=startplay with action=resume.

If you'll remove part after ? (including ?) player will be only loaded (without immediate playing of mp3 file).
Nice! Thanks.
geekmaster is offline   Reply With Quote
Old 06-02-2012, 12:10 AM   #199
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 34
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Gentlemen, all I can say is that you ROCK!

Thanks eureka, diba and geekmaster. I will use some spare cycles this weekend to test your advice and generate some Launcher app that does what I need, maybe someone would like to use that as well. Will investigate how to create the .bin, I think I saw instructions somewhere around here...

Thanks again and hope I can give something back to the community...
elRicharD is offline   Reply With Quote
Old 06-02-2012, 12:28 AM   #200
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677557
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
For launcher, it's probably best to not create .bin files (launcher extensions only need to be copied into the extensions/ folder of the USB storage, which is accessible anyway). "Real" installers are only required for hacks which need to modify the filesystem outside of the USB storage, where it's not "normally" reachable by the end user.

To clarify this again (just in case): the only accessible directory, for "normal" users, is /mnt/us/. Anything that needs to go somewhere else than that directory needs special care (like installers etc.) Conversely, anything that only needs access to this directory can be installed just fine by the average Windows user, by just dragging that one symbol to that other symbol, assuming that the instructions are really foolproof enough.

That said: You are of course very welcome to plunge into the "mechanical gears" of the system (that's where the real fun is... quite simply *because* it is challenging and tricky), and to try out kindletool etc. for yourself... Welcome to the "geeky" side of mobileread!

Last edited by ixtab; 06-02-2012 at 12:37 AM.
ixtab is offline   Reply With Quote
Old 06-02-2012, 10:45 AM   #201
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,070
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by ixtab View Post
That said: You are of course very welcome to plunge into the "mechanical gears" of the system (that's where the real fun is... quite simply *because* it is challenging and tricky), and to try out kindletool etc. for yourself... Welcome to the "geeky" side of mobileread!
Deep inside, where debricking is a normal step in the development cycle... Some of us have lost count of how many times we debricked our kindles.
geekmaster is offline   Reply With Quote
Old 06-02-2012, 02:36 PM   #202
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 34
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by geekmaster View Post
Deep inside, where debricking is a normal step in the development cycle... Some of us have lost count of how many times we debricked our kindles.
I cross-compiled mpg123 and libasound today to try to run it in my KT.
The compilation had no errors (after I copied the libraries I compiled to the corresponding /usr/lib folder) and the program runs, but no sound comes out of it I don't know what I screwed up.

Nevertheless, I installed mplayer and will try to create an interface to play mp3s with playlists and stuff using whatever code font hack has to offer. I have to see how to debug and test-run apps from the KT, so I will read whatever documentation is available... if I have some extra spare time.

Thanks a lot guys, hope I can do something useful out of this
elRicharD is offline   Reply With Quote
Old 06-02-2012, 03:40 PM   #203
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,070
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by elRicharD View Post
I cross-compiled mpg123 and libasound today to try to run it in my KT.
The compilation had no errors (after I copied the libraries I compiled to the corresponding /usr/lib folder) and the program runs, but no sound comes out of it I don't know what I screwed up.

Nevertheless, I installed mplayer and will try to create an interface to play mp3s with playlists and stuff using whatever code font hack has to offer. I have to see how to debug and test-run apps from the KT, so I will read whatever documentation is available... if I have some extra spare time.

Thanks a lot guys, hope I can do something useful out of this
Copying additional libraries to /usr/lib is a BAD idea. It would be MUCH better to put them in /mnt/us/opt/lib (or other folder on the USB drive) and put only symlinks to them in /usr/lib.

An OTA update can brick a kindle if it runs out of space on the main root partition, which can happen when you add your own files to it.

Last edited by geekmaster; 06-02-2012 at 05:09 PM.
geekmaster is offline   Reply With Quote
Old 06-02-2012, 04:53 PM   #204
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: 5,115
Karma: 4987077
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@elRicharD: AFAIK, the ALSA setup on the Kindles is a bit messy, so you may have to play a bit with the settings in order to find the right i/o/mixers. (Or check what the mplayer builds available here are doing). Having real world experience with ALSA might help, because it can be a huge PITA to setup...

Except that a pure ALSA experience seems to be a thing of the past, since every distro out there seems to think that PulseAudio is the second coming... USE=-pulseaudio ftw. (Oops, I'm ranting. Sorry ^^).

Last edited by NiLuJe; 06-02-2012 at 04:57 PM.
NiLuJe is online now   Reply With Quote
Old 06-02-2012, 06:48 PM   #205
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 34
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by geekmaster View Post
Copying additional libraries to /usr/lib is a BAD idea. It would be MUCH better to put them in /mnt/us/opt/lib (or other folder on the USB drive) and put only symlinks to them in /usr/lib.

An OTA update can brick a kindle if it runs out of space on the main root partition, which can happen when you add your own files to it.
I haven't copied anything to the root partition... I saw that there was alsa so I got libasound, cross-compiled it and used it to compile mpg123 with alsa support only. That was it.
It runs but it does not produce any sound. I screwed around with the alsamixer sliders and when mpg123 starts I can hear something, like the audio starting, but no music.
My idea is to compile it as static as I can so I don't have to have users messing with the OS, at the expense of some size overhead... anyway it did not work, I will check the mplayer package to see how can I get that working.
Anyway the symlinks hint is cool. Thanks guys!
elRicharD is offline   Reply With Quote
Old 06-02-2012, 06:51 PM   #206
elRicharD
Enthusiast
elRicharD began at the beginning.
 
Posts: 34
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by NiLuJe View Post
@elRicharD: AFAIK, the ALSA setup on the Kindles is a bit messy, so you may have to play a bit with the settings in order to find the right i/o/mixers. (Or check what the mplayer builds available here are doing). Having real world experience with ALSA might help, because it can be a huge PITA to setup...

Except that a pure ALSA experience seems to be a thing of the past, since every distro out there seems to think that PulseAudio is the second coming... USE=-pulseaudio ftw. (Oops, I'm ranting. Sorry ^^).
I am cool with ALSA, OSS was good to me too... I have been using Linux for ten years and I learned something installing Slackware and building my own kernel and stuff. I will take a look at mplayer. Thanks!
elRicharD is offline   Reply With Quote
Old 06-03-2012, 05:56 PM   #207
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 698
Karma: 1545625
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Small (and hopefully easy) patch suggestion: add contrast adjustment in browser just like in PDFs. Thinking about this, anyway, suggests me a problem: browser is a WAF and its menu is in JS...
Second shot: adding a nice step controller to pinch to zoom in PDF. I.E. add a menu entry which shows two buttons to increase/decrease zoom.
...maybe also this one isn't feasible...
silver18 is offline   Reply With Quote
Old 06-04-2012, 03:10 PM   #208
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677557
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Status report

I am currently re-working the entire framework. Probable features of the upcoming version 2.0:
  • a user interface (Kindlet) to enable/disable individual patches. The UI itself will be localizable, and most probably will also support the configuration of individual patches' parameters.
  • support simple localization / configuration of patches, by simply dropping .txt files into opt/jbpatch/.
  • "dynamic" configuration files, which do not require to restart the device: for the moment, this is mostly interesting for the margins patch (i.e., "close book, change settings, reopen book with the new settings"). As of now, I cannot guarantee that this will actually work, but that's the idea.

This means that from my side, all actual patch development is currently on hold, until the new version of jbpatch is ready. (It also means that the new version will be incompatible with all currently existing patches. However, that is not likely to be an issue, because all "official" patches so far have been released by me, and I will adapt all of them to the new version before publishing it).

As always: don't hold your breath, it may take a bit of time to finish this - I'm doing it in my spare time. But of course, all comments or suggestions are welcome!
ixtab is offline   Reply With Quote
Old 06-04-2012, 03:32 PM   #209
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
@ixtab, could you please sync your progress to bitbucket as work goes (maybe in separate branch)? I'm looking into adding to jbpatcher support for patches written in scripting languages (with using of JSR 223 implementation), so I'd like to see what parts of jbatcher are being reworked as close to real-time as possible (i.e. before official release).

(Yes, I'm understanding that you've rejected this idea. That's why I'm looking into it by myself )
eureka is offline   Reply With Quote
Old 06-04-2012, 06:21 PM   #210
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677557
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by eureka View Post
@ixtab, could you please sync your progress to bitbucket as work goes (maybe in separate branch)? I'm looking into adding to jbpatcher support for patches written in scripting languages (with using of JSR 223 implementation), so I'd like to see what parts of jbatcher are being reworked as close to real-time as possible (i.e. before official release).

(Yes, I'm understanding that you've rejected this idea. That's why I'm looking into it by myself )
I'll commit things as soon as they are more or less stable. Right now, I'm only wildly inventing new code, and breaking everything that exists. But as soon as I think it's half-way reasonable, yes, I'll commit it. Just don't be surprised if something changes again afterwards
ixtab is offline   Reply With Quote
Reply

Tags
jbpatch, kindle touch hacks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -4. The time now is 07:22 PM.


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