Posts Tagged ‘development’

sound for sabrent sbt-tvfm composite and s-video in linux

Monday, August 29th, 2005

Last year, I sent in a patch for the saa7134 linux kernel module (part of video4linux) to add support for the Sabrent SBT-TVFM tv tuner card. Unfortunately, I didn’t get the chance to test it beyond the TV and radio, but a couple people were kind enough to e-mail and point out that the audio settings for composite and s-video were wrong. The first person e-mailed something like nine months ago, but then I forgot about it until someone e-mailed today, at which point I got off my lazy ass and sent in the dinky little patch that I should have made last year. Here’s the diff against the latest CVS snapshot (2005/08/10) for anyone interested:


--- saa7134-cards.old 2005-08-29 15:06:41.987728113 -0400
+++ saa7134-cards.c 2005-08-29 15:09:30.519188225 -0400
@@ -1374,7 +1374,7 @@
.inputs = {{
.name = name_comp1,
.vmux = 1,
- .amux = LINE2,
+ .amux = LINE1,
},{
.name = name_tv,
.vmux = 3,
@@ -1383,7 +1383,7 @@
},{
.name = name_svideo,
.vmux = 8,
- .amux = LINE2,
+ .amux = LINE1,
}},
.radio = {
.name = name_radio,

I haven’t tested it myself, but I’ve received more than one report about it. Hopefully I’ll do some more work on this in the coming weeks, specifically adding support for the remote at last, because I’m going to be using the card to set up a media center for my family.

matt and the mikecam save the world

Friday, August 26th, 2005

Last night, Matt managed to get himself blocked from the MikeCam by an anti-spam plugin I’m using called “Bad Behavior” when he installed Google Desktop 2 and used it to try and add an RSS feed from my blog. As it turns out, Matt’s accidental banning was most fortunate, because it led to two fixes for Bad Behavior, possibly a fix for Google Desktop itself, and resulted in me beginning to use FeedBurner to distribute my RSS feeds.

To address each of those in order: The reason Matt got banned was that when Google Desktop 2 accesses an RSS feed, it sends its user agent as “Mozilla/4.0 (compatible; Google Desktop)” but then does not send the required “Accept:” header that all Mozilla-compatible user agents send. As a result, Bad Behavior thought it might be a spambot pretending to be Mozilla and consequently banned Matt. Further, when I tried to whitelist Matt so that he could access the site regardless, it had absolutely no effect! I e-mailed Michael Hampton/io_error, the author of BB, and he responded this morning, confirming my suspicions regarding GD2′s RSS handling being the problem, and providing the explanation I just paraphrased here. This evening, he released an update fixing both of the bugs that Matt and I had discovered. Not only that, but when I mentioned it to someone in the Gallery IRC channel, Bharat, the founder of Gallery and a Google employee, asked me to e-mail him the info so he could look into the Google Desktop side of things! How cool is that? Matt’s little episode may very well result in a Google fix! The last little outcome of this episode is that, in the meantime, to avoid accidentally banning GD2 users, Michael Hampton had suggested I use FeedBurner, which I had glanced at before but never really had an interest in because I wasn’t doing anything with RSS. Now that I’m interested though, I realize that it’s a terrific free service that not only mirrors your feeds (saving you server load and data transfer), but can do about anything you could dream of to your feeds. Automatically make them compatible with the RSS reader the user is using? Yes! Statistics on your readership? Yup. Automatically add enclosures for podcasts or other media? Sure! It’s really great, and it’s really free, and I love the copy on their site – it conveys a fun, friendly attitude.

In related news:

  • My patch to fix XHTML compliance in the great EventCalendar plugin was incorporated into the latest release today (well, it’s 12:30am, so really it was yesterday, but who’s counting?).
  • Sent in a couple crash traces to Amarok today as well, since I use bleeding edge SVN code and after updating and recompiling today it started crashing out on me on playback. As of this evening it works again, so hopefully my reports helped make that possible.
  • A SmartEnforcer exploit I discovered and wrote about five months ago was finally reported on SecurityFocus, as it apparently still exists. Idiots.

Finally, I also reported a couple more phpdoc errors in the Gallery code (one of which I proceeded to accidentally copy and paste into my code, which my mentor then pointed out, heh.. stupid me) and wrote a patch for their phpunit testing platform that was briefly committed and then rolled back because of philosophical concerns regarding Gallery’s testing methodology. It all started from a minor problem I was having with some unit tests I had written. I asked about it and wound up providing a very little patch to fix this problem, and from there it exploded into a big discussion, a revert of the patch, and now I have to write an entire additional abstraction layer for my module! It was quite unexpected, to say the least. It is for the best, though, as I learned something new and my code will be much better for it. It also lead to me having a great talk with my mentor, Andy a.k.a. “valiant,” in which he helped me out with this new bit that I have to tackle and also offered his very kind and sincere hope that, despite the frustrations of working with Zen Cart, I had enjoyed and benefited from doing this project. Which I can honestly say I have. :)

