Bizarre Droid Auto-Focus Bug Revealed 275
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.'"
When Signed/Unsigned Strikes (Score:5, Informative)
The patch is simple, make that signed int something like an unsigned long or truncate it properly. Hopefully we're not waiting long.
Re:When Signed/Unsigned Strikes (Score:5, Informative)
Most cameras do, they just don't use a RTC value to do so.
You don't want it continually focusing, you want it to focus then wait a bit otherwise it'll bounce all over the place. You check the distance, wait a moment, and check again, is it close to the same? If so use that as your focal length, other wise you'll probably end up never in focus cause you'll be using all the various raw values given to you by the sensor. This is likely input averaging to get a smooth value and throw out bad samples.
Take a look at the raw input values provided by most game controllers, try to hold an analog stick in one spot and not get jitter in the raw values, unless the device itself is averaging you won't got a solid result. Plug a xbox controller into your PC and use the Windows control panel (if you're using windows, never plugged a joystick into a unix box myself) to see how jumpy it is.
A sensor measuring the environment outside, in someones hand is going to bounce around like a mad man, so it has to be smoothed out somehow.
Re:When Signed/Unsigned Strikes (Score:1, Informative)
Re:IIRC, this is the same sort of bug (Score:4, Informative)
It was actually 49.7 days [microsoft.com].
Re:When Signed/Unsigned Strikes (Score:4, Informative)
The support for the camera in the Droid was developed by Motorolla, not Google.
Re:When Signed/Unsigned Strikes (Score:4, Informative)
This involves truncation, not sign-extension, actually. Sign-extension occurs when widening a value, not narrowing it. A value outside the range representable by a two's complement 32-bit integer is being cast to one, and apparently this platform simply truncates to 32 bits and treats the highest bit as having the value -2^31, rather than 2^31 as it had in the input value. This isn't the only way to handle such a situation; common alternatives are raising an exception or saturating (i.e. anything >= 2^31 converts to 2^31-1, and anything less than -2^31 converts to -2^31).
Not printing on tuesdays. (Score:3, Informative)
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 [launchpad.net]
Re:Bigger bugs afoot... (Score:5, Informative)
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.
Re:Bigger bugs afoot... (Score:3, Informative)
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 [goip.com]. 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.
Re:When Signed/Unsigned Strikes (Score:1, Informative)
Good job being a grammar Nazi. The final dot of your last sentence doesn't belong. There should be just one period, inside the quotes (regardless of which standard of English you were trying to be pedantic in).
Re:When Signed/Unsigned Strikes (Score:3, Informative)
Re:"Not waiting long"? (Score:5, Informative)
Nonsense. In 64-bit mode you can shift up to 63 bits at a time.
Re:When Signed/Unsigned Strikes (Score:2, Informative)
"I made $12k last week"
"Woah...word?"
"Word"
These days saying "word" in response to a statement means "What you said is true", which implies "I agree".