Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: List building on initialization, intermittent working

  1. #1
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    315

    List building on initialization, intermittent working

    Well, it's been a while since I've posted here and I think now with all the holiday stuff behind me, I'm starting to pick up on the droid theme skin again .

    Now, I know I'm using an outdated build, but thought I would go back through all the code I currently have so I am refreshed. I think I was programming the skin against rev 652. So, the next thing I am doing this coming week will be to update all the projects to the current rev available. But I'm still gonna post some findings in case someone might know a reasoning what is happening. I don't believe it's a revision problem, but I will still update when I find the build farm link again and some time.

    Note - Everything works using the default skin...

    The first problem I encountered is the plugin list inside the settings. I have just copied all the settings code, plus the additional classes it uses, to a new project. All properties of builds/debugs/framework have been set. I built it against the 652 references and it built just fine and into the android skin folder. I have then set a button on my main menu to the settings plugin. Clicking into the settings plugin works just fine, and everything inside the settings lists populates and is interact-able. Except for the Plugin Settings option. It doesn't build the list of plugins for the settings, it just sits at the "Loading..." text.

    So, I set a debug point on the point under host_systemevent on the line to initiate the thread to load the plugins, started the debugging for OM again, and the point never hit. Left if sitting for 5 minutes and still nothing. So after many attempts with no debug point, the plugin list build once and I was able to finally set my music path. Kept trying though, and figured it might build the plugin settings list once out of like 10+ times. Weird? Since if I switch to the default skin it would work just fine (If and only if OM was started fresh. Switching from my broken plugin settings list to the default skin caused the default list not to be built either.)

    The 2nd problem is sort of the same issue. The indexing for the music must have an issue somewhere for my skin as well... The code to build the artists is exactly the same as from the original newMedia plugin. However, I have seemed to find out that if I break the code and debug it on the point it loads the artists into a list, it will work. If I don't, the artists list might be built once out of so many tries as well, just like the plugin settings. Since the artists list normally isn't built, I can't see artists/albums/tracks in my music plugin. But, if the list does build, I can see the artists/albums/tracks and fully interact and play songs...

    My debug log doesn't throw any errors/exceptions either. Well, I'll keep trying different things and see if I can't come up with something, or if updating this week to current rev's will fix it.

    Glad to finally be back at the coding!!!
    Current Worklog: TBA - '05 Rav4 (Mobo Dead).
    www.rav4world.com - Forums for Rav4 owners
    www.flavorfeasts.com - Cooking website/forums
    -Basic forums live atm, come contribute!

  2. #2
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    315
    Well, I decided to test how long it might take to hit some of the points. Specifically for this first test I set the breakpoint on the next line in the settings plugin after the line "if(function==eFunction.pluginLoadingComplete).... " to correspond to when the plugin loading is complete. I let OM run, loading up with the android skin, and it took 11 minutes and some odd seconds to hit that line... I sure hope I can figure out a way to improve that speed. At least I know it's just something that needs to run longer than I am used to for the time being.

    I suspect the same thing for the indexing music problem, and I bet time will fix that as well.

    Just implemented a simple text line so I can at least see when the plugins loading are complete, so atm it's working but not optimal.

    EDIT: Just found something else, just not sure what thread/code might be causing it. I have noticed that if the plugins don't load within the first so many seconds (like 5ish) of OM starting, I will get the dreaded ContextSwitchDeadlock error. Now time to track this down:
    The CLR has been unable to transition from COM context 0xecc18 to COM context 0xecaa8 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
    Last edited by detlion1643; 01-16-2012 at 05:38 PM.
    Current Worklog: TBA - '05 Rav4 (Mobo Dead).
    www.rav4world.com - Forums for Rav4 owners
    www.flavorfeasts.com - Cooking website/forums
    -Basic forums live atm, come contribute!

  3. #3
    Newbie
    Join Date
    Sep 2005
    Posts
    37
    I'm pretty new to OM development, and I ran into a similar issue a few days ago. A thread was spinning in a while loop slowing the app to a crawl. I had to change Thread.Sleep(0) to Thread.Sleep(5) to give other OS threads some CPU time. FrontEnd\OpenMobile.Graphics\Platform\Windows\WinR awInput.cs:67

  4. #4
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    553
    Hey guys. Borte is on the road with his job. But he promised to try and get on here (perhaps later today) to offer up any advice.

    Cheers,
    John
    ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
    Win7 Ultimate - OpenMobile - Directed HD - Wifi
    OMMaps + MS GPS Puck - WiFi via LTE Android phone
    2 Zones - Matrix Orbital LCD - Arduino - Build Pics

  5. #5
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    315
    Seems like it wouldn't be right if we had to rebuild the graphics.dll for skins... too much hassle for other users I think anyways.

    I wonder about my gesture code on the ui level though... the first 2 gestures never run code but the 3rd+ always will. I forget what arguments are null in the first attempts, but after work ill debug and find out.

    EDIT: The lists are aggravating. I've went back to the defaults on ui, main menu, settings, and music. I then replaced, 1 at a time, each plugin with my own modified ones. Testing with only 1 modified plugin each time, the lists were still intermittent in the building and executing. Deleted all the extra debugging files that get built into the folder, still didn't help. The only threads I can see spawning in my code are 2 queuetasks, 1 in the settings and one in the music plugins.

    I'm at the point where I will start building up the graphics library just to try the sleep change that was posted above...
    Last edited by detlion1643; 01-18-2012 at 05:16 PM.
    Current Worklog: TBA - '05 Rav4 (Mobo Dead).
    www.rav4world.com - Forums for Rav4 owners
    www.flavorfeasts.com - Cooking website/forums
    -Basic forums live atm, come contribute!

  6. #6
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    315
    Well, I have no idea what is going on tbh. I took out the settings plugin, and left just the music, ui, and main menu to deal with. I added a couple .doevents() (which I don't like to use and might try without), and changed the threading.queuetask() in the music to just a straight safethread.asynchronous(), and so far, my music has loaded successfully 10/10 debugging starts. Wierd, I think so, but at least for now I'll keep it changed and keep going with the skin.

    Edit: I still get the CLR error, but now at least it has no effect on my music list building .
    Last edited by detlion1643; 01-19-2012 at 06:15 PM.
    Current Worklog: TBA - '05 Rav4 (Mobo Dead).
    www.rav4world.com - Forums for Rav4 owners
    www.flavorfeasts.com - Cooking website/forums
    -Basic forums live atm, come contribute!

  7. #7
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    443
    Based on what I've read so far it sounds like a timing problem (or a crashing plugin but I think you ruled that out when adding them back in one by one). I've encountered a few of those earlier and in the latest code quite a lot of changes to correct these issues has been done (After all timing shouldn't affect the application in any manner!). I'll look over the code to see if I can find anything that would cause the problems described.

    Quote Originally Posted by detlion1643 View Post
    Well, I have no idea what is going on tbh. I took out the settings plugin, and left just the music, ui, and main menu to deal with. I added a couple .doevents() (which I don't like to use and might try without), and changed the threading.queuetask() in the music to just a straight safethread.asynchronous(), and so far, my music has loaded successfully 10/10 debugging starts. Wierd, I think so, but at least for now I'll keep it changed and keep going with the skin.
    Where did you find the "threading.queuetask()" code? I searched all the code for OM but can't find any reference to it?
    Last edited by Borte; 01-29-2012 at 02:07 PM.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  8. #8
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    443
    Quote Originally Posted by Efess View Post
    I'm pretty new to OM development, and I ran into a similar issue a few days ago. A thread was spinning in a while loop slowing the app to a crawl. I had to change Thread.Sleep(0) to Thread.Sleep(5) to give other OS threads some CPU time. FrontEnd\OpenMobile.Graphics\Platform\Windows\WinR awInput.cs:67
    Changing it from Sleep(0) to Sleep(5) shouldn't really do anything for other tasks as the code Thread.Sleep(0) is basically the same as DoEvents(). It would affect the local thread though slowing it down. But the only thing the code that you're referring to (line 67) is waiting for the mouse or keyboard driver to start, so changing it to 5 instead of 0 won't cause any problems.
    This is from MSDN regarding Sleep(0):
    Specify zero (0) to indicate that this thread should be suspended to allow
    other waiting threads to execute.
    Rebuilding the Graphics.Dll is not something that is required or should be done when working with skins.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  9. #9
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    315
    EDIT: My apologies, it was threading.taskmanager.queuetask().

    Taken straight out of newMedia.dll:
    Code:
    OpenMobile.Threading.TaskManager.QueueTask(delegate() { loadArtists(); }, ePriority.High, "Load Artists");
    and out of OMSettings.dll:
    Code:
     OpenMobile.Threading.TaskManager.QueueTask(new OpenMobile.Threading.Function(loadPluginSettings), ePriority.Normal,"Load Plugin Settings");
    Now, I don't use the OMSettings.dll anymore, whether modified or not... I'm building up a different way to include settings that works more like how Android works. But, changing the first code line to use
    Code:
    **I don't have my exact code in front me,  but something like this:
    SafeThread.Asynchronous(delegate() { loadArtists(); }, theHost);
    has loaded the music correctly every time with no CLR waiting errors.
    Last edited by detlion1643; 01-29-2012 at 04:30 PM.
    Current Worklog: TBA - '05 Rav4 (Mobo Dead).
    www.rav4world.com - Forums for Rav4 owners
    www.flavorfeasts.com - Cooking website/forums
    -Basic forums live atm, come contribute!

  10. #10
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    443
    Ok. thanks I'll have a look.

    Btw: I didn't find it since I just searched for the posted code: "queuetask" instead of "queuetask"... lol I should have seen the typo.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

Page 1 of 2 12 LastLast

Similar Threads

  1. OBD Initialization
    By Nitroking in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 7
    Last Post: 03-27-2011, 11:32 AM
  2. List of working plugins?
    By justchat_1 in forum RR Plugins
    Replies: 3
    Last Post: 08-22-2010, 12:16 AM
  3. KWP2000 initialization
    By 6208 in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 5
    Last Post: 06-08-2010, 05:10 AM
  4. XM Slow initialization
    By Custommx3 in forum Road Runner
    Replies: 3
    Last Post: 05-14-2010, 01:43 PM
  5. Replies: 4
    Last Post: 08-08-2006, 07:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •