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 05-12-2020, 12:20 PM   #46
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 just added my first shot at bookmark support. Hopefully this will work as designed.

Dave
dhdurgee is offline   Reply With Quote
Old 05-12-2020, 01:49 PM   #47
arooni
Addict
arooni began at the beginning.
 
Posts: 315
Karma: 26
Join Date: Jul 2012
Device: Kindle Paperwhite 4 (2018)
Trying out version 2:

What works great:
1) Playback and resume work great when there's only one mp3 file in /mnt/music (see below.

Potential issues I discovered:
1) Script works flawlessly when there is only one mp3 file in /mnt/music/ ; the moment > 1 mp3 exists, playback never seems to start.


Here's my wish list:

1) Allow for a separate config file to load whichever internet radio stations without having to configure it in the menu and potentially break things.
2) Allow for a 'skip' or next track functionality so if I don't like what I'm listening to I can listen to the next track.
3) (distant far off hope some day) update bookmark via some kind of open source way so that if I'm listening to an audio book on my android phone / iphone it could remember position across devices. this might be a tall order.

Still trying to figure out the best use of local playback, I think it would be for relaxing background sounds like brown noise, rain, ocean waves to listen to while reading. Music with lyrics is distracting to me.

Again many thanks for what you've done so far. Being able to read without the temptation of my phone and the ability have background music to help me focus better is invaluable.

Last edited by arooni; 05-12-2020 at 01:55 PM.
arooni is offline   Reply With Quote
Advert
Old 05-12-2020, 02:42 PM   #48
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
Regarding playback problems, I have seen a problem on occasion as well. When it happens do you see the icon on the top line near the bluetooth icon showing audio is connected? When I have the problem there is usually a problem with the bluetooth audio connection. I can usually fix it by turning bluetooth off and back on and reconnecting the audio.

I have had no problems with multiple audio files here, only the bluetooth connection problem.

I would have to check and see if there is some way to have sox skip within a playlist, if so it might be possible.

Will think further on other issues.

Dave
dhdurgee is offline   Reply With Quote
Old 05-12-2020, 03:10 PM   #49
arooni
Addict
arooni began at the beginning.
 
Posts: 315
Karma: 26
Join Date: Jul 2012
Device: Kindle Paperwhite 4 (2018)
Quote:
Originally Posted by dhdurgee View Post
Regarding playback problems, I have seen a problem on occasion as well. When it happens do you see the icon on the top line near the bluetooth icon showing audio is connected? When I have the problem there is usually a problem with the bluetooth audio connection. I can usually fix it by turning bluetooth off and back on and reconnecting the audio.

I have had no problems with multiple audio files here, only the bluetooth connection problem.

I would have to check and see if there is some way to have sox skip within a playlist, if so it might be possible.

Will think further on other issues.

Dave

When I add the second file to the music directory via ssh/quit and restart KUAL and go back into your application, I see no change in the bluetooth icon. To make sure it's working prior I open an audible download to make sure audio is playing correctly on my earbuds.
arooni is offline   Reply With Quote
Old 05-12-2020, 05:10 PM   #50
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 arooni View Post
When I add the second file to the music directory via ssh/quit and restart KUAL and go back into your application, I see no change in the bluetooth icon. To make sure it's working prior I open an audible download to make sure audio is playing correctly on my earbuds.
Not the bluetooth icon, the little loud speaker to the left of the bluetooth icon. When I have a problem that little loud speaker icon disappears. At that point I find the pw4 has delayed reactions to anything I try. Going to settings and toggling bluetooth and reconnecting corrects it.

I am not sure of what causes the problem I am seeing, and it might not be the same problem as yours. In my case I am using a bluetooth headset that is also connected to my phone.

Another question, are all your mp3 files the same rate, depth and channels? The imited support in the gstreamer available on the kt4 and pw4 does not support adapting in mid-stream. I don't know what to expect if you try to do so.

Dave
dhdurgee is offline   Reply With Quote
Advert
Old 05-12-2020, 06:30 PM   #51
hartleyshc
Member
hartleyshc began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2010
Location: Gainesville, FL
Device: Nook 1st Gen, KT4, PW4, PW5-SE
A little tip for those who might use a simple speaker instead of headphones with volume control. If you open an Audible book (Samuel Jackson reading 'Go the F**k to Sleep' is small and free) you can use that to adjust the volume of what is playing.

Also suggesting volume control, but the work around is working just fine for me. I find the radio station play back much more useful than trying to listen to an audio book.
hartleyshc is offline   Reply With Quote
Old 05-12-2020, 08:02 PM   #52
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 hartleyshc View Post
A little tip for those who might use a simple speaker instead of headphones with volume control. If you open an Audible book (Samuel Jackson reading 'Go the F**k to Sleep' is small and free) you can use that to adjust the volume of what is playing.

