webOS Nation Forums >  Homebrew >  WebOS Internals > Navit for Pre?
Navit for Pre?

  Closed Thread
 
LinkBack Thread Tools Display Modes
Old 04/30/2010, 08:12 AM   #221 (permalink)
Homebrew Developer

 
HaPe's Avatar
 
Join Date: Jun 2009
Location: Gremany, Frankfurt am Main
Posts: 520
Likes Received: 11
Thanks: 130
Thanked 182 Times in 77 Posts
Default

Quote:
Originally Posted by shinebar View Post
Now & next always show the same Street, did you happen to mix up the variables?

Thanks a lot for your work
Danny
Sorry, I retested and you are right. I Messed up the variables. I will fix it and have a second version of the skin.
But I will not have a chance to post it before Monday.
I also will put the skins in the git repository and it will be the default for the next package.

HaPe
HaPe is offline  
Old 04/30/2010, 11:29 AM   #222 (permalink)
hux
Member
 
Join Date: Jul 2009
Posts: 140
Likes Received: 6
Thanks: 13
Thanked 7 Times in 7 Posts
Default

Quote:
Originally Posted by HaPe View Post
Ps Here a screenshot of the skin that hux send me. Thanks.
Oh, wasn't me who sent the skin.

But I can confirm that I tried the de_DE language file and exactly that one is NOT working/installing. Besides that, with just the espeak package, I hear someone talking once I planned a route. Can't understand the voice, and this is the only time I hear something. No voice commands for turning etc. follow that initial voice. So to the other guys who told me without a language pack, it would be english by default - no, doesn't seem so.
hux is offline  
Old 04/30/2010, 08:05 PM   #223 (permalink)
Member
 
vreihen's Avatar
 
Join Date: Jul 2009
Posts: 501
Likes Received: 16
Thanks: 44
Thanked 102 Times in 63 Posts
Default

Quote:
Originally Posted by fengfengw View Post
It is my bad. I copied the file again and the skin works very well. Just love it. I am wondering if the volume of the voice could be louder?
If you want to take a shot at fixing it yourself, edit the file:

/media/cryptofs/apps/usr/palm/applications/org.webosinternals.espeak/espeak

This is the content of mine after I touched it up:

Code:
#!/bin/sh

APP_DIR=/media/cryptofs/apps/usr/palm/applications/org.webosinternals.espeak
export LD_LIBRARY_PATH=$APP_DIR/lib:$LD_LIBRARY_PATH

#ESPEAK_SINK=pnavigation
#ESPEAK_VOICE=de

( echo "$1" | $APP_DIR/bin/espeak --path $APP_DIR/share --stdout -v ${ESPEAK_VOICE:-en} -a 200 -p 75 -s 140 | paplay -d ${ESPEAK_SINK:-pdefaultapp} )&
I added the three command line switches, based on docs at the espeak web site, eSpeak Speech Synthesizer

-a 200 (sets amplitude/volume, default=100)

-p 75 (sets pitch, default=50) I'm still trying to find the one that I prefer.

-s 140 (sets the speed in words per minute, default=170) I slowed it down a little, because I thought that it talked too fast to comprehend the street names in it's synthetic voice.

I haven't driven with it since I made these changes, but I think they will work much better than the current defaults.....
vreihen is offline  
Thanked By: mgmft
Old 05/02/2010, 07:13 AM   #224 (permalink)
Member
 
Join Date: Mar 2010
Posts: 165
Likes Received: 7
Thanks: 21
Thanked 21 Times in 15 Posts
Default

Quote:
I added the three command line switches, based on docs at the espeak web site, eSpeak Speech Synthesizer

-a 200 (sets amplitude/volume, default=100)

-p 75 (sets pitch, default=50) I'm still trying to find the one that I prefer.

-s 140 (sets the speed in words per minute, default=170) I slowed it down a little, because I thought that it talked too fast to comprehend the street names in it's synthetic voice.
@Vreihen: THANKS! Now I can hear my Pre when I am driving

@HaPe: Could you put change at least the volume setting in the package to a=200? By default it isn`t loud enough.

Marcel
mgmft is offline  
Old 05/02/2010, 09:13 AM   #225 (permalink)
Member
 
vreihen's Avatar
 
Join Date: Jul 2009
Posts: 501
Likes Received: 16
Thanks: 44
Thanked 102 Times in 63 Posts
Default

Quote:
Originally Posted by mgmft View Post
@Vreihen: THANKS! Now I can hear my Pre when I am driving

@HaPe: Could you put change at least the volume setting in the package to a=200? By default it isn`t loud enough.
No problem. That's the beauty of open-source software.

