forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delay when reading lots of data from IrDA Port

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
pspvideo9



Joined: 15 Mar 2005
Posts: 19

PostPosted: Tue Jan 03, 2006 4:21 am    Post subject: Delay when reading lots of data from IrDA Port Reply with quote

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
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Tue Jan 03, 2006 4:52 am    Post subject: Reply with quote

Have you tried looking at the code at all?
Back to top
View user's profile Send private message Visit poster's website
pspvideo9



Joined: 15 Mar 2005
Posts: 19

PostPosted: Tue Jan 03, 2006 7:31 am    Post subject: Reply with quote

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
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Tue Jan 03, 2006 7:59 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Jan 03, 2006 7:59 am    Post subject: Reply with quote

Have you tried other open flags like PSP_O_NOWAIT? Just a guess.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group