2014-04-22, 03:47
@@
(2014-04-22, 09:19)VIJO Wrote: Ill look into playing with the Pi myself at some point for the heck of it, It would be nice to be able to spend so little for a xbmc client. I really like how the windows version has turned out. So it would be a hard sell for me. Is it the purpose of the Http daemon and the wav server to offload the speech to another system or is it just for the purpose of using sapi voices?The HTTP daemon is for both reasons. Currently one of the things I am doing is creating a speech server that uses the same code as the addon to either serve wavs from a host machine (like eckythump's but cross platform and in python) or play speech directly on the host machine.
(2014-04-22, 09:19)VIJO Wrote: On a side note, I kinda figured out couple things that weren't reading. Weather doesn't read at all except on confluence skin it will read the date selected and nothing else, On Quartz nothing. (I have it disabled for now, If you make any changes to it let me know and ill turn it back on.) On some repos pretty much the "Unofficial ones", when there is an Update sometimes what I am told looks like a webpage inside the xbmc skin pops up to explain the changes, This window doesn't even register on confluenc, On quartz I have yet to get it. Escape seems to get me out of it and then it doesn't pop up again until the next update.Have you installed the keymap? Pressing F2 with the keymap installed will speak the non-focusable text on the window. At least for me, this works for weather in Confluence and Quartz and also for changelogs. This was added around about version 0.0.34 and I'd really like to hear where it is and isn't working well.
(2014-04-22, 09:19)VIJO Wrote: Do I understand that you are polling the JSON interface to provide what is read? If that is the case, Id wouldn't think it would be possible to read that. If I am wrong, Please slap some learnin on me.I don't use the JSON interface. I use infolabels because I can get more text that way. I can only get the text from focusable controls whether I use infolabels or JSON.
(2014-04-22, 09:19)VIJO Wrote: On an even more side note, I was wondering if there is any chance, Say with maybe 14 (Which I know is very long way off and still pretty much unplanned dev wise) that this functionally could be branched directly into the XBMC distro so that no one would need to worry about adding a repo to get it speaking. You know, someone install it, and on the first startup the just press F12, and voila, speech.Well, the addon will eventually get into the official repository when it's ready. That can be done at any time, not just for new XBMC versions. As for having it included so that we can just start it with F12, I'm not sure how likely that is. We might get that in OpenElec. I sent a message to sraue describing a method of making that work, but I haven't heard back from him again.
(2014-04-23, 03:07)VIJO Wrote: For what it is worth, This is in Gotham Beta 4 using Quartz A.T.M., I went back to sapi direct because used less memory and for some reason I was getting glitching. Glitching was definitely coming from NVDA and not anything to do with XBMC.
I went back and re-installed the keymap to be sure. F2 does read the weather and time on home screen. However under addons-Weather, All I get is "Weather" "Refresh", Nothing else reads even with F2. Also another example, is in Settings-Sys Info, Nothing reads except selction, I.E. Summary, Storage, etc... None of the actual extra Info reads even with F2. Also, little info windows don't read, Like when a plugin fails.
(2014-04-24, 05:41)eckythump Wrote: ruuk:Unfortunately this won't work. The cached wav only get's cleared when you create a new one with the same filename.
I have a couple of thoughts/ideas relating to the PlaySFX caching behaviour.
I'm wondering if it wouldn't be better to always try and create unique filenames, even when it does appear that playsfx has usecache. This would solve the repeating issue on OpenELEC 3.95.5 and presumably other xbmc installs out there that people may be hesitant to upgrade if they're otherwise working fine.
(2014-04-24, 05:41)eckythump Wrote: Another thought is that instead of using time.time() to get unique filenames, perhaps you could import hashlib and use hashlib.md5(text).hexdigest() instead. I think the CPU overhead for the hashing would be negligible, and for installs that cache, you'd get unique filenames only for every unique wav, thus allowing the playsfx cache to be reused for all the repeated stuff like "Window: foo" and "Parent Directory", etc.That's a smart idea except for the problem I just mentioned. What could be done is to use this principle to cache wavs on disk, so they would not have to be created again. I'm not sure this would give enough benefit for the effort though.
(2014-04-24, 05:41)eckythump Wrote: It's probably best if you try and witness this one first hand. Navigate to a file list that has several pages of items. Then press right once. Now you should be able to use up/down arrows to scroll entire pages instead of item-by-item. You'll notice that instead of just announcing the new position after scrolling, it announces it a couple of times for different positions i nthe scroll. On the pi, these announcements tend to overlap and be unintelligible. No idea if you get the same behaviour using page up/page down on a keyboard. I don't have those buttons on my remote control, so I can't test easily.I haven't tried it on the Pi, but I don't imagine there will be a lot we can do about it. It's almost certainly a side effect of the Pi's slowness. I'll check it out when I get a chance. I don't have my Pi permanently set up anywhere yet partially because I need another HDMI cable. I thought I had an extra around somewhere, bit I guess I didn't
(2014-04-24, 18:44)eckythump Wrote: Done a little more testing with 0.0.42 on OpenELEC 0.95.6..I would guess that has to do with memory usage. I might have to look at limiting the length of phrases, but if large words are causing problems, that may be harder to overcome. I imagine that different speech engines would cause this to different degrees depending on the bits/sample rate of the output. Of course, we only get eSpeak in openElec, but you can use others in RaspBMC for example.
The crashing specifically seems to occur with longer strings of text. It's happened with some shorter strings of text, but these were strings that when converted to speech still produced longer than average wav files (such as spelling out of acronyms).
(2014-04-24, 05:41)eckythump Wrote: I suspect .wav files over a certain size are making it crap out. I'm not seeing anything meaningful in the logfile, though. I'm quite confident that this is an OpenELEC/XBMC issue, not your addon. Aside from the crashes, though, the addon is working really well on 0.95.6 in terms of smoothness and being able to quickly navigate menus, etc.I think I saw this issue when I first set up my Pi. I have and SD card with RaspBMC and one with OpenElec, and I don't know which one was doing it, but when I switched to the other it didn't and I forgot to follow up. I'm sure both have the issue, just one perhaps had more free memory for whatever reason, so in my limited testing it didn't occur. I'll do some more testing on my Pi soon and see if I can add anything to what you've found.
Are you getting crashes with OpenELEC 0.95.6 on the raspberry pi?
(2014-04-24, 20:15)ruuk Wrote:I probably should've been a little clearer for that suggestion. I was thinking this might be worth doing for when PLAYSFX_HAS_USECACHE is False where we currently use time.time(). My thinking was that if you're on a system that's inevitably going to run out of memory because of the wav's being cached, using a hash will at least delay that a bit longer as it'll be able to make use of the cache occasionally for things it's said before.(2014-04-24, 05:41)eckythump Wrote: Another thought is that instead of using time.time() to get unique filenames, perhaps you could import hashlib and use hashlib.md5(text).hexdigest() instead. I think the CPU overhead for the hashing would be negligible, and for installs that cache, you'd get unique filenames only for every unique wav, thus allowing the playsfx cache to be reused for all the repeated stuff like "Window: foo" and "Parent Directory", etc.That's a smart idea except for the problem I just mentioned. What could be done is to use this principle to cache wavs on disk, so they would not have to be created again. I'm not sure this would give enough benefit for the effort though.
(2014-04-24, 20:15)ruuk Wrote:I don't think it is a memory issue, at least, not in the sense that it's running out. I have no issues at all on 0.95.5 with speech of any duration. It only seems to have started since the playsf usecache feature appeared in xbmc, and I suspect there's something weird going on there. Especially since it happens consistently on the same strings. I can go boot my pi now from being off, go System -> settings -> addons -> enabled addons -> services -> simple addon downloader somethingorother, and boom, it'll die, guaranteed, even though there's plenty of RAM left. I've also tested using non-tmpfs for writing the wavs and it happened then, too. I'll go and double check that right now...(2014-04-24, 18:44)eckythump Wrote: The crashing specifically seems to occur with longer strings of text. It's happened with some shorter strings of text, but these were strings that when converted to speech still produced longer than average wav files (such as spelling out of acronyms).I would guess that has to do with memory usage. I might have to look at limiting the length of phrases, but if large words are causing problems, that may be harder to overcome. I imagine that different speech engines would cause this to different degrees depending on the bits/sample rate of the output. Of course, we only get eSpeak in openElec, but you can use others in RaspBMC for example.
I wonder if saving wavs to a tmpfs exacerbates this as it also using memory to store the wav.
(2014-04-25, 04:48)eckythump Wrote: I probably should've been a little clearer for that suggestion. I was thinking this might be worth doing for when PLAYSFX_HAS_USECACHE is False where we currently use time.time(). My thinking was that if you're on a system that's inevitably going to run out of memory because of the wav's being cached, using a hash will at least delay that a bit longer as it'll be able to make use of the cache occasionally for things it's said before.I'll go ahead and add that in, it's an easy change
(2014-04-25, 04:48)eckythump Wrote: I don't think it is a memory issue, at least, not in the sense that it's running out. I have no issues at all on 0.95.5 with speech of any duration. It only seems to have started since the playsf usecache feature appeared in xbmc, and I suspect there's something weird going on there. Especially since it happens consistently on the same strings. I can go boot my pi now from being off, go System -> settings -> addons -> enabled addons -> services -> simple addon downloader somethingorother, and boom, it'll die, guaranteed, even though there's plenty of RAM left. I've also tested using non-tmpfs for writing the wavs and it happened then, too. I'll go and double check that right now...I guess we can wait and see if it goes away in the next version. If it's still there, I'll see if I can find any commits betwwen .5 and .6 that could possibly be affecting playSFX().
Yep, dies regardless of tmpfs or not.
Hopefully OpenELEC 3.95.7 will appear soon. I'll be very interested to see how it goes. I really do think the issue is in XBMC, not the addon and I'd hate to see you spending time looking for bugs that aren't in your code. If I have time later, I'll see about reporting this as an OpenELEC bug.