What I originally went into that script to do was insert 0.75 seconds of either dead air or a subtle "bing" before every announcement. My vehicle's Bluetooth receiver (Motorola T-605) drops the first ~0.5 seconds of every announcement if the Pre is making a cold Bluetooth connection, ie: Pandora or another music app not already playing on the Bluetooth connection. (Sprint Navigation's announcements are also cut off by this.) If there is a way to insert a ~0.5 second delay into the distribution package, it would be really appreciated.....
vreihen is offline  
Old 05/02/2010, 12:41 PM   #226 (permalink)
Homebrew Developer

 
HaPe's Avatar
 
Join Date: Jun 2009
Location: Gremany, Frankfurt am Main
Posts: 520
Likes Received: 11
Thanks: 130
Thanked 182 Times in 77 Posts
Default

Quote:
Originally Posted by mgmft View Post
@HaPe: Could you put change at least the volume setting in the package to a=200? By default it isn`t loud enough.
yes will do.
HaPe is offline  
Old 05/02/2010, 12:45 PM   #227 (permalink)
Homebrew Developer

 
HaPe's Avatar
 
Join Date: Jun 2009
Location: Gremany, Frankfurt am Main
Posts: 520
Likes Received: 11
Thanks: 130
Thanked 182 Times in 77 Posts
Default

Quote:
Originally Posted by vreihen View Post
No problem. That's the beauty of open-source software.

What I originally went into that script to do was insert 0.75 seconds of either dead air or a subtle "bing" before every announcement. My vehicle's Bluetooth receiver (Motorola T-605) drops the first ~0.5 seconds of every announcement if the Pre is making a cold Bluetooth connection, ie: Pandora or another music app not already playing on the Bluetooth connection. (Sprint Navigation's announcements are also cut off by this.) If there is a way to insert a ~0.5 second delay into the distribution package, it would be really appreciated.....
I have no idea how. If you find a solution I have no problem to add it.
There is also a other problem in the current script.
You will hear two one on the other If a second announcement is sent out by Navit before the first is ended.
I would be happy if someone find a good solution that the second script call is waiting until the espeak background task of the first one is finished .

HaPe
HaPe is offline  
Old 05/02/2010, 03:54 PM   #228 (permalink)
Homebrew Developer

 
HaPe's Avatar
 
Join Date: Jun 2009
Location: Gremany, Frankfurt am Main
Posts: 520
Likes Received: 11
Thanks: 130
Thanked 182 Times in 77 Posts
Default

I put a new version online and updated the post => http://forums.precentral.net/showthr...98#post2375298

V100502:
- new navit version (e.g. you can now delete bookmarks)
- new skin (if you are updating from an older version you need to delete the xml files in .app-storage/file_.media.cryptofs.apps.usr.palm.applications.org.webosinternals.navit_0/ on the Pre usb drive)
- new espeak version
- added switch -a 200 to the espeak call (max volume)
- added an autozoom on/off switch to Navits seetings menu (thanks to Kunz for the tip Navit für den Pre? )
HaPe is offline  
Old 05/02/2010, 05:30 PM   #229 (permalink)
Member
 
vreihen's Avatar
 
Join Date: Jul 2009
Posts: 501
Likes Received: 16
Thanks: 44
Thanked 102 Times in 63 Posts
Default

Quote:
Originally Posted by HaPe View Post
I have no idea how. If you find a solution I have no problem to add it.
I put the following line onto the espeak script, right before the line that calls espeak:

paplay -d ${ESPEAK_SINK:-pdefaultapp} /usr/palm/sounds/notification.wav

(Check the path, I'm typing it from memory.)

It wasn't my first choice of sounds, but I just wanted to test the results and it was a handy .WAV file of about the proper duration. (I'd like to use the "bing-bong" chimes that precede public address system announcements on trains and ships, but I can't find it in a .wav file with no royalties attached.)

Of course, I dropped the "&" from the end of the line so that espeak would wait for the notification to finish before speaking, which ties in perfectly with the following:

Quote:
Originally Posted by HaPe View Post
There is also a other problem in the current script.
You will hear two one on the other If a second announcement is sent out by Navit before the first is ended.
I would be happy if someone find a good solution that the second script call is waiting until the espeak background task of the first one is finished.
I was going to ask why you backgrounded the speaking task! Was it because Navit would wait until the speaking task finished before resuming navigation?

The quick & dirty programmer in me is saying to set up a semaphore (lock) file each time the espeak script is loaded, and make the last command in the pipeline delete the semaphore. If the second iteration sees the lock already in place, it waits until it is cleared. Of course, you need a fail-safe timer, to clear the lock if the previous process died before killing the semaphore, but by then you will have passed your turn.

I'm thinking that the proper way is to set up a speech spooler queue, just like a printer queue. When you want the phone to read something, submit it into the queue and let a background task handle sending the files in sequence. Making espeak into it's own independent package with a speech queue task would allow other developers to use it in their projects as well. I'd personally like to see an app that reads my SMS messages to me when I'm driving, and I'm sure that there's many other uses for such a service. I'm almost thinking that it would be neat to install lpr or CUPS from Optware, and then define a printer device named "speech" that reads whatever is sent to it.

If you need the help, I can slap together a quick & dirty shell script queuing system in a few days if it winds up being necessary.....
vreihen is offline  
Old 05/03/2010, 02:42 AM   #230 (permalink)
Member
 
Join Date: Mar 2010
Posts: 165
Likes Received: 7
Thanks: 21
Thanked 21 Times in 15 Posts
Default

Hi HaPe,

thanks for your update. I uninstalled (using preware) and tried to install. But I can`t install the locale (de). An Error occurs:


