|
I have seen RequestImage() stall when downloading not only Mapblock images. I have enabled displaying count of bytes received in the callback and could see that the download stops at the same spot for several attempts (not the same number for different images). It would sometime take 5-6 attempts, but RequestImage() would complete eventually.
In working through another semi-related issue I gained a few clues which I'm going to work through. None of which actually helped solve the problem, RequestImages() which I was hoping was a differen't packet actually just queues up packets in a list so that didn't help.
I think what will fix this is a rewrite of the way image requests are done since mapimages appear to be requested in chunks and re-assembled in the viewer (which is why you get a blurry image at first, then as the other chunks come in it gets clear). This is going to take an overhaul of how we request images, and track received chunks back.
You'll notice it does the same image request with different priorities and different discard levels
In my testing, it seems that the priority is simply the priority that it wants them in and the discard level seems to be... -1 : Someone mentioned that this is a 'cancel request', however after further evaluation this might actually be 'download the JPEG2000 header so we can figure out how many discard levels the image has'. 6-0 : Discard levels from highest discard to full quality. <conjecture from testing> The client tends to send request discard levels in the following order, however the second and third discard varies but is always in descending order. -1( header? ) When a client requests a 2 discard level, the simulator sends up to and including that discard level but not (1 or 0). Then when a client requests discard level 1, the simulator only sends the 1 discard level frame because the client already received 6-2. I think the fact that when a client sends any discard level, opensimulator sends the full quality version, it works and displays properly in the client is proof that the method is something along those lines(Server sending requested frames in byte offsets). In the client, you'll see it tile in at lower qualities first, as the image is downloading. Once it's downloaded it displays the full quality version. If you didn't want to tweak the use of OpenJPEG, you can probably simply keep the received image bytes in a variable and the last requested discard level. Request images at multiple discard levels then when the image request is done downloading and the discard level is 0, you can fire the 'got image' delegate. If you wanted to tweak the use of OpenJPEG, then you're probably looking at playing with the values of; opj_dparameters_t These get set to 0(not used) in opj_set_default_decoder_parameters(&dparameters) line 213 of libsl.cpp Got some additional information today off the sldev mailing list from robin Cornelius:
Robin Cornelius t Hi Everyone, Can someone confirm exactly how the "RequestImage" message works:- >From the discussions on #sldev open the openjpeg issues, it appears If the viewer is hacked so it knows not to try to run a decode when There are some additional observations here:- The production viewer Secondly KDU we know behaves differently to OpenJPEG, BUT it appears I'm not quite sure what happens in the kdu decode (thats why i said i Regards Robin Additional Packet Log:
<-- 8.2.32.111:12035 10062 [Ack Rel ] --> 8.2.32.111:12035 6028 [ Rel ] <-- 8.2.32.111:12035 11046 [ Rel ] <-- 8.2.32.111:12035 11047 [ Rel ] <-- 8.2.32.111:12035 11048 [ Rel ] <-- 8.2.32.111:12035 11053 [ Rel ] <-- 8.2.32.111:12035 11054 [ Rel ] <-- 8.2.32.111:12035 11055 [ Rel ] <-- 8.2.32.111:12035 11056 [ Rel ] <-- 8.2.32.111:12035 11057 [ Rel ] <-- 8.2.32.111:12035 11058 [ Rel ] – RequestImage – <-- 8.2.32.111:12035 11059 [ Rel ] <-- 8.2.32.111:12035 11060 [ Rel ] <-- 8.2.32.111:12035 11061 [ Rel ] <-- 8.2.32.111:12035 11062 [ Rel ] <-- 8.2.32.111:12035 11063 [ Rel ] <-- 8.2.32.111:12035 11064 [ Rel ] <-- 8.2.32.111:12035 11065 [ Rel ] <-- 8.2.32.111:12035 11066 [ Rel ] <-- 8.2.32.111:12035 11067 [ Rel ] <-- 8.2.32.111:12035 11068 [ Rel ] <-- 8.2.32.111:12035 11069 [ Rel ] <-- 8.2.32.111:12035 11074 [ Rel ] <-- 8.2.32.111:12035 11076 [ Rel ] <-- 8.2.32.111:12035 11078 [ Rel ] <-- 8.2.32.111:12035 11083 [ Rel ] --> 8.2.32.111:12035 6083 [ Rel ] <-- 8.2.32.111:12035 11179 [ Rel ] --> 8.2.32.111:12035 6528 [ Rel ] <-- 8.2.32.111:12035 12665 [ Rel ] <-- 8.2.32.111:12035 12666 [ Rel ] <-- 8.2.32.111:12035 12667 [ Rel ] <-- 8.2.32.111:12035 12668 [ Rel ] <-- 8.2.32.111:12035 12669 [ Rel ] <-- 8.2.32.111:12035 12670 [ Rel ] <-- 8.2.32.111:12035 12671 [ Rel ] --> 8.2.32.111:12035 6554 [ Rel ] <-- 8.2.32.111:12035 12694 [ Rel ] – RequestImage – <-- 8.2.32.111:12035 13121 [ Rel ] <-- 8.2.32.111:12035 13123 [ Rel ] <-- 8.2.32.111:12035 13124 [ Rel ] <-- 8.2.32.111:12035 13126 [ Rel ] <-- 8.2.32.111:12035 13129 [ Rel ] <-- 8.2.32.111:12035 13130 [ Rel ] <-- 8.2.32.111:12035 13131 [ Rel ] <-- 8.2.32.111:12035 13132 [ Rel ] <-- 8.2.32.111:12035 13140 [ Rel ] <-- 8.2.32.111:12035 13141 [ Rel ] <-- 8.2.32.111:12035 13142 [ Rel ] <-- 8.2.32.111:12035 13143 [ Rel ] <-- 8.2.32.111:12035 13144 [ Rel ] <-- 8.2.32.111:12035 13145 [ Rel ] <-- 8.2.32.111:12035 13146 [ Rel ] <-- 8.2.32.111:12035 13147 [ Rel ] <-- 8.2.32.111:12035 13148 [ Rel ] <-- 8.2.32.111:12035 13149 [ Rel ] <-- 8.2.32.111:12035 13150 [ Rel ] <-- 8.2.32.111:12035 11070 [ Res Rel ] <-- 8.2.32.111:12035 11071 [ Res Rel ] <-- 8.2.32.111:12035 11072 [ Res Rel ] <-- 8.2.32.111:12035 11073 [ Res Rel ] <-- 8.2.32.111:12035 11075 [ Res Rel ] <-- 8.2.32.111:12035 11077 [ Res Rel ] <-- 8.2.32.111:12035 11079 [ Res Rel ] <-- 8.2.32.111:12035 11080 [ Res Rel ] <-- 8.2.32.111:12035 11081 [ Res Rel ] <-- 8.2.32.111:12035 11082 [ Res Rel ] <-- 8.2.32.111:12035 13125 [ Res Rel ] <-- 8.2.32.111:12035 13127 [ Res Rel ] <-- 8.2.32.111:12035 13128 [ Res Rel ] <-- 8.2.32.111:12035 13151 [ Res Rel ] John,
after re-reading Robin's comments I grabbed off the sldev mailing list, it appears the fix we did tonight is actually pretty close to how the viewer works, at least timing wise, although it takes far less than 20 minutes for us to get. We could possibly add a turbo mode timer to make it faster, but I'm satisfied that what we've got working is at least as good as the viewer less the ability to display the image with less resolution mid-download. I am guessing the simulator is throttling the speed of the packets which is silly, but I can understand it being that way considering in the viewer you could be viewing up to several hundred map images at a time (downloading them). Thanks for looking into this issue with me, glad to have this one behind us! Jim We've comitted fix to trunk that allows map images to download, basically after the initial 30 or so packets when the download usually stalls, our refresh timer is now set to continue to request blocks 1 at a time until the entire image is downloaded. This could of course take a significant amount of time if you are requesting a large number of images, So be patient!
|
|||||||||||||||||||||||||||||||||||||||||||||
It appears the viewer makes a couple separate requests for each image with different parameters.