Bizarre Droid Auto-Focus Bug Revealed
itwbennett writes "Pity the poor engineer who had to find this one. One of the more interesting of the handful of bugs that have appeared since the launch of Verizon's Droid smartphone has to do with the on-board camera's auto-focus. Apparently it just didn't work. And then suddenly it did. Naturally, this off-again, on-again made the theories fly. But the real reason for the bug was revealed in a comment on an Engadget post by someone claiming to be Google engineer Dan Morrill: 'There's a rounding-error bug in the camera driver's autofocus routine (which uses a timestamp) that causes autofocus to behave poorly on a 24.5-day cycle,' said Morrill. 'That is, it'll work for 24.5 days, then have poor performance for 24.5 days, then work again. The 17th is the start of a new 'works correctly' cycle, so the devices will be fine for a while. A permanent fix is in the works.'"
It's all over the comments on the engadget page but since 2^31 milliseconds is about 24.5 days, it's highly probably we're dealing with a very classic not so funny sign extension bug here. So if I may presume the real problem, it's that autofocusing depends on catching timestamps from the system to know how long it's been since the last sampling in order to adjust the lens and check for accuracy. It's casting this to a signed 32 bit variable which means that during the 24.5 days it is miscast to a negative number, thus breaking the algorithm when it measures time deltas and causing it to mis focus before snapping the picture.
The patch is simple, make that signed int something like an unsigned long or truncate it properly. Hopefully we're not waiting long.
My work here is dung.
It was actually 49.7 days.
fnord
There was a wonderful bug in ubuntu where it wouldn't print on tuesdays. It would generate a postscript file, which includes the date, but a faulty entry for file-type detection caused postscript on tuesday to be interpreted as some kind of erlang file... which obviously didn't print very well :)
http://bugs.launchpad.net/ubuntu/+source/file/+bug/248619
"You know, Hobbes, some days even my lucky rocketship underpants don't help" -- Calvin
Exchange works great for me. So does navigation. I had no problem charging my phone with my netbook's USB port. I did, however, notice that changing the orientation can cause not-yet-applied settings to be forgotten (happened to me while setting up Exchange).
I don't have any Bluetooth stuff so I can't comment on Bluetooth support, but I imagine it will improve. Bluetooth seems like a very temperamental protocol. That said, hands-free Bluetooth voice dialing is actually a showstopper for a lot of important business types, so that should get fixed right away.
If you don't like the native Contacts application, I'm sure you can find some others. Personally, I use the Favorites tab of the Contacts widget, and that handles 95% of the times I want to make a phone call in two clicks.
Finally...Motorola made the phone, not Google.
:(){
They should've just made it to lie about its policy enforcement to Exchange server like the iPhone did. That way it'd be banned from my corporate network like my iPhone was. Thanks Steve, you're such a smart guy.
Just as an aside, that bug is now fixed. To cut the story short, the 3GS does support it properly, earlier models do not, and iPhone 3.1 properly reports this to the server now.
Nonsense. In 64-bit mode you can shift up to 63 bits at a time.