Also suggesting volume control, but the work around is working just fine for me. I find the radio station play back much more useful than trying to listen to an audio book.
I am unaware of a way to access the volume control at present, so you will have to address that with your bluetooth audio device. I almost included WSKYFM with my list of stations as I have family in Gainesville and listen to that station when I am in the area. I assume you edited menu.json and either replaced one of my samples or added another entry for one of your liking. I had intended to add an example ogg station as well but all I could find were overseas.

Glad you find the extension useful.

Dave
dhdurgee is offline   Reply With Quote
Old 05-13-2020, 01:06 AM   #53
hartleyshc
Member
hartleyshc began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2010
Location: Gainesville, FL
Device: Nook 1st Gen, KT4, PW4, PW5-SE
Quote:
Originally Posted by dhdurgee View Post
I am unaware of a way to access the volume control at present, so you will have to address that with your bluetooth audio device. I almost included WSKYFM with my list of stations as I have family in Gainesville and listen to that station when I am in the area. I assume you edited menu.json and either replaced one of my samples or added another entry for one of your liking. I had intended to add an example ogg station as well but all I could find were overseas.

Glad you find the extension useful.

Dave
Totally understand. It seems the default volume of whatever you're playing will be based on what the kindle has the volume set to. I have a few of those novelty pocket sized Bluetooth speakers I was thinking of trying to use with the kindle. Pairing my headphones is negligible. I was really hoping to finally have a use for these things besides some future hardware project I might never start or finish.

As for the Sky, I actually misread your first entry, KSKYAM as WSKYFM and assumed you might have been a local. Seems in reality I was pretty close haha. I've been a listener for years. As another user said, I'm a bit too distracted by lyrics and talk while reading, so classical has been a good choice for me.

And yeah, I looked at your menu.json and it's very easy to add streams to. I found a bunch of streams on the Icecast server directory ( http://dir.xiph.org/ ). They're tagged if they're using mp3 (or even Vorbis, since you said ogg works). I assume you just write ogg instead of mp3 in the params line.
hartleyshc is offline   Reply With Quote
Old 05-13-2020, 03:25 AM   #54
hartleyshc
Member
hartleyshc began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2010
Location: Gainesville, FL
Device: Nook 1st Gen, KT4, PW4, PW5-SE
***Sorry for the doublepost. I don't even see an edit option, and when I forced an edit (editpost.php) it says I have a 5 minute time frame to edit my post, which is longer than it takes for an admin to approve my post. So sorry for this, but Ill forget to post tomorrow. ***



Anyways, found a bug.
Streams will actually overlay on top of each other. I added WSKY, and it was kind of fun to hear Coast to Coast AM with classical music playing in the background.

Because of this, I added
Code:
killall sox
rm /var/tmp/bookmark
rm /var/tmp/progress
to the beginning of the playinternetradio.sh

I added the rm bookmark and progress lines as well because it looks from your code that it will still be counting since the bookmarks code is based on the time between started and when the bookmark is saved. So if the user hits the bookmarks button later, it would still add on the time they were listening to internet stream and not the (assumed) audio book. Figured its better to listen to a part of the book again, instead of skipping past whole sections of the audio book.
hartleyshc is offline   Reply With Quote
Old 05-13-2020, 06:22 AM   #55
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by hartleyshc View Post
... If you open an Audible book ... you can use that to adjust the volume of what is playing.
Good idea, nice work around.

Quote:
Originally Posted by dhdurgee View Post
I am unaware of a way to access the volume control at present, so you will have to address that with your bluetooth audio device.
Not of paramount importance but suggestion to keep in mind since the PW3 can't play Audible, and my contraption (cheapo soundcard & earphones) doesn't have volume controls.

[EDIT] You can also preset the volume in settings / voice view / volume:
Click image for larger version

Name:	screenshot_2020_05_13T07_09_10-0402.png
Views:	370
Size:	34.6 KB
ID:	179214Click image for larger version

Name:	screenshot_2020_05_13T07_08_54-0402.png
Views:	327
Size:	19.5 KB
ID:	179213

Last edited by PoP; 05-13-2020 at 07:20 AM. Reason: voice view trick
PoP is offline   Reply With Quote
Old 05-13-2020, 08:58 AM   #56
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 hartleyshc View Post
***Sorry for the doublepost. I don't even see an edit option, and when I forced an edit (editpost.php) it says I have a 5 minute time frame to edit my post, which is longer than it takes for an admin to approve my post. So sorry for this, but Ill forget to post tomorrow. ***



Anyways, found a bug.
Streams will actually overlay on top of each other. I added WSKY, and it was kind of fun to hear Coast to Coast AM with classical music playing in the background.

Because of this, I added
Code:
killall sox
rm /var/tmp/bookmark
rm /var/tmp/progress
to the beginning of the playinternetradio.sh

I added the rm bookmark and progress lines as well because it looks from your code that it will still be counting since the bookmarks code is based on the time between started and when the bookmark is saved. So if the user hits the bookmarks button later, it would still add on the time they were listening to internet stream and not the (assumed) audio book. Figured its better to listen to a part of the book again, instead of skipping past whole sections of the audio book.
Had you used the "Stop playing media" to stop the currently playing stream before selecting a new one? I guess I was expecting users to do so as opposed to simply killing any running sox process.

