#47885 - 25/11/2001 20:32
EmpTriv
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
I have been hinting that I was working on a game for the Empeg and it is finally ready for an alpha release. I'm calling it EmpTriv and it is, as the name suggests, a Trivia game. Right now it's got about 20,000 multiple-choice questions from 34 categories. The categories fall into the general groupings of Arts, History, Geography, Sports, Science, Fan Trivia, and Miscellaneous.
Installation
EmpTriv requires Mark Lord's hijack kernel modifications, at least v60 or so. I'm running and testing with v73. As far as I know, EmpTriv is the first userland application to be released using Mark's hijack features.
There's no pretty installer. Installation consists of getting the tar.gz archive and extracting it to your favorite directory. The archive consists of the program and a questions/ subdirectory containing about 5 megabytes of questions in 20,000 files. This means extraction will take a little while. In the future I will explore a way of compressing the trivia question files or combining them into a smaller number of larger files, but for right now they're all in flat text. 20,000 files is likely to be more than the number of Inodes you have available on your root or /usr partitions, so installing to a subdirectory of one of your music partitions is a good idea. If you were smart enough to format your /usr partition with extra inodes (I wasn't) you can use that.
Once the files are in place, you need to run the binary at which point an "EmpTriv" item should appear in your userland menu. Selecting this menu option allows you to play EmpTriv. If the program does not find a questions/ subdirectory it will complain. You should be able to play EmpTriv while the player is running, and since the knob is the only button that is stolen, you should be able to control the player while it's running as well.
Playing the game
It's very simple. The knob does everyting. Left and right on the knob changes menu options, pressing the knob selects that menu item. Select "Play" from the main menu to play the game. You will be presented a trivia question. Tap the knob to display the answers, or to display the next page of the question if it's a long question. When the "ABCDE" letters show up, you can scroll to select one of the letters and that answer will be displayed. Selecting the "Question" option allows you to take a peek at the question again. In this mode, left and right on the knob scroll the question at the top of the screen until you press the knob again.
After you answer the question, you'll either be given a "Correct!" screen with your stats, or a "Wrong!" screen with the correct answer. Then you'll get a "next, done" menu at the bottom to either get another question or go back to the main menu. Each question has a difficulty rating which is based on how many people got the question right or wrong on the sites I got the questions from. You gain and lose points based on how difficult the question is rated.
That's it, really.
Options
The options menu allows you to change game types, pick categories, or select a difficulty level. Right now there are two game modes. In normal mode you just keep answering questions until you select "done." In survival mode, you can play until you get 10 questions wrong and then your score is reset.
The categories option gives you a vertical-scrolling list of categories. Pressing a knob over each category selects or de-selects that category. De-selected categores will not be used for getting questions. In this manner, you can remove categories which you don't like.
Limitations and Known bugs
- The graphics are rather sluggish as I've chronicled in other posts on this forum. Some of this could be inefficient coding on my part, but a lot of it has to do with the graphics library I'm using. Assembler graphics libraries would help this out a lot.
- Currently settings such as your selected categories and difficulty levels are not saved. Until I have a way to write to the disk, that will remain so. I am not going to hack MLord's kernel to give me more bits from flash, and we're running out of those anyway. SOMEONE with good low-level IO knowledge needs to develop a "storage API" for this kind of thing.
- There is almost NO error checking so if the program finds something it's not expecting, it might crap out. For instance, putting any files in the questions/ subdirectory other than the questions files will probably cause a crash
- Memory usage is around 600k. I'd like to get this down some.
- It'd be nice if the categories menu was "collapsable" so you don't have to scroll through 34 categories. I am thinking about combining some of these categories, especially the "miscellaneous" ones.
- I plan on adding IR remote support to a future release. Right now you need to use the knob.
Anyway I haven't even had time to write a README, much less formal documentation. This post serves as the only documentation I have for this release. If anyone tries this out, please let me know (here or via email) about your experiences, any bugs you find, and suggestions for future releases. Please don't bother with cosmetic problems at this point ("certain text scrolls too far off screen", etc.) because I really want to get the major bugs out at this point.
Right now the source code is extremely cluttered so I'm holding off on releasing the source until I can clean it up a lot. For now, I wanted to get it out there and get some suggestions and input on what I should do with it next. I hope to eventually release the source for all to play with.
Anyway, go grab it at http://www.personal.psu.edu/~amc156/emptriv.html
|
Top
|
|
|
|
#47886 - 25/11/2001 21:52
Re: EmpTriv
[Re: tonyc]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
You could modify it to use the song files already existent on the empeg and have a version of Name That Tune.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#47887 - 25/11/2001 22:23
Re: EmpTriv
[Re: wfaulk]
|
carpal tunnel
Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
|
Name that Tune is an excellent idea. Probably wise to hold that off until the problems with the current release are fixed and some people have actually tested it.
The description sounds good so far. I'm surprised I didn't come up with any trivia-suggestions when we were rattling off game ideas in another thread.
I really suggest getting some help from Mark when he gets back, he'll probably be able to sort out some of your disk i/o and settings problems at least.
I know next to everyone posting here is a tech-head, but please consider making a half-friendly installer. I've been around computers nearly all my life, but I don't have any lower-level *nix disk experience, nor even experience installing and setting up a *nix distribution. I don't think I'd have a problem at all getting the game installed (not at all deterred by any shell work), but I have no idea what an inode is right now. :)
Bruno
|
Top
|
|
|
|
#47888 - 25/11/2001 22:26
Re: EmpTriv
[Re: wfaulk]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Name That Tune has too many problems... First playing the actual songs is too easy, you'd have to do it with MIDI files. Then the problem is that even with two or three notes, choosing a song from a multiple-choice list is too easy. You'd have to have an easy way to type in the name of songs, and that doesn't exist unless the IR keyboard thing happens anytime soon.
|
Top
|
|
|
|
#47889 - 25/11/2001 22:30
Re: EmpTriv
[Re: hybrid8]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Yeah Mark gave me a lot of help in getting it this far. Of course as the first guinea pig with a user app, I also helped a bit on getting the hijack stuff tested and ready to go.
As for an installer, there are people working on it in this forum.
The inode talk was just to say that there are 20,000 tiny files for the trivia questions and the disks have a limitation in the number of files that can be on the disk (the inode count). That limit is set when it's formatted. Installing the game on the music partition gets around this problem because there are plenty of inodes on the music partition.
Really all you have to do to get this running is:
FTP or sz it to your Empeg
extract it into a directory underneath /drive0 or /drive1, and run it... like:
cd /drive1/local/emptriv
tar xzf /usr/local/emptriv-0.9alpha.tar.gz
./emptriv &
Then exit to the player, hold down the knob, and select "EmpTrivia" (should be "EmpTriv", that'll be FITNR. Yay! Bug #0001!)
|
Top
|
|
|
|
#47890 - 26/11/2001 09:54
Re: EmpTriv
[Re: tonyc]
|
enthusiast
Registered: 11/11/2000
Posts: 202
Loc: Boston, MA
|
Is it possible to add you own Q/A to the flat text file to extend the number of questions beyond 20,000? Or better yet, create new files of Q/A that will work with the program?
I find that I enjoy trivia games quite a bit but after an hour or so of continual playing, I start to get repeated questions. As a result, I also have a huge backlog of Q/A in my brian that I would love to dump into a trivia game. Just a thought, you might be able to link a question to an audio file so I could record an mp3 of me speaking the question. That way when it shows up on the screen, it could play the file and become an audio trivia game as well. Not sure of the best way to do this tho.
Greg
|
Top
|
|
|
|
#47891 - 26/11/2001 10:42
Re: EmpTriv
[Re: kazama]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
re: adding questions
You can definitely add your own questions. The text file layout is like this. The files are named XXX.nnnn.dat where XXX is a three-letter category identifer such as ACE for "Arts: Celebrities" or HWO for "History: World." nnnn is a 4-digit number. Number 0000 is a special file which contains the category's name and a 0 or a 1 to identify whether the category starts up as a selected category or not. Numbers 0001 through "whatever" are the questions for that category. So if you wanted to add questions, you just add more files with the correct filename. So if the Star Wars category has 324 questions in it, you add a file called FSW.0325.dat. The format of each question file is:
Question (String)
Difficulty (integer 1 to 100)
Correct Answer (integer 1 to 5)
Answer A (String)
Answer B (String)
Answer C (String)
Answer D (String)
Answer E (String)
Each question must currently have five multiple-choice answers.
If you do have a bunch of trivia questions you want to put in, by all means do so. If you wanted me to put them into the game I'd be happy to. Even if you just want to put them in a spreadsheet or even a flat text file I can easily turn them into the proper format and include them with EmpTriv.
re: repeated questions
Well with 20,000 questions, repeats should be rare in a single session. The only problem now is that the random number generator is seeded with the process ID of EmpTriv, and since there are very few processes running on the Empeg, the chances of a repeated random number seed (and thus a repeated sequence of the same questions between sessions) is too high. In the next release I will seed it with a combination of the PID and some data from the real-time clock.
I also plan on exploring a mechanism for avoiding repeats by tracking which questions you've been asked, but to make this useful, I need a way of saving state between sessions. That doesn't exist yet. A LOT of the features I want to put into this (high scores, multiple personal profiles for difficulty and category selections, etc.) need the ability to save state to disk, and we don't have an API for that yet.
re: audio questions
Well an audio file per question is interesting. Though I wouldn't want to be the one reading out 20,000 different questions. :) I think an alternate solution would be to get a rudimentary text-to-speech engine to read the question. There are public domain ones out there, I had one which worked on my old 286. The quality of the text-to-speech was passable, though not great. For words it doesn't know, I could always put in the phonetic version of the question.
In any event, I don't yet know how to play a sound while the player is playing. If it's as easy as writing raw PCM sound to /dev/mixer then I should be able to figure it out. Audio questions is something I'll keep in mind. Along the lines of the Name That Tune discussion above, it'd be neat for the music categories to say "This song was the #1 hit from 1962" or something, along the lines of the "Audio Daily Double" in Jeopardy.
Good suggestions, keep 'em comin guys.. Has anyone actually installed and played with this yet? Or does the lack of an easy installer scare everyone off?
|
Top
|
|
|
|
#47892 - 26/11/2001 17:05
Re: EmpTriv
[Re: tonyc]
|
member
Registered: 13/08/1999
Posts: 116
|
re: audio questions
I have the win32 game "You don't know Jack" .
Maybe its possible to rip the audio-files and questions from there !?
(of course it is'nt free then - but this would be cool)
bobo
|
Top
|
|
|
|
#47893 - 26/11/2001 18:01
Re: EmpTriv
[Re: hybrid8]
|
Pooh-Bah
Registered: 09/09/1999
Posts: 1721
Loc: San Jose, CA
|
The radio stations around here play 1 second of music from a randomly chosen point in the song and ask the callers to name that tune. It is not easy!
Calvin
|
Top
|
|
|
|
#47894 - 26/11/2001 18:17
Re: EmpTriv
[Re: bobo]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Yeah YDKJ would be pretty sweet if it were public domain. Sigh. I've broken a few copyrights in my younger days but ripping stuff from commerical software and redistributing it here is definitely a PCM (poor career move.) Guess we'll have to scrap that idea.
|
Top
|
|
|
|
#47895 - 26/11/2001 18:20
Re: EmpTriv
[Re: eternalsun]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Hmmm yeah depending on the second that's chosen. ANYONE can identify the opening three chords to "Start Me Up" by the Stones.
A station here in Philly does the same thing except they string together SEVEN clips from seven different songs, each less than a second long, and play them strung together.
But, dare I say, I think it'd be pretty easy to identify any song if it's multiple choice. It's a lot harder when you don't have five potential answers in front of you.
|
Top
|
|
|
|
#47896 - 26/11/2001 18:32
Re: EmpTriv
[Re: tonyc]
|
pooh-bah
Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
|
Has anyone actually installed and played with this yet?
Well, I would try it out but I can't get to the website :-(
I keep getting unable to connect errors. Sounds cool though.
-Mike
|
Top
|
|
|
|
#47897 - 26/11/2001 19:28
Re: EmpTriv
[Re: mcomb]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Can't connect?!? It works fine for me. Maybe there is a HTTP forward or something bothering your browser.
Try this link
|
Top
|
|
|
|
#47898 - 26/11/2001 19:32
Re: EmpTriv
[Re: tonyc]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Congratulations, Mr Pasola, you've just won $5000.
Attachments
46737-contest.mp3 (52 downloads)
_________________________
Bitt Faulk
|
Top
|
|
|
|
#47899 - 26/11/2001 20:09
Re: EmpTriv
[Re: tonyc]
|
member
Registered: 13/08/1999
Posts: 116
|
I think there is nor problem with ripping the data for personal use (if you own a copy).
I think projects like freecraft and freecnc (linux game like warcraft and c&c) are also using the graphics and sounds from the original ones (of course these parts are not in the distribution)
|
Top
|
|
|
|
#47900 - 26/11/2001 20:14
Re: EmpTriv
[Re: tonyc]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
Some questions:
1) Approx how long should I expect it to take to extract the files on the player.
2) Is a subdirectory of "empeg/var" an appropriate place to extract it?
3) If I decide to remove it, will it be fairly easy to simply prune the directory?
4) If I install a software upgrade, followed by Mlord's kernel for that upgrade, will it automatically reappear in my userland menu? I don't know where the userland menus are stored. Did he put those in config.ini?
|
Top
|
|
|
|
#47901 - 26/11/2001 20:21
Re: EmpTriv
[Re: tfabris]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
1. It took about 2 or 3 minutes for me. Don't use the -v option in tar because the serial output will slow things down.
2. I didn't use /empeg/var, though that is located on /drive0. I didn't use it because that's where "Important Things" like the database and config.ini live. I made "/drive1/opt/emptriv" and I would suggest something like that. /opt is the Unix standard root for user-installed software. My /drive0 is nearly full or I'd use that.
3. Yeah.
rm -rf /drive[01]/opt/emptriv/
I don't do any funny stuff like putting files in strange locations. Everything goes in the install directory.
4. The emptriv program has to actually be run in order to bind to the menus -- it's dynamic like that. So an upgrade won't affect it. This means if you want it to be available on bootup, you need a means to run it. I used Frank's custom init which calls /sbin/userinit (a shell script.) This shell script runs EmpTriv, among other things (inetd for FTP, displayserver, etc.)
I thought someone was working on a nice init which handles these things automagically. I believe it involved messing with .upgrade files and putting a filesystem on /dev/hda2 and chrooting to it. I don't remember how far this effort went. Presumably this would make installing and running EmpTriv easier. For now it needs to be done the old fashioned way, though.
|
Top
|
|
|
|
#47902 - 26/11/2001 20:57
Re: EmpTriv
[Re: tonyc]
|
enthusiast
Registered: 11/11/2000
Posts: 202
Loc: Boston, MA
|
Good suggestions, keep 'em comin guys.. Has anyone actually installed
and played with this yet? Or does the lack of an easy installer scare
everyone off?
Well I just got done putting it on system and here is my expereince so far. Not too bad. . .
Install
I had some problems finding space on the system to put the files. After you posted to Tony's questions, I put it on one of the drives and didn't have any problems with the rest of the install. Hopefully using one of the installers or an install script like Franks does may help.
First Run
The first time I ran it, it showed up in the menu fine. I did get an error on the command line like 'rc something something' but just ignored it. But when I went to run the software from the hijack menu, the system started cycling all the fids through the output screen. I pulled the power and started all over again.
Second Run
No error messages and it seemed to slide into the background without problem. Came up in the menu fine and was able to play. BTW, I will be able to fill up the Simpsons Topic really quick.
Quirky things
- The font is really small for good reason but it makes reading the questions kinda difficult. Maybe an option for larger font would help
- The selecting topics screen needs an easier way to get out of it instead of scrolling to the bottom of th list and selecting back. (Options:Categories)
- If you set the game to Survivor, after 3 questions, the whole system freezes.
- Scoring seems a little odd. 1 point for a right answer but -2 for a wrong answer that goes up exponetially? Is that how it is supposed to work?
- Wait time between questions seems long. Never really sure if the system is thinking or just crapping out. Maybe a "Waiting" Message to the screen would help alleviate the wait.
All in all, it's a great effort!!! Minimal bugs but still seems like some work to be done.
Greg
|
Top
|
|
|
|
#47903 - 26/11/2001 21:48
Re: EmpTriv
[Re: kazama]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Cool, constructive feedback!
Okiedoke. Yeah, it needs a nice install..
If you got an "rc something" it means that one of the hooks into the Mlord kernel didn't return the correct status. The menu item was in the menu but the process had exitted, hence the yucky-looking crash. No idea why that happened to you.
Yeah the Simpsons topic is cool. :) I'd like to find more Simpsons trivia to add to it.
The font is an EXACT replica of the Empeg player's smallest font used in Now and Next, Track Details, etc. So if you don't like that font, then you don't like mine. It's small, but anything larger would involve a TON of scrolling. The next smallest font is, well, like the larger player font, or Mlord's kernel font. Because it's a trivia game, a small font is necessary. Or I think so. I will think about adding a larger font option but that would involve a lot of re-working of my routines for word-wrapping, etc.
The categories screen does need work. I agree the "back" option at the bottom is lame. I will come up with something better.
Survival mode works fine for me! I've tried it many times. I'm not sure why it would be crashing after three tries for you. Is this repeatable?
My scoring algorithm is as follows. If you answer a question right, you get a # of points equal to that question's difficulty. If you answer it wrong, you get ( (100 - difficulty) / 5 ) deducted. I don't know why you would be seeing the scoring like you are unless the first question you answered was difficulty 1 (unlikely) and the second one was dificulty 10.
Yes, the wait between questions is a bit long. It's going to the filesystem to load the question. If the question doesn't match the difficulty range you've chosen, it goes for another question (ad infinitum). If you make your difficulty range very narrow (like 20 - 40 or 80 - 100) it might take a long time to find a question with that difficulty. Some creativity in how I load the categories could possibly make this less painful. I'll investigate that.
Thanks again for the suggestions (and the praise.)
|
Top
|
|
|
|
#47904 - 26/11/2001 22:06
Re: EmpTriv
[Re: tonyc]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
I'd like to find more Simpsons trivia to add to it The Simpsons Quiz at snpp.com
_________________________
Bitt Faulk
|
Top
|
|
|
|
#47905 - 26/11/2001 22:27
Re: EmpTriv
[Re: tonyc]
|
pooh-bah
Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
|
OK, the original link is working for me now. Somebody must have rebooted the internet.
-Mike
|
Top
|
|
|
|
#47906 - 26/11/2001 23:04
Re: EmpTriv
[Re: wfaulk]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Hmmm cool. Though typing out 1000 "wrong answers" is going to be a bit of a task.
Cool I just found a better one which is multiple choice (and remarkably easy to leech the answers from.) Only 3 answers per question so I'll have to either add my own false answers or change my code to allow for less than 5 answers. Hmmm.. Then there's the chore of assigning difficulty ratings. D'oh!
|
Top
|
|
|
|
#47907 - 27/11/2001 02:14
Re: EmpTriv
[Re: tonyc]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
This means if you want it to be available on bootup, you need a means to run it. I used Frank's custom init
Darn. I was hoping that the new userland menu would have the ability to survive after an upgrade by having its parameters stored in config.ini.
Why is it so tough to put something like this in config.ini and have it work?:
[Userland_Menu]
ItemName1="Trivia Game"
CommandLine1=/drive0/opt/emptriv/emptriv
ItemName2="Tetris"
CommandLine2=/drive0/var/emptris/emptris
Then we wouldn't need custom inits to launch apps with.
|
Top
|
|
|
|
#47908 - 27/11/2001 05:59
Re: EmpTriv
[Re: tfabris]
|
old hand
Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
|
Hi Tony.
It is so tough because launching programs from kernel land is a really messy thing to do. That is probably why Mark didn't do that in the first place. Now if the empeg software would look for a "userinit=" string or simply for a /drive[01]/userinit script and launch that, that would be a cleaner approach. But the /dev/hda2 image by Kim Covil is really advancing well. But I won't do any estimates when it will be ready for public release. That is his part. Well, actually, the current version is available for public download AFAIK, it just isn't really ready yet.
cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord
|
Top
|
|
|
|
#47909 - 27/11/2001 10:00
Re: EmpTriv
[Re: smu]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
launching programs from kernel land is a really messy thing to do.
Even if the programs are well-behaved and designed to be run that way?
|
Top
|
|
|
|
#47910 - 27/11/2001 10:56
Re: EmpTriv
[Re: tfabris]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Unix kernels have been designed to launch one and only one program since day one. It launches init (or, if that fails for some reason, sh). The reason that kernels shouldn't launch other programs is that it's difficult to synchronize those programs with userland occurrences. For instance, if you had to wait for /usr to be mounted, you'd have to put in some lousy hack to make sure it was mounted in the kernel. If you do it from userland, then you just make sure that the script that runs that program is run after the script that mounts /usr. Easy.
That isn't to say that it can't be done. Just that it's remarkably messy.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#47911 - 27/11/2001 12:35
Re: EmpTriv
[Re: tfabris]
|
member
Registered: 11/09/2000
Posts: 143
Loc: Jylland, Denmark
|
In reply to:
Even if the programs are well-behaved and designed to be run that way?
Now there's a generalization if I ever saw one. So it isn't supposed to launch anything beta-ish, but the rest is OK?
Might help if you try asking reaaaaally nicely (pretty, pretty please with sugar on top).
:-)
_________________________
Lars
MkII 40gig 090000598
|
Top
|
|
|
|
#47912 - 27/11/2001 12:52
Re: EmpTriv
[Re: tonyc]
|
Pooh-Bah
Registered: 09/09/1999
Posts: 1721
Loc: San Jose, CA
|
What if you have a vast collection of classical music? ;-D
Calvin
|
Top
|
|
|
|
#47913 - 27/11/2001 16:49
Re: EmpTriv
[Re: kazama]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Regarding audio files.. I did some playing with text-to-speech programs last night and found an easy way to generate a reasonably small audio file for each question. I'm attaching an example here. It's a 10k MP3 file. So if I could find an easy lightweight way to play these and mix them with player output, we could have audio questions. However, 20,000 questions * 10k = 200 megs. Not sure anyone would want to download that much.
Attachments
46863-ttsdemo.mp3 (46 downloads)
|
Top
|
|
|
|
#47914 - 27/11/2001 16:52
Re: EmpTriv
[Re: tonyc]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
I did some playing with text-to-speech programs last night and found an easy way to generate a reasonably small audio file for each question. (...) However, 20,000 questions * 10k = 200 megs. Not sure anyone would want to download that much.
And this software can't compile under ARM Linux and run in real-time on each question?
|
Top
|
|
|
|
#47915 - 27/11/2001 16:52
Re: EmpTriv
[Re: smu]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Yeah... The Empeg isn't quite ready for primetime as an easily-extensible computing platform. Mlord's kernel was a huge step. The alternate root partition is another biggie. It will let us keep user programs intact between software upgrades, and as I understand it, will provide the user space portion of the seamless launch procedure we're looking for where you just add programs to config.ini. Mlord has done most of what needs to be done in terms of allowing for text from config.ini to be available to the user apps. I'm sure there's other work to be done there.
If people are looking for constructive things to do, I think that the following efforts can go on in parallel with these efforts. Some of these suggestions might already be in the works, if so, please let us know how you're doing!
- an efficient graphics API
possibly written in ARM assembly
- a "storage API"
take smallish chunks of data and save it to / load it from raw sectors on an unused partition such as hda2 or hda6
- a sound API
take PCM data and mix it in with the player output (it appears Kim has a good start on this)
maybe even a routine to mix in an MP3 file (a nice bell/whistle feature)
- a nice installer package for user programs
along the lines of Frank's but one which circumvents Emplode and transfers the package directly
|
Top
|
|
|
|
#47916 - 27/11/2001 17:01
Re: EmpTriv
[Re: tfabris]
|
member
Registered: 13/08/1999
Posts: 116
|
I had this one running with ARM linux on my ipaq:
http://www.speech.cs.cmu.edu/flite/
bobo
|
Top
|
|
|
|
#47917 - 27/11/2001 17:03
Re: EmpTriv
[Re: tfabris]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Well... Here's the deal. There are basically two options for TTS on Linux. Rsynth and Festival. Rsynth is much lower quality and doesn't do as good of a job figuring out sentence structure or the proper sound for a given letter. Festival is what is used in the demo MP3. Festival unfortunately has a memory footprint of 10 megabytes. Even if we had the RAM I don't think we'd have the power to do real time text-to-speech. I did cross-compile Festival and the binary runs, butt immediately crashes on my Empeg.
Rsynth would be an option except that I can't get it to compile and run properly on my Empeg. I need to hack it up to write exactly 4608 bytes and I haven't had any luck with it. Anyone smarter than me who wants to give it a try is more than welcome to do so. If someone can get rsynth working then we have at least rudimentary TTS.
If it used Rsynth then I'd have to do a lot more manual fiddling with the questions (replacing some E's with the "schwa" phoneme, for instance) because rsynth isn't as intelligent about choosing the proper sound. Me parsing through 20,000 questions is not likely.
The authors of Festival have decreasing the memory footprint listed as one of their goals, but I'm not holding my breath.
|
Top
|
|
|
|
#47918 - 27/11/2001 17:04
Re: EmpTriv
[Re: bobo]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Ahhhh... I could NOT find that one in any of my searches. I was even looking at CMU's speech site! Thanks for the URL. Downloading now...
|
Top
|
|
|
|
#47919 - 27/11/2001 18:08
Re: EmpTriv
[Re: tonyc]
|
carpal tunnel
Registered: 08/07/1999
Posts: 5549
Loc: Ajijic, Mexico
|
20,000 questions * 10k = 200 megs. Not sure anyone would want to download that much.
That's only 1/3 of one percent of the capacity of a 60 GB empeg. I think there are a lot of people who would give up that much space! Or, another way of looking at it, it's about three CDs worth of space.
tanstaafl.
_________________________
"There Ain't No Such Thing As A Free Lunch"
|
Top
|
|
|
|
#47920 - 27/11/2001 18:16
Re: EmpTriv
[Re: bobo]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Okay this is another victim of the 4608 byte requirement on /dev/audio. Running Flite gives me this:
empeg:/usr/local/flite# ./flite "hello, world"
on-4608 byte write (256)
failed to write 128 samples
So I'm not great at all this low level IO stuff, but I found the #define for the audio buffer size was set to 128. So if 128 samples = 256 bytes (16-bit sound) I figured increasing the #define to 2304 (4608 / 2) would do the trick. Naaah. For some reason it only writes 1584 samples at a time, and I get this:
non-4608 byte write (3168)
I'm not smart enough to figure out the rest. So flite has the ability to output to a WAV file. I did that and copied the WAV file over to my PC and the quality of the voice synthesis definitely leaves little to be desired compared to the full version of Festival. I guess that's what makes it "Festival Lite." For instance in the example I posted, it says the verb form of "contest" instead of the noun form (accent is on the second syllable when it should be on the first.) The real Festival handles it without problems.
So if we want anything good sounding, we need to use sound files rather than realtime synthesis. At least for now...
|
Top
|
|
|
|
#47921 - 27/11/2001 18:18
Re: EmpTriv
[Re: tanstaafl.]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Sure I realize that. I've got a 40GB Empeg so it's no big deal. But downloading that 200 megs is a little onerous... I dunno. That example question isn't necessarily the longest question in the database either, I'm not sure what the mean is, but the average question could end up being 15 or 20k instead of 10k. Then if you wanted it to say the answers aloud, that'd be even more.
Then there's the fact that I don't know how to play an MP3 file from my software, much less mix it in with the Empeg's output...
But it's something to think about. A neat feature, certainly not what I'm going to focus on, though.
|
Top
|
|
|
|
#47922 - 28/11/2001 12:25
Re: EmpTriv
[Re: tonyc]
|
Pooh-Bah
Registered: 09/09/1999
Posts: 1721
Loc: San Jose, CA
|
I have some mp3s that are 200 megs.
Calvin
|
Top
|
|
|
|
#47923 - 28/11/2001 13:14
Re: EmpTriv
[Re: eternalsun]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Yah. 200 megs isn't that bad, which is why I am considering the pre-recorded soundfile route for this after seeing that realtime text-to-speech directly on the Empeg might be somewhat far off. I am going to experiment some more with Flite and at least try to get it correctly outputting sound to the audio device before I totally give up, though.
|
Top
|
|
|
|
#47924 - 03/01/2002 20:37
Re: EmpTriv
[Re: tonyc]
|
journeyman
Registered: 30/07/2001
Posts: 63
|
Im trying to install emptriv and having problems. I have uploaded the file to my empeg and extracted it to /drive1/emptriv
It seems to have all extracted ok with a questions directory, but when i execute emptriv it doesnt do anything. I have tried leaving it for a few minutes and breaking out of it, but then nothing appears in the hijack menu.
Any help appreciated.
_________________________
RioCar 40GB RGB - can never decide
|
Top
|
|
|
|
#47925 - 03/01/2002 20:51
Re: EmpTriv
[Re: andygjones]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Are you running it in the background? You can't break out of it and still have it bound to the menu (the process ends!)
You need to type emptriv& to run it as a background task. Then fire up the player (exit back to the shell-player loop will also work.)
It should then appear in your menu.
|
Top
|
|
|
|
|
|