fix for eventcalendar xhtml validation

Tuesday, August 16th, 2005

The EventCalendar 3.0.1 plugin for WordPress was failing XHTML validation because of incorrect nesting of tags, so I took a look and fixed it. Here’s the patch:

--- eventcalendar3_1.php 2005-08-16 17:01:42.003399602 -0400
+++ eventcalendar3.php 2005-08-16 16:58:27.088002867 -0400
@@ -616,10 +616,11 @@
$pad=7-$col;
if($pad>1)
echo "<td colspan='$pad' class='pad' style='vertical-align:bottom'>"
- . "<a href='http://blog.firetree.net/?ec3_version=$ec3->version'"
- . " title='Event Calendar $ec3->version'"
+ . "<div class='ec3_ec'"
. ($ec3->hide_logo? " style='display:none'>": ">")
- . "<div class='ec3_ec'> </div></a></td>";
+ . "><a href='http://blog.firetree.net/?ec3_version=$ec3->version'"
+ . " title='Event Calendar $ec3->version'>"
+ . " </a></div></td>";
elseif($pad)
echo "<td colspan='$pad' class='pad'> </td>";

You can test the XHTML on my page to see it in action.

the abrupt switch to wordpress

Tuesday, August 16th, 2005

Well, today I’ve finally had enough and had to switch my blog to WordPress abruptly. In the two weeks of this month so far I have already received two and a half times the amount of traffic that I got last month, but from one third the number of visitors. It’s all going to my b2evolution blog and is clearly from spammers. Hell, 2gb of it was from only two IP addresses, both tracing back to Mexican providers. I’ve firewalled some of them out, but I still got another gigabyte of traffic yesterday, in just one day. This is ridiculous and has to stop, so today I installed WordPress, loaded it up with antispam plugins, and I’m hoping for the best.

I have to say, the switch to WordPress was nice and smooth, thanks to the b2evo importer script that I updated a bunch and which Isaac Schlueter has worked on further. There’s also a terrific number of WP plugins available to use, and I’ve already installed quite a few. I love the Events Calendar (look to the top of the sidebar on the right) and I’m hoping that Spam Karma 2, Referrer Karma, and Bad Behavior will all help to filter out spambots. As soon as I get around to it, I’ll update my Gallery to Gallery 2 and start using the WP-Gallery2 plugin to post images here. After I finish my Google Summer of Code project I’ll be working on it a little to add some functionality and make it easier to insert Gallery items into posts.

Anyway, for now WordPress is terrif and I hope it works out…

wordpress

Tuesday, June 7th, 2005

I’m totally switching to WordPress as my blogging software. Well, I mean, I’ll test it out first and all, but b2evolution is just getting on my nerves, especially when I look and see that WordPress has things that I want, it updates far more often than b2evo, and every blog I look at is using it or has recently switched to it from b2evo. What I hope to achieve with WP is easier administration, specifically with regards to preventing the seemingly weekly spamming of my blog. Also WP has a junkload of plugins, and you know I’m just a feature whore…

I hadn’t used WordPress originally because of some bad comments I heard somewhere, but maybe those were just a figment of my imagination – I haven’t really run across any recently. The one I did find, I jumped on for details, but his response seemed more concerned with items that are for me minor and uninteresting feature details, so I plan to move forward with exploring WordPress.

Edit: Well, just discovered a new frustration with b2evo, as I was unable to make this post for some time because of the links to sneeu.com, which were registering as blacklisted URLs because of an “eu.com” in the blacklist. Bloody annoying.

serendipity blog software

Thursday, March 24th, 2005

Saw it being used for the amaroK blog and it looks pretty nice. I’ll give it a shot when I have a chance.

streaming webcam experiments

Thursday, March 3rd, 2005

