Wanna help test AttnGrab? August 22, 2009
Posted by a1291762 in : programs , add a commentSo AttnGrab >2.2 crashes when receiving an SMS on many devices but not mine, which makes debugging kind of hard.
If you’re happy to test, get the latest builds from http://yasmar.net/AttnGrab.prc (build 0976) and http://yasmar.net/atgdebug.prc. In atgdebug, turn on debug logging and after the phone crashes, send me the AttnGrab Debug Log.pdb file (it’ll HotSync onto your desktop). Also, please let me know what the trace log thinks of the crash (dial #*377 to get this).
If you just want a version that doesn’t crash you can use version 2.2 (which can be found at http://ramsay.webhop.org/attngrab).
AttnGrab SMS crash bug June 4, 2009
Posted by a1291762 in : programs , add a commentDespite reports from users on a crash when receiving SMSes, I could not get this to happen to me and a review of the code didn’t reveal any problems.
However a few days ago I got the exact symptoms that one user had complained about. That is, my phone beeped twice then rebooted and the cause of this reboot was an SMS being received. At first I thought perhaps the problem was due to some difference between Australian and US SMSes (the SMS that crashed my phone came from facebook) but by chance, I noticed something odd about my AttnGrab settings that led me to the actual problem.
The problem I noticed is that my seconds value was set to 0 instead of 300. Due to a bug in the SetAlarm code, this meant that AttnGrab would set an alarm for the current time, causing an alert loop. When I used atgdebug to simulate an alert, the phone did not crash but then AlarmTriggered() is run while another app has the stack (it’s a pointer handler) so perhaps something about the state when an SMS is received didn’t appreciate this alert loop.
So the first thing I fixed was to ensure that the alarm is only ever set for the future or cleared.
What puzzled me though was how my settings got changed in the first place. I stumbled on it almost by accident. The Ringer State checkbox does some processing when you click it. The first thing it does is save the state. However, when this happens the seconds field is emptied (but not redrawn). The field was supposed to be re-initialised but this didn’t happen in certain cases. In these cases, pressing Done would save 0 for seconds. Clicking the field is what gave me the clue because when I did that it cleared itself. This has been fixed now so your seconds value should not get eaten by the Ringer State checkbox anymore.
If you’ve experienced crashes with AttnGrab please try the new version at http://ramsay.webhop.org/attngrab.
Update 10 June 2009
It seems this has not fixed the issue. There seems to be something fundamentally different going on with Centro devices because I’m just not seeing the reported symptoms. I just love coding blind… :(
AttnGrab gets a debug log March 18, 2009
Posted by a1291762 in : programs , add a commentThe problem with trying to debug an app like AttnGrab is that it’s really hard to actually use it properly unless you’re running on a device bug on-device debugging facilities are basically nil. I tried once before to write a debug log facility for AttnGrab bug I failed miserably. It turns out my understanding of how to write to databases was way off and the recent 3.0 work showed me where I was going wrong.
So now AttnGrab has a debug log. The app itself just has a small routine for writing the debug. You turn the facility on and view the log from a companion app called ATGDebug.
I did all this to try and track down a bug reported by someone. While I haven’t been able to track down their bug I did find 2 other bugs as a result of debug messages I inserted. Hooray.
After almost 200 builds, AttnGrab's profile makeover is complete March 4, 2009
Posted by a1291762 in : programs , add a commentPhew!
There’s almost 200 builds between the last version of AttnGrab and the new version. Considering how much on-desktop debugging I had to do that’s a lot.
The app has had a massive overhaul of its prefs/profiles system. It now supports “unlimited” profiles and stores them in a database (instead of the system prefs). The ringer switch no longer changes profile but it can change prefs within a profile. Hard to describe but it works much more sensibly.
AttnGrab still imports your old prefs but you’ll probably want to change what it’s done to take advantage of the new functionality.
So the new prefs code gave me a heap of grief. I spent quite a bit of time trying to figure out why it was crashing but you don’t get anything useful on the device and POSE just says to connect a debugger. At least I managed to find one. It’s part of EzAsm and I heartily recommend it to anyone testing crashes under POSE. Build with PRC-TOOLS and use -g and -mdebug-labels then you’ll be able to print a stack trace.
Turns out I had some assumptions about memory that don’t work (eg. you MUST use DmWrite to write to memory in the data heap. You cannot just write to a pointer).
Since AttnGrab is ostensibly an “OnBoardC app” the .zip only contains the files you need to build under OnBoardC but it also builds and runs just fine with PRC-TOOLS (that’s how I do my on-desktop testing). I haven’t included the infrastructure needed for this but if anyone is interested in it, let me know and I’ll package it up. I tend to do most of my development on the device and use a command-line text to pdbdoc converter to convert the .pdb files to .c and back again. I store everything in git as text and generate the .pdb files for the package (or for uploading to my device).
Of course, most Palm developers probably use PODS but I have a Mac so that’s not an option for me. At least webOS supports Mac as a development host.
Fix a display dimming problem with MacBook Pro and 10.4 October 28, 2008
Posted by a1291762 in : programs , add a commentApple knows about it but has chosen not to fix this annoying bug for 10.4 users. I haven’t upgraded to 10.5 yet (I’ll probably skip it entirely since Snow Leopard is coming). There’s a work around but it’s annoying to have to do that every time I reboot (which is fairly often these days thanks to gaming via Boot Camp).
I thought to myself, “surely this can be automated”? It turns out that it can.
With a bit of mucking around I’ve come up with an AppleScript that fixes this annoyance. It’s saved as an application bundle, simply add it to your login items and when your machine boots, the appropriate check boxes will be toggled automatically. Note that it requires UI scripting to be on but it does not verify this. I also don’t know how well it’ll go if you’ve got a localised version of Mac OS X.
Get it here.
Menu Meters CPU name August 6, 2008
Posted by a1291762 in : programs , add a commentA long time ago I ran a CPU load meter app called Spy. It ran in the menu bar and had a funky way of displaying current and long-term load. Alas, it was not an open source app and the original author disappeared off the face of the earth. I kept a copy of the app around for others to download until it broke with the 10.4 upgrade.
So I finally had to look for something to replace it. Unsanity’s Cee Pee You was ok but only did current load, not long-term load. In fact, that’s something I found with just about every CPU load app that ran in the menu bar. Then I found Menu Meters.
Something that’s bugged me for ages with Menu Meters is it’s inability to recognise the CPU in my MacBook Pro. It says that I’ve got 2 Intel 80486 CPUs running at 2.00 GHz. To be fair though, it does this because Mac OS X tells it that I’ve got that particular CPU. It seems that Apple never bothered to update the Gestalt functions after the switch to Intel CPUs and they never bothered to update the NeXT CPU info functions to support chips newer than the Pentium 4. I did manage to find a suitable string via sysctl. Since Menu Meters is open source, I could go ahead and fix this annoyance myself.
The patch I created is here (watch out! I’m not very experienced with Cocoa so there could be bugs in that).
On my machine the end result looks like this.

Not quite the “Intel Core Duo @ 2.00GHz” that I’d like to see but I wasn’t about to implement a model to marketing string conversion map. I know that T2500 means Core Duo so it’s fine for me.
Hmm… It seems Spy came back though I have to wonder if a new version is ever going to be released. I think I’ll take a look at the code. Maybe I can graft the circular display that Spy used onto Menu Meters…
Update 6 August 2008
So it seems the Spy author was busy, at least for a while. I can build and run the version in CVS and it seems to be doing what it’s supposed to do. It looks a tad different and it has the same “80486″ bug that Menu Meters has but I’ve already figured out how to fix that :)
Treo stuff March 11, 2008
Posted by a1291762 in : programs, treo650 , add a commentMy battery case was squeaking. Most noticeable when typing and stuff. Solved by putting a bit of paper around the battery compartment (makes the case fit more snugly).
Attention Grabber was updated to 1.4. It now re-enables itself after being upgraded during HotSync (a bit more useful than getting disabed).
Graffiti Anywhere has been causing strange problems even though it’s not activated. The most annoying of these was preventing my Treo from sleeping! I’ve blown it away because I never use Graffiti anyway (what with that keyboard there).
I got reverse DUN going. Using a pppd command instead of HotSync on the Bluetooth serial port the Treo can connect and I can do things like Google Maps trough my laptop. Not sure what good this will be though as my laptop only has Internet at home.
I added Blazer back to my ROM to test the Reverse DUN stuff. I need to update this blog because it looked fine until the CSS loaded and then it just looked like crap.
AttnGrab update, Blog template update March 6, 2008
Posted by a1291762 in : programs, site , add a commentAttnGrab has been updated to 1.2. I’m going to post a comment on it’s page so that people can track new versions without having to wade through my regular posts.
I’ve fixed the “Subscribe to comments for this post” link too. I guess nobody has been doing that because it’s been broken for a long, long time.
Updates February 1, 2008
Posted by a1291762 in : programs, treo650 , add a commentI’ve been too busy to post updates. Here’s a bunch of things that have happened recently.
- Nokia purchased the company I work for, Trolltech. Ironically, this means I might be able to get my hands on the source code for TreoAlertMgr (since they purchased that company too) but I’ve already written Attention Grabber and it remains my property, not Nokia’s so it won’t be going away.
- The OnBoardC/SrcEdit guys accepted my Bird patch and are keen for me to become a developer.
- I sent off the patch that makes Bird more like RsrcEdit.
- I’ve collected my patched utilities into a single file, OnBoard.zip. If you want the modified sources let me know.
- I found the source to Pocket Rogue and I got it building with PRC tools but it crashes randomly. Will post once it’s working.
Attention Grabber v1.0 January 18, 2008
Posted by a1291762 in : programs, treo650 , add a commentIt’s done!
Listed under My Programs on the right or just head on over to the permanent URL: http://ramsay.webhop.org/attngrab.
Update 23 January 2008
Today I forgot to put my phone on vibrate while at work (wearing earphones). I didn’t notice my phone ringing but once I took off the earphones I heard it beep and sure enough, there was a missed call.