Someone else in preforum.de has the same problem What could it be? But it seems to work anyway

My navit.xml still uses my MTP-Maps. So it hasn`t been replaced by the new installation? Is there a problem in the installation or am I getting it wrong?

Thanks

Marcel

Last edited by mgmft; 05/03/2010 at 02:54 AM.
mgmft is offline  
Old 05/03/2010, 03:15 AM   #231 (permalink)
Homebrew Developer

 
HaPe's Avatar
 
Join Date: Jun 2009
Location: Gremany, Frankfurt am Main
Posts: 520
Likes Received: 11
Thanks: 130
Thanked 182 Times in 77 Posts
Default

Quote:
Originally Posted by vreihen View Post
I was going to ask why you backgrounded the speaking task! Was it because Navit would wait until the speaking task finished before resuming navigation?
Exactly that was the point. Navit supports it to compile espeak as a part (lib) of the main program. I expect the problem would be gone if we get this working.
But until now it fails as the required pulsaudio package is not compiling. This is required for this as it is doing the part that aplay now dose, which is compile by palm ...

Quote:
Originally Posted by vreihen View Post
The quick & dirty programmer in me is saying to set up a semaphore (lock) file each time the espeak script is loaded, and make the last command in the pipeline delete the semaphore. If the second iteration sees the lock already in place, it waits until it is cleared. Of course, you need a fail-safe timer, to clear the lock if the previous process died before killing the semaphore, but by then you will have passed your turn.

I'm thinking that the proper way is to set up a speech spooler queue, just like a printer queue. When you want the phone to read something, submit it into the queue and let a background task handle sending the files in sequence. Making espeak into it's own independent package with a speech queue task would allow other developers to use it in their projects as well. I'd personally like to see an app that reads my SMS messages to me when I'm driving, and I'm sure that there's many other uses for such a service. I'm almost thinking that it would be neat to install lpr or CUPS from Optware, and then define a printer device named "speech" that reads whatever is sent to it.

If you need the help, I can slap together a quick & dirty shell script queuing system in a few days if it winds up being necessary.....
That was the idea that we was thinking to. Be welcomed to help if you have the time and interest to do it.
You can easily apply for a git ID in the webos-internals chat or contact http://forums.precentral.net/members/rwhitby.html directly.

HaPe
HaPe is offline  
Old 05/03/2010, 03:17 AM   #232 (permalink)
Homebrew Developer

 
HaPe's Avatar
 
Join Date: Jun 2009
Location: Gremany, Frankfurt am Main
Posts: 520
Likes Received: 11
Thanks: 130
Thanked 182 Times in 77 Posts
Default

Quote:
Originally Posted by mgmft View Post
Hi HaPe,

thanks for your update. I uninstalled (using preware) and tried to install. But I can`t install the locale (de). An Error occurs:
...

Someone else in preforum.de has the same problem What could it be? But it seems to work anyway

My navit.xml still uses my MTP-Maps. So it hasn`t been replaced by the new installation? Is there a problem in the installation or am I getting it wrong?

Thanks

Marcel
Hi Marcel,

i know that this is happening to some uses. At the moment I have now idea why, as I was not able to reproduce it with my Pre.

YOu can check one thing. get a terminal access on your pre by novaterm (from your pc) or Termius (a Pre application. Then type 'mount' and hit enter. Check for a line beginning with '/dev/mapper/store-root on / ....'
It should be
Code:
/dev/mapper/store-root on / type ext3 (ro,data=ordered)
and not
Code:
/dev/mapper/store-root on / type ext3 (rw,data=ordered)
If it is 'rw' then type 'mount -o remount,ro /' to switch it back to read only. Normally I would WQIS/Preware expect to do this...

HaPe

Last edited by HaPe; 05/03/2010 at 03:41 AM.
HaPe is offline  
Old 05/03/2010, 04:22 AM   #233 (permalink)
Member
 
Join Date: Mar 2010
Posts: 165
Likes Received: 7
Thanks: 21
Thanked 21 Times in 15 Posts
Default

Hi HaPe,

it is readonly as should be. Someone at preforum.de mentioned it could be, that the script wants to set a link, and since I had it previously installed, the link is already there and the error is caused.

Marcel

Marcel
mgmft is offline  
Old 05/03/2010, 04:55 AM   #234 (permalink)
Member
 
Join Date: Jan 2010
Location: Hamburg, Germany
Posts: 31
Likes Received: 0
Thanks: 8
Thanked 2 Times in 2 Posts
Default

Can anybody please try to switch the display settings from 3d to 2d in HaPes new version? Navit runs fine until the next restart, where a black screen shows up. The only solution I found is to delete the whole directory ~/.app-storage/file_.media.cryptofs.apps.usr.palm.applications.org.webosinternals.navit_0/.

I'll further investigate this problem tonight.
shinebar is offline  
Old 05/03/2010, 05:35 AM   #235 (permalink)
Member
 
vreihen's Avatar
 
Join Date: Jul 2009
Posts: 501
Likes Received: 16
Thanks: 44
Thanked 102 Times in 63 Posts
Default

Quote:
Originally Posted by shinebar View Post
Can anybody please try to switch the display settings from 3d to 2d in HaPes new version? Navit runs fine until the next restart, where a black screen shows up.
I cannot recreate this problem on my Pre. When I restart Navit, it goes back to 3D mode. Did you mean restart the phone, or restart Navit?

Quote:
Originally Posted by mgmft View Post
thanks for your update. I uninstalled (using preware) and tried to install. But I can`t install the locale (de). An Error occurs:
I'm getting the same error with en_US. I did *not* uninstall the previous packages, though. I just tried to install the new ones over the old ones. Everything seems to work, though.

The bug where the announce (speaker) icon incorrectly displays as muted when you rotate the phone to landscape mode is still there. I took a quick look at the XML files, but didn't see where there was different template for landscape mode. I really like the new skin, though!!!!!
vreihen is offline  
Old 05/03/2010, 05:56 AM   #236 (permalink)
Member
 
vreihen's Avatar
 
Join Date: Jul 2009
Posts: 501
Likes Received: 16
Thanks: 44
Thanked 102 Times in 63 Posts
Default

Quote:
Originally Posted by HaPe View Post
That was the idea that we was thinking to. Be welcomed to help if you have the time and interest to do it.
I've got the logic of a simple pair of scripts down now, and will try to slap it together today if I get a chance.....
vreihen is offline  
Old 05/03/2010, 07:39 AM   #237 (permalink)
Member
 
Join Date: Mar 2010
Posts: 165
Likes Received: 7
Thanks: 21
Thanked 21 Times in 15 Posts
Default

Quote:
Can anybody please try to switch the display settings from 3d to 2d in HaPes new version? Navit runs fine until the next restart, where a black screen shows up.
That is not the case for me. Except fpr the "locale" problem it works as it should for me.