Still trying to find the ideal Linux webcam application, after trying camorama and most recently w3cam + a homebrew script. Frank started playing around with a streaming cam last night, so I thought I’d give it a shot, since the only reason I hadn’t before was that I couldn’t allow direct connections at home. Anyway, I compiled and installed camserv, a streaming cam app for Linux that I’d run across before. It’s a little old, but it still works great. There is one gotcha when compiling, though. I got an undefined reference to `errno' error, which this thread helped me solve. Apparently it’s some lax coding that newer versions of GCC are more strict about. To fix it, I ran grep -rs "extern int errno" * to find the files with the bad code, then opened them all in kwrite (there’s probably a better way…) and replaced all occurrences with the correct code: #include <errno.h>.

After that, the README file is great for help configuring the program. I added a banner filter to print “themikecam.com” on the image, moved the timestamp to the bottom right, and added “%D” to display the date. Remember to switch the module being used from the default color-switcher test module to video_v4l_qcam and to open up your port of choice (default is 9192) in your firewall. I keep mine pretty tightly closed since I’m apparently connected directly to the net, but I went and opened that one port in shorewall through the Mandrake Control Center.

The last issue I had was that Internet Explorer doesn’t like the streaming JPEGs that camserv produces. Luckily, it comes with a built-in workaround, accessible at http://hostip:9192/singleframe, that outputs a normal JPEG upon request. Apparently Konqueror has an issue with viewing these JPEGs as well, but Firefox/Mozilla/Netscape and Opera work fine. Any Safari users out there? I added a line to my webcam updater javascript so that real browsers can view the actual streaming feed but MSIE and Konqueror are given the singleframe image and updated by Javascript every second.

I still have a few things to figure out to my satisfaction, such as how to deal with the streaming cams when they go off and how to automatically fix a hiccup/drop in the connection. I threw together a quick fsockopen() test so that if Frank’s cam and mine aren’t accessible within seven seconds, it will timeout and output “offline” in place of our images. Previously, the problem I was having was that none of the cams would update until the browser timed out the broken image. In the future, I’d also like to make the cams page fully dynamically customizable, so the user can select what cams he/she wants to view from an index in a sidebar, which would include the realtime online/offline status of every webcam. I’m thinking perhaps a PHP script that outputs an online/offline image, so that I can use a JavaScript similar to my webcam updater to continuously update the status, possibly contained by an iframe. I’m not sure what the performance impact of all this Javascript is, but I’m certainly curious…

webcam updater javascript

Monday, February 21st, 2005

I previously had my webcams page doing a meta-refresh every 30 seconds to reload the entire page and all the images, but that consumes extra time and bandwidth as non-essential data has to be reloaded. I didn’t have a solution, however, until I saw some JavaScript the other day that Kyle is using on a page. All it is is an ingenious little chunk that resets the source of the webcam image at a certain interval, by virtue of the setTimeOut() function. Since I have more than one cam on my page, however, I wanted it to be extensible to any number of cams and for any combination of update intervals. So, I hacked it up a whole bunch, adding arguments to the update function and the result is this:
<script language="JavaScript" type="text/javascript">
<!--
function runCam(name, address, interval) {
tmp = new Date();
tmp = "?"+tmp.getTime();
document.images[name].src = address+tmp;
setTimeout("runCam('"+name+"', '"+address+"', "+interval+")", interval*1000);
}
function startCams() {
runCam('mike', 'http://www.public.asu.edu/~marodri6/webcam.jpg', 5);
runCam('joey', 'http://themikecam.com/joey/webcam.jpg', 31);
runCam('kyle', 'http://kylesdesktop.com/pics/cam.jpg', 31);
}
// -->
</script>

startCams() is called by the onload= attribute in the body tag, and each cam image is identified by it’s respective name= attribute in the img tag. Simply pass the ID of the cam, it’s URL, and the desired update interval to runCam and voila!

redoing the site…

Thursday, February 17th, 2005

Took another step towards the new site today by redirecting the old forum and gallery to their new counterparts and the old main page to this blog. Although I confess this was brought on by my skyrocketing transfer this month: I still don’t really know what’s going on, but the bulk of it seems to be from the old forum and gallery, so hopefully this will help. I put up a temporary quickie shoddy navigation at the top of the blog only as well as the site news from the forum. The splash page is the same as you can see, and the webcams page is the same except with the old navigation cut off and friends’ cams added. Hopefully I’ll get to work on it some more this weekend, but I always say that. I don’t even have a new design yet. Hell, I’ve barely even though about what a new design would look like. Actually that’s a lie, I have an idea, I just have to work on translating it into an actual design, which I have not started at all. I think I’ll make a “Site News” category here and use the blog for that…

blog vs forum

Saturday, February 12th, 2005

Bah, I just don’t know where to draw the distinction between a blog and a forum. It seems to me that a blog should have things posted by one or a few people that are just thoughts or articles that will receive individual comments but not a particular thread of discussion, whereas a forum is for talking, “chatting,” just for visitors to discuss things by posting questions or thoughts. So it seems clear that in the case of The MikeCam, since it is really about me and I will (theoretically) be posting elaborated thoughts on a regular basis, that I should use the blog except for small questions or notes or thoughts that I’m actively looking for responses from. At the same time, since most visitors will post less frequently or at least less relevantly (since the site is not about them), they are all consigned to the forums (forum or forums?).

The problem comes in with some of my posts: the brief “site news” posts I make? Little topics? Uh.. I dunno, I got distracted and can’t remember what the problems were. I’ll come back to this. Also, should my geek stuff be in a separate blog like it is or just categories under a single blog?