| View previous topic :: View next topic |
| Author |
Message |
pspvideo9
Joined: 15 Mar 2005 Posts: 19
|
Posted: Tue Jan 03, 2006 4:21 am Post subject: Delay when reading lots of data from IrDA Port |
|
|
This problem is still unsolved and we feel it warrants its own thread, instead of being buried in another.
Problem
When using an IR keyboard with the PSP and typing at a high wpm ratio, the letters do not appear on screen in real time, rather they only appear at a much slower rate. For example, say you type something in for 5 seconds, it may take up to 10 seconds before all the letters are printed on the screen.
Cause
There is some sort of internal buffering going on and sceIoRead is not returning data in near real time, even though the PSP is reading all the data correctly in real time.
This was confirmed by moving the PSP out of line of sight after the 5 seconds of typing was completed. Even with the PSP in a different room as the IR keyboard, every letter typed would eventually be displayed on the screen, but only several seconds after typing is complete.
Solution
Unknown. Any ideas? |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jan 03, 2006 4:52 am Post subject: |
|
|
| Have you tried looking at the code at all? |
|
| Back to top |
|
 |
pspvideo9
Joined: 15 Mar 2005 Posts: 19
|
Posted: Tue Jan 03, 2006 7:31 am Post subject: |
|
|
Of course we looked at the code, how else would we have got our ThinkOutside IR keyboard working on the PSP.
Even with the following simplified code, there is still some unknown delay in the PSP between reading large amounts of IR data and printing it to the screen.
| Code: |
int irdafd, len;
irdafd = sceIoOpen("irda0:", PSP_O_RDWR, 0);
while (1)
{
len = sceIoRead(irdafd, &data, 1);
if (len != 0) printf("%c", data);
}
sceIoClose(irdafd);
|
We are also not the only ones to see it, Dr. Vegetable, in his own seperate IR Keyboard driver implementation is also seeing this. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jan 03, 2006 7:59 am Post subject: |
|
|
Are you certain it isn't a slow printf implementation that's causing the delay in your example?
Does sceIoRead() block until all the data is read, or will it return partial reads? Would attempting to read a larger amount of data at once result in less of a delay?
Are there some functions that let you set the speed of the irda port?
Try putting a sleep() into your loop to give other threads a chance to run. Perhaps you're starving some part of code that does the actual parsing of irda data. |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Tue Jan 03, 2006 7:59 am Post subject: |
|
|
| Have you tried other open flags like PSP_O_NOWAIT? Just a guess. |
|
| Back to top |
|
 |
|