The bookmark and progress files are ignored by the internetradio script as there is no way to bookmark a live stream. In fact your modification will erase the bookmark for the last played local media.

I will consider adding the killall sox to the start of the two scripts to address the case where the user attempts to start a playback when one is already running.

Dave
dhdurgee is offline   Reply With Quote
Old 05-13-2020, 09:10 AM   #57
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 PoP View Post
Good idea, nice work around.



Not of paramount importance but suggestion to keep in mind since the PW3 can't play Audible, and my contraption (cheapo soundcard & earphones) doesn't have volume controls.

[EDIT] You can also preset the volume in settings / voice view / volume:
Attachment 179214Attachment 179213
I guess this should be in the README with both variations as the pw4 has it in a different location. Thank you for the suggestion.

Dave
dhdurgee is offline   Reply With Quote
Old 05-13-2020, 09:19 AM   #58
hartleyshc
Member
hartleyshc began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2010
Location: Gainesville, FL
Device: Nook 1st Gen, KT4, PW4, PW5-SE
Quote:
Originally Posted by dhdurgee View Post
Had you used the "Stop playing media" to stop the currently playing stream before selecting a new one? I guess I was expecting users to do so as opposed to simply killing any running sox process.

The bookmark and progress files are ignored by the internetradio script as there is no way to bookmark a live stream. In fact your modification will erase the bookmark for the last played local media.

I will consider adding the killall sox to the start of the two scripts to address the case where the user attempts to start a playback when one is already running.

Dave
Yeah I think just adding it to the play streams file is enough, especially with the way the you have it written I out now. Since it creates a pls file of all of the mp3s, no one is going to click on play all mp3s again. And even if they do, and you put killsox and the rm strings, it's just going to start back over where their last bookmark was. Maybe put the code you used to write to 'starting' if they happen to click on play all files it will just automatically bookmark it for them.

I did spend a bit last night writing a koreader plugin that uses your bash files. I was able to start and stop a predefined radio stream from the tools/plugins menu. The goal there is that you'll eventually be able use the built in file manager on koreader to select mp3s from a directory. The bad part is that it'll need to be updated every single koreader release as their plugin system is kind of set in stone and you have modify the menus to get the plugin to show up, instead of just dumping some files in the plugins directory.
hartleyshc is offline   Reply With Quote
Old 05-13-2020, 09:53 AM   #59
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 hartleyshc View Post
Yeah I think just adding it to the play streams file is enough, especially with the way the you have it written I out now. Since it creates a pls file of all of the mp3s, no one is going to click on play all mp3s again. And even if they do, and you put killsox and the rm strings, it's just going to start back over where their last bookmark was. Maybe put the code you used to write to 'starting' if they happen to click on play all files it will just automatically bookmark it for them.

I did spend a bit last night writing a koreader plugin that uses your bash files. I was able to start and stop a predefined radio stream from the tools/plugins menu. The goal there is that you'll eventually be able use the built in file manager on koreader to select mp3s from a directory. The bad part is that it'll need to be updated every single koreader release as their plugin system is kind of set in stone and you have modify the menus to get the plugin to show up, instead of just dumping some files in the plugins directory.
I will be interested if you get playing of selected media files from koreader. For that you will obviously want to use the playfile.sh script which I developed prior to the playall.sh script. I was going to look into support for playing selected media files, but it appears the only way to do so is to regenerate the menu.json file to include them. I had yet to get onto that, but NiLuJe pointed me to the font hacks regeneration process as an example of how to do so.

Dave
dhdurgee is offline   Reply With Quote
Old 05-13-2020, 04:06 PM   #60
arooni
Addict
arooni began at the beginning.
 
Posts: 315
Karma: 26
Join Date: Jul 2012
Device: Kindle Paperwhite 4 (2018)
Wow! koreader support so I can toggle music directly from my normal reading experience! That's so nifty.

How does it handle making a new connection to bluetooth from within koreader?

PS: Would love to see a 'shuffle' feature. I don't mind making a playlist file to play back multiple mp3s if that's necessary.

PPS: Which are the best classical music stations with minimal commercials / talking that you folks are using?
arooni is offline   Reply With Quote
Reply

Tags
kt4, mp3, pw3, pw4, sox


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW [KUAL] Yet another clock extension MrTick Kindle Developer's Corner 3 10-21-2019 03:06 PM
xmahjongg for Kindle as Kual extension Hanspeter Kindle Developer's Corner 86 12-02-2016 07:06 PM
kual extension to open a book shoelesshunter Kindle Developer's Corner 14 08-16-2016 12:30 PM
is there any KUAL extension development guide? fangzi Kindle Developer's Corner 2 01-02-2014 10:11 AM


All times are GMT -4. The time now is 04:06 AM.


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