BUT: Espeak uses english text and it gets pronounced "german" !!!
Probably due to the error I posted.
mgmft is offline  
Old 05/03/2010, 09:04 AM   #238 (permalink)
Member
 
Join Date: Oct 2009
Posts: 52
Likes Received: 0
Thanks: 27
Thanked 3 Times in 3 Posts
Default

Got that "Problem" too. I think it is kinda funny this german-english mixing
Holliefant is offline  
Old 05/03/2010, 11:03 AM   #239 (permalink)
Member
 
Join Date: Jan 2010
Location: Hamburg, Germany
Posts: 31
Likes Received: 0
Thanks: 8
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by vreihen View Post
I cannot recreate this problem on my Pre. When I restart Navit, it goes back to 3D mode. Did you mean restart the phone, or restart Navit?
Hmkay. As two of you weren't able to reproduce my issue, i uinstalled everything and reinstalled navit - works now for me too

BTW: where can i change the options for 3d / 2d maps in the configuration files? I'd like navit to start with 2d maps.
shinebar is offline  
Old 05/03/2010, 11:14 AM   #240 (permalink)
Member
 
vreihen's Avatar
 
Join Date: Jul 2009
Posts: 501
Likes Received: 16
Thanks: 44
Thanked 102 Times in 63 Posts
Default

Here's the two scripts that I just slapped together, with no warranty other than that they work for me.

/media/cryptofs/apps/usr/palm/applications/org.webosinternals.espeak/espeak :

Code:
#!/bin/sh

APP_DIR=/media/cryptofs/apps/usr/palm/applications/org.webosinternals.espeak
export LD_LIBRARY_PATH=$APP_DIR/lib:$LD_LIBRARY_PATH
export SETTINGS_DIR=/media/internal/.app-storage/file_.media.cryptofs.apps.usr.p
export QUEUE_DIR=${SETTINGS_DIR}/queue

#ESPEAK_SINK=pnavigation
#ESPEAK_VOICE=de

if [ ! -d $QUEUE_DIR ]
then
   mkdir $QUEUE_DIR
fi
echo "$1" > $QUEUE_DIR/`date +%s`.${$}.txt

running="`ps xaf | grep voice_reader | grep -v grep`"

if [ "~$running" == "~" ]
then
   ${APP_DIR}/voice_reader &
fi
/media/cryptofs/apps/usr/palm/applications/org.webosinternals.espeak/voice_reader :

Code:
#!/bin/sh

APP_DIR=/media/cryptofs/apps/usr/palm/applications/org.webosinternals.espeak
export LD_LIBRARY_PATH=$APP_DIR/lib:$LD_LIBRARY_PATH
export SETTINGS_DIR=/media/internal/.app-storage/file_.media.cryptofs.apps.usr.p
export QUEUE_DIR=${SETTINGS_DIR}/queue

#ESPEAK_SINK=pnavigation
#ESPEAK_VOICE=de

# Custom chime, at beginning of all batched announcements...
paplay -d ${ESPEAK_SINK:-pdefaultapp} /usr/palm/sounds/notification.wav

textfile="`ls -1 ${QUEUE_DIR} | head -1`"

while [ "~${textfile}" != "~" ]
do
   cat ${QUEUE_DIR}/${textfile} | $APP_DIR/bin/espeak --path $APP_DIR/share --st
   rm ${QUEUE_DIR}/${textfile}
   sleep 2
   textfile="`ls -1 ${QUEUE_DIR} | head -1`"
done
As you can see, I've modified the original espeak shell script to simply copy the text into a directory, and then launch a background reader script if one already isn't running.

The voice_reader script is that background task, and it is nothing more than a big loop that keeps reading text files from the queue (hopefully close to chronological order!) until there are none left. I put the 2 second delay in to keep the task hanging around for a few seconds, and also to space out the announcements when they are coming rapid-fire.

Note that I put in the notification.wav chime, which gets played at the beginning of every batch of speech. Feel free to comment it out if it drives you crazy, but I like it for debugging purposes since it only chimes when a new background voice task is spawned. Ultimately, I would like to let each person put their own chime.wav file in the maps folder on the USB drive, and only call it from the script if said file exists. Maybe in revision #2, when I find the "bing-bong" public address chime that I've been looking for in a .WAV file.....
vreihen is offline  
Closed Thread

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0