Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
squirreltown
Roku Guru

texmgr requests

I am requesting 10 images with the texturemanager. the ID's are stored and then compared with the downloads to assign the right name for the bitmap.
What I'm getting back though is only 5 of the 10, something like 1, 2, 3, 4, 10 or 1, 3, 4, 2, 10 or 3, 1, 2, 4, 10. Always get the first and last request but never anything between 5-9.
What Am I missing?
Thanks

for i = 0 to 9
requestinfo = CreateObject("roAssociativeArray")
requestpic = CreateObject("roTextureRequest" , "http://www.xxxx.com/roku/screensaverlite/"+motionlist[i].GetName())
m.texmgr.RequestTexture(requestpic)
requestinfo.name = motionlist[i].GetName()
requestinfo.ID = requestpic.GetID()
request.Push(requestinfo)
end for
while true
msg= m.texport.getmessage()
if type(msg)="roTextureRequestEvent" then
if msg.GetState() = 3
for x = 0 to 9
if request[x].ID = msg.GetID()
m.motionbit[x] = msg.GetBitmap()
total = total+1
exit for
end if
end for
end if
end if
if total = 9
exit while
end if
end while
Kinetics Screensavers
0 Kudos
26 REPLIES 26
TheEndless
Channel Surfer

Re: texmgr requests

You're not checking for any state other than 3. My guess would be that there's a problem with images 5-9 that's preventing them from loading (bad URLs?) and resulting in a state other than 3.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: texmgr requests

Thanks Endless, but I'm positive the URLS are good, they all load fine if I use URLTransfer and its not the same group every time.
If I leave out the "if msg.GetState = " the for/each loop cycles through all 10 ID's, like for instance - 6, 5, 3, 7, 8, 9, 1, 2, 4, 10 but still only 5 images download.
Is there a limit to the number of messages the port can cue?, because these are coming in really fast, less than 2 seconds.
Kinetics Screensavers
0 Kudos
NewManLiving
Visitor

Re: texmgr requests

What is the size of the bitmaps
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
squirreltown
Roku Guru

Re: texmgr requests

NML - varys, most are around 600 x 300, 500 x 500 is the biggest, bit-wise.
Kinetics Screensavers
0 Kudos
NewManLiving
Visitor

Re: texmgr requests

Can't really look at your code right now
At work. Try loading 1then 2 etc and check
Your memory Even the tmanager has it's limits
Esp if you are holding the bitmap. Also make sure
You have a valid bitmap.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
squirreltown
Roku Guru

Re: texmgr requests

Well it would be great to know what the Texmanagers limits are, never heard of that but overall bitmap memory is 24mb free with all loaded. It works just fine with any number of slow ways - URLTransfer or one at a time with the TexManager. The problem is requesting all 10 at once and the port or the code is not handling what comes back.
Kinetics Screensavers
0 Kudos
NewManLiving
Visitor

Re: texmgr requests

Yes but URL transfer writes everything to disk
But if you can load all 10 bitmaps from
Disk into memory then it's not a memory problem
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
TheEndless
Channel Surfer

Re: texmgr requests

"squirreltown" wrote:
Thanks Endless, but I'm positive the URLS are good, they all load fine if I use URLTransfer and its not the same group every time.
If I leave out the "if msg.GetState = " the for/each loop cycles through all 10 ID's, like for instance - 6, 5, 3, 7, 8, 9, 1, 2, 4, 10 but still only 5 images download.
Is there a limit to the number of messages the port can cue?, because these are coming in really fast, less than 2 seconds.

What's the GetState() of the ones that fail to load?

On a potentially related note, your code is checking for a total of 9, but you're trying to load 10 images.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: texmgr requests

"TheEndless" wrote:

What's the GetState() of the ones that fail to load?

You know, I'm not checking that. Tell me if I'm wrong but I'm not aware of how that might help me. I know the files/urls are good because they've been working for months. If I take that same while loop above and stick it inside the for/each loop everything downloads, but of course it loses any speed advantage since it's basically blocking while waiting for each file. I'm just trying to get a process thats taking about 8-9 seconds to take maybe half of that. If it were a memory problem with the tex manager itself i would expect it to download the first 5 files not the first 4 and the last one. Actually, no matter if I check anything or not or try to assign a variable to the returned bitmap or not, The loop requests 10 files and 5 come back, according to r2d2_bitmaps. It smells like a timing issue to me but I have no clue what to do about it. I tried slowing the requests with a sleep in between but that didn't help, and tried wait(0 and wait(20 on the return - no difference.

"TheEndless" wrote:
On a potentially related note, your code is checking for a total of 9, but you're trying to load 10 images.

Thanks for pointing that out, that starting with zero thing gets me sometimes, but in this case not an issue yet as the total never gets above 5.
Kinetics Screensavers
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.