November 20, 2013
Qt 4.8.5 timers and high CPU usage on Linux
I am using the QBasicTimer class in my application for a number of QObject timers. It's supposed to be the most efficient timer class Qt offers in terms of overhead (as per the documentation), but I noticed fairly high CPU usage (3%) on a 30ms timer even when the timer function was doing nothing. This seemed odd on a RHEL 6.4 server with multiple, very fast cores.
After some research, I discovered this is a known problem due to a timer granularity mismatch between glib (used for the event loop on Linux) and the Qt timer API. For some reason, the current code decides to use some busy-wait-type method to try and precisely handle the granularity matching, resulting in a short CPU spike right before the timer expires.
Apparently the patch has finally been incorporated into one of the Qt 5.x releases, but I hope it makes it into a future Qt 4.x patch soon!
September 27, 2013
Building Qt 4.8.5 libraries from source without WebKit for static linking
Building Qt 4.8.5 libraries from source for static linking on Linux is not as simple as passing the "-static" option to the configure step.
Qt does not seem to support building the WebKit module statically. It tries to automatically disable building of WebKit for you during the configure step when building statically, but still proceeds to try to build it in the make step. Adding the "-no-webkit" flag does not help either.
The only option is to go down to the src/3rdparty directory and remove or rename the webkit subdirectory.
February 6, 2013
Baltimore Ravens, Champions Again!
The Ravens made history with an unbelievable run to win the Super Bowl. It sure does feel good, even now that the parade is over and the dust has settled a bit. They've made the playoffs the last few years, but often as a lower seed, forced to play on the road, away from the best home field advantage in the NFL. Last year was particularly painful, as they made it to the AFC Championship game and played extremely well, only to lose in heartbreaking fashion at the very end, with victory (or at least overtime) within their grasp.
This year, all wrongs were righted in the playoffs. The Colts, Baltimore's despised former team, were dispatched in a home win without yielding a single touchdown. Then came a visit to the top seeded Broncos, led by playoff nemesis, future hall-of-fame QB Peyton Manning. The Ravens were 9.5-point underdogs. It was a double overtime game played in bone-chilling conditions at mile high altitude. Classic football, one for the ages. It took a 70 yard bomb, the Mile High Miracle, with 31 seconds left to get the Ravens to overtime, but that was only because Ravens special teams mistakes allowed 2 return touchdowns. Manning threw an interception in overtime, the Ravens moved into position, and Justin Tucker nailed the 47-yard field goal to pull off the huge upset. Next up were the Patriots, who the Ravens had faltered against last year. The oddsmakers had the Ravens as 9.5-point underdogs again, in spite of the fact that the Ravens have always played the Patriots very tough, even in their stadium. This time the Ravens would not be denied. Their hard-hitting, physical defense shut down the high-flying, finesse offense led by Tom Brady. In the Super Bowl, the 49ers were only 4-point favorites, but certainly seemed like the most balanced and dangerous team the Ravens had yet played (at least to me). They came out flat, though, and the Ravens took advantage, building a 28-6 lead early in the 3rd quarter. But just when thoughts of a blowout were swirling in my head, the lights went out in the stadium. When played resumed more than a half-hour later, the 49ers took control and put the Ravens back on their heels. The defense was looking tired, and the 49ers seemed to be moving the ball at will. In the game's penultimate sequence, the 49ers had 4 downs to get 5 yards for a touchdown and their first lead of the game. They had been running the ball with great success, but after an initial run on first down (which got them a couple yards), they inexplicably threw 3 consecutive passes on fade routes, failed to convert, and turned the ball over on downs. Baltimore ran down the clock and held on for the win. They had bent, but not broken, and they were champions!
Joe Flacco had one of the greatest postseason runs for a QB in history. Not only did he outduel Manning and Brady, he tied the mark for most postseason touchdowns (11) without an interception originally set by another Joe (Montana). He's a free agent, but I'm sure he'll be back with the Ravens next year. Hopefully he structures his new mega-deal such that other key veterans and free agents can be brought back as well. Ozzie Newsome, the Ravens GM, has always done a sterling job, and we fans are confident he will keep the Ravens in contention for years to come. The Ravens have become one of the great franchises in the NFL. I'm proud to be a fan.
January 5, 2013
Top Ten Albums of 2012
I'm convinced time is accelerating. It's 2013 already and I am having trouble comprehending how 12 months have passed. But, as always, I've managed to find new music to enjoy. Here's a list of my favorites...
June 9, 2012
First Taste of Pi
So after tracking the online buzz about the Raspberry Pi for a long time, I finally got my hands on one. It was a bit finicky to get set up. To keep costs and power consumption of the device down, a number of trade-offs and sacrifices have been made. Things to keep in mind for anyone starting off with the Pi:
1) It does not come with a power supply. It uses a Micro-USB connector for the power, BUT needs more than the standard 500ma of current that is typically provided via USB. The specs say the minimum current required is 700ma, but based on what I have read and experienced, you need a power adapter that provides at least 850ma (with 1A or greater being ideal) to ensure there's enough power for even simple USB devices connected to the Pi (e.g. keyboard/mouse). I am using a 2A Xentris Micro-USB charger.
2) Even using a charger with plenty of power, the Pi is limited to providing a maximum of 150ma of power to each USB port. Some keyboards, particularly those with USB hubs built in, can reach that limit and cause issues. A cheap and simple keyboard is the best bet. I am successfully using a Logitech keyboard without a USB hub which has current draw listed on the bottom as 100ma.
3) The HDMI out works quite well connected to TVs. I had some difficulties connecting to a monitor using a HDMI->USB adapter -- there was lots of noise and interference on the screen. I tried boosting the HDMI output signal, as per the Raspberry Pi Wiki, but couldn't get it to work until I used an actual HDMI->DVI cable ($7 from AmazonBasics). For some reason the adapter (made by Rocketfish) was causing enough signal loss that the monitor was having problems.
4) Everything is set to UK settings. The Pi foundation is a UK based charity so I suppose that's to be expected, but remember to change your timezone and keyboard layouts, if you are based elsewhere (such as the US).
5) The ARM processor is not very powerful. If you have used embedded boards with more powerful ARM chips (including many modern smartphones), it will seem particularly underwhelming. However, for the cost, it's decent. The GPU, which supports 1080p displays and H.264 decoding in hardware, is what really sets it apart, especially in this price class. I plan to spend a bit of time looking at how I can best leverage the GPU, which supports OpenGL 2.0 ES, OpenVG, and OpenMax software APIs.
More to come...