tag:blogger.com,1999:blog-14923747980420025052024-08-30T00:09:03.355-06:00Michael's Software Thoughts & RamblingsMichael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.comBlogger35125tag:blogger.com,1999:blog-1492374798042002505.post-64786921884145102122013-09-27T14:49:00.002-06:002013-09-27T14:49:23.440-06:00Log4j 2 Fixes Auto Reconfigure Thread LeakIn my last post, I talked about a shortcoming of Log4j with a thread leak. I took a look at the Log4j 2 source code to see if it suffers from a similar issue.<br />
<br />
The Log4j 2 implementation that checks for changes to the configuration file is handled by FileConfigurationMonitor.java. No threads are created to monitor changes, and from my testing, I saw no thread leaks re-deploying my application to Tomcat. <br />
<br />
The new behavior calls FileConfigurationMonitor.java checkConfiguration method during each logging call. If the time since the last check has exceeded your monitorInterval passed into the logging configuration and the file has been modified on the disk, the configuration is reloaded.<br />
<br />
<br />
The behavior works as expected, but I encountered and initial issue by setting my refresh interval to 1 second...the <b>minimum</b> amount of time one can check for changes to the configuration file is hard-coded at <b>5</b> <b>seconds</b>. "But Log4J, what if I have a requirement where I need to apply the change within <b>1</b> second????" Five seconds <i>seems</i> like enough time between checks, and I could probably write my own implementation to get rid of the hard-coded limitation and plug it in somehow. But, why choose 5 seconds as the minimum and give no way to change it? <br />
<br />
From my brief experience with Log4j 2, I like the APIs, ease of configuration settings, and will look forward to the promise of performance increases (those are always welcome no matter how small in any software). And best of all, no thread leak!Anonymoushttp://www.blogger.com/profile/11181652052234058822noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-84291002536461024232013-09-27T11:02:00.001-06:002013-09-27T11:02:13.814-06:00Log4j And Web Application Thread LeaksLet's breathe some life back into this blog!<br />
<br />
I'll start off by talking about an issue and solution I recently came across.<br />
<br />
The <a href="http://logging.apache.org/log4j/1.2/">Apache Log4J framework</a> provides a way to re-configure logging on-the-fly by editing the configuration file. The implementation spawns a thread (FileWatchdog.java) that monitors the configuration file for changes. FileWatchdog never checks Thread.<span class="st">isInterrupted() .<i> </i>Instead, it catches the interruption making the </span><span class="st">FileWatchdog thread live until the jvm is stopped.</span><br />
<br />
The <b>problem</b> with this implementation (in version 1.2.16 I tested) is there is no <i>easy</i> way to stop the thread--some people have written that stopping it is impossible. In a web application environment where you may re-deploy offten, the end result is several threads that never stop along with memory leaks on any held resources in the running threads.<br />
<br />
Tomcat 7 provides us a warning:<br />
<br />
<pre style="border: 1px solid blue; overflow: auto;">Sep 27, 2013 10:29:36 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/log4jtest] appears to have started a thread named [FileWatchdog] but has failed to stop it. This is very likely to create a memory leak.
</pre>
<br />
With a simple test case, I discovered an easy way to forcibly kill these threads:<br />
<br />
<pre style="border: 1px solid blue; overflow: auto;"> /**
* @see ServletContextListener#contextDestroyed(ServletContextEvent)
*/
@SuppressWarnings("deprecation")
public void contextDestroyed(ServletContextEvent sce) {
for (Thread t : Thread.getAllStackTraces().keySet()) {
if (t.getName().equals("FileWatchdog")) {
System.out.println("Found FileWatchdog thread. Killing it");
t.stop();
}
}
System.out.println("contextDestroyed");
}
</pre>
<br />
The downside with this approach is you have call the deprecated Thread.stop() method. The upside is this method is still available in Java 7. Placing the call in a ServletContextListener allows the container to stop these threads during the undeploy process.<br />
<br />
Tomcat now shows no warning the tread was left running:
<br />
<pre style="border: 1px solid blue; overflow: auto;">INFO: Reloading Context with name [/log4jtest] has started
Found FileWatchdog thread. Killing it
contextDestroyed
Sep 27, 2013 10:40:18 AM org.apache.catalina.core.StandardContext reload
</pre>
<br />
Using jvisualvm or any other tool confirms the thread was stopped.<br />
<br />
It seems like such a quick fix (e.g. || isInterrupted()) FileWatchdog could throw in there--I'm not sure why this hasn't been addressed. Given the design decisions of Log4J to really have one instance per jvm, the current implementation makes sense. However, it's common for individual web apps to configure their logging independent of any other web apps or global logging. In addition it's just good coding standards for frameworks to provide clean startup/shutdown apis. Maybe this is been addressed in the upcoming Log4j 2 . Anonymoushttp://www.blogger.com/profile/11181652052234058822noreply@blogger.com1tag:blogger.com,1999:blog-1492374798042002505.post-66590687398373064332010-04-16T17:05:00.007-06:002010-04-16T17:45:36.316-06:00SWT Table Images And TransparencyI recently came across a Windows platform issue using images inside an SWT table. A little research turned up <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=50163">this long-standing open SWT bug</a>. <br /><br />The problem results when you change the background color of a row in a table. I like to alternate colors on the rows in my tables, so I create a LabelProvide like this:<br /><br /><pre style="border: 1px solid blue; overflow: auto;"><br />private class PortfolioViewLabelProvider extends LabelProvider implements ITableLabelProvider, ITableColorProvider {<br /><br /> @Override<br /> public Color getBackground(Object element, int columnIndex) {<br /> return null;<br /> }<br /><br /> public Image getColumnImage(Object obj, int index) {<br /> Image retImage = null;<br /> return retImage;<br /> }<br /><br /> public String getColumnText(Object obj, int index) {<br /> String retVal = "";<br /> return retVal;<br /> }<br /><br /> @Override<br /> public Color getForeground(Object element, int columnIndex) {<br /> return null;<br /> }<br /> }<br /></pre><br /><br />Of course, you would actually want to return some real values in those methods.<br /><br />Using a JFace TableViewer allows the table to be decorated with the listener via the setLabelProvider method.<br /><br />Under Linux, SWT uses GTK native widgets for table. An example of one of my tables looks like this:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMdmVU8n7c4BzcRY_VRCQWRuV-TTLf3TXVeEASUqsq1F1j09PdCh19Od9exLM7tpymjjk8FG1AFqdOIpx8tVN7nIyeHRLPr40kCckEQ8GsM72o2LWKFhu0dHdUIFSpIZlCQZ-Db3W86UE/s1600/image1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 397px; height: 175px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMdmVU8n7c4BzcRY_VRCQWRuV-TTLf3TXVeEASUqsq1F1j09PdCh19Od9exLM7tpymjjk8FG1AFqdOIpx8tVN7nIyeHRLPr40kCckEQ8GsM72o2LWKFhu0dHdUIFSpIZlCQZ-Db3W86UE/s400/image1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5460879178120278146" /></a><br />Make sure your monitor is set up so you see each row is a different shade--the first row is a deep gray, and the second row is black. <br /><br />The table looks fine and all of the images ( transparent png files ) are correctly displayed. Now look at the same application on Windows 7.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKLPNUepTjWV3EVQwPiga3bTlOQ0mWozUHas0Ht7q6hKcNvXsUkf7Y3Ua2vgrnrl7kibk7cRDZdLeVLcLRJ0gU_qpFUrRqeIOOt76x19jIY6pE8kcQMc0P4ZPZShHvwiFUs8h911KFCIg/s1600/image2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 367px; height: 159px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKLPNUepTjWV3EVQwPiga3bTlOQ0mWozUHas0Ht7q6hKcNvXsUkf7Y3Ua2vgrnrl7kibk7cRDZdLeVLcLRJ0gU_qpFUrRqeIOOt76x19jIY6pE8kcQMc0P4ZPZShHvwiFUs8h911KFCIg/s400/image2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5460881544182430018" /></a><br />Notice the images have black backgrounds now which is the background of the table. The transparency mask in the png is ignored--annoying and ugly. Look closely at the circled area to see the problem.<br /><br />Luckily, with a little help from old posts in that bug and some trial and error, I came up with an easy fix that works for Windows and Linux. Using the same label provider as above, we can get the row color during the SWT.EraseItem event and erase the area with the same color used for the row:<br /><br /><pre style="border: 1px solid blue; overflow: auto;"><br /> topPortfoliosViewer.getTable().addListener(SWT.EraseItem, new Listener() {<br /> @Override<br /> public void handleEvent(Event event) {<br /> event.gc.setBackground(plp.getBackground(event.item.getData(), event.index));<br /> event.gc.fillRectangle(event.getBounds());<br /> }<br /> });<br /></pre><br /><br />And the result on Windows 7:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZIZ9DexvOKCPs7S9weNow2hxe2z4KDATGXmreQSTPcJ4MH_o0yM3LvUmEPusTWaI2xNRWVWcMDUlBbnSk19lFCv-G-YSLH5DqID1VzeoBlSkPmgQ7Jhpllo_ObeOrOxboNXMhl2nz7Rg/s1600/image3.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 367px; height: 162px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZIZ9DexvOKCPs7S9weNow2hxe2z4KDATGXmreQSTPcJ4MH_o0yM3LvUmEPusTWaI2xNRWVWcMDUlBbnSk19lFCv-G-YSLH5DqID1VzeoBlSkPmgQ7Jhpllo_ObeOrOxboNXMhl2nz7Rg/s400/image3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5460883826882893602" /></a><br />The result is how I want it. The images blend in correctly. I'm not sure what the real problem is here--is it Windows or Eclipse? Either way, the fix works for me, and I can continue on with development.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com3tag:blogger.com,1999:blog-1492374798042002505.post-15219438535714220842010-04-16T16:09:00.005-06:002010-04-16T17:00:49.520-06:00The Future Of OpenSolaris...Still Unwritten and UncertainI've been following the activities of the <a href="http://planet.opensolaris.org/">OpenSolaris</a> project for some time with interest. With the acquisition of Sun by Oracle, it's future is still uncertain. Since my last entry on the subject, I have only played with it a few times inside a virtual machine. <br /><br />I remember back when I was in college and OS/2 Warp came out. It was so cool and I was immediately converted. Despite the coolness factor, the conversion was short lived. I don't remember my reasoning for abandoning OS/2--maybe it was my introduction to Linux in a computer lab or the lack of OS/2's ability to satisfy my computer needs compared to Windows or Linux. Whatever the reason, I can't help but recall that experience as I now look at and ponder the fate of OpenSolaris. <br /><br />I don't think OpenSolaris has a large enough community outside of full-time, paid developers to support the operating system's advancement. Sure, there are a few different distributions out there, but these deal primarily with packaging the kernel--not low-level kernel development. As with OS/2 warp, a few cool technologies found in no other operating system (i.e. DTrace and ZFS ) will not be enough to grow the community and keep the system alive. Without a large and fully open community, a code base the size of an operating system needs some major company-backed financing to grow.<br /><br />Only time will tell the true fate of OpenSolaris. I think some years down the road I'll look back on my OpenSolaris experience and remember the brief experience with a smile and wonder what may have been.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-25449623111087948242009-11-28T10:42:00.001-07:002009-11-28T10:53:24.046-07:00GNOME Composting in OpenSolarisIf your graphics card supports it, OpenSolaris will turn on the 3D effects when you login. It does this by enabling the <a href="http://www.compiz-fusion.org/">compiz window manager</a> which replaces the default GNOME window manager, metacity. <br /><br />I only recently discovered that metacity also supports composting. It doesn't offer the feature list of compiz, but, it does provide nice drop shadows and task switcher.<br /><br />To use composting in metacity, set Visual Effect to None in the System/Preferences/Appearance dialog box. Apply the changes and your desktop will be running metacity.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5ZIBozVQEnkRjx3IQENMzzIoDc02pPuM_Xaz_aDXC1Yu6NyFVcaruFO7dy46qW2_2W8MmAH0xNXBz5hnVJKzmIkDfd_iTfArpBPtRk2EnICnt9oAqD9mKW-1GOFk91G9DxMhZdRyYcCQ/s1600/Screenshot-Appearance+Preferences.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 246px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5ZIBozVQEnkRjx3IQENMzzIoDc02pPuM_Xaz_aDXC1Yu6NyFVcaruFO7dy46qW2_2W8MmAH0xNXBz5hnVJKzmIkDfd_iTfArpBPtRk2EnICnt9oAqD9mKW-1GOFk91G9DxMhZdRyYcCQ/s320/Screenshot-Appearance+Preferences.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5409209091302147906" /></a><br /><br />Next, run this command to enable composting in metacity:<br /><br /><pre style="padding:5px;border: 1px solid blue; overflow: auto;">gconftool-2 -s /apps/metacity/general/compositing_manager -t bool true</pre><br /><br />and you can run this command to turn it off:<br /><br /><pre style="padding:5px; border: 1px solid blue; overflow: auto;">gconftool-2 -s /apps/metacity/general/compositing_manager -t bool false</pre><br /><br />Here's a simple snapshot showing the shadows:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOzcCucyYHCLc-ILWOF8whHK4UqyqdK2Ye98RVllpPmDAQYCVt9vdqhm-4sIul0-hsl5mYhhT0J6Iqj9f7V4NKDzVS3PjWB5Sk8MSEQYn6AYPxnj8AKDSr4Yugi-xcmK0sqYjgk6AwIVU/s1600/metacity-composting-on.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 319px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOzcCucyYHCLc-ILWOF8whHK4UqyqdK2Ye98RVllpPmDAQYCVt9vdqhm-4sIul0-hsl5mYhhT0J6Iqj9f7V4NKDzVS3PjWB5Sk8MSEQYn6AYPxnj8AKDSr4Yugi-xcmK0sqYjgk6AwIVU/s320/metacity-composting-on.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5409212238622928194" /></a><br /><br />If you really like tweaking your desktop, compiz works very well and provides lots of features. If you're happy with drop shadows and a nice tab switcher, metacity+compositing will do the job nicely.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-68208918826087056712009-10-11T20:43:00.002-06:002009-10-11T21:34:43.572-06:00OpenSolaris Performance Issues ResolvedI've been playing with some soon-to-be-released operating systems--notably Open Suse 11.2 and OpenSolaris 2010.02. I always really enjoy OpenSolaris when I run it in a virtual machine under Linux and I enjoy working on Solaris workstations at my employment. I've tried OpenSolaris on and off over the past several months on my home computers. When I've installed it directly onto a partition and run it directly on bare metal, I've noticed performance issues and I've gone back to Linux as the primary OS.<br /><br />In my latest endeavors of running OpenSolaris, I noticed that the disk io seemed to be the performance killing culprit. Doing simple disk io tests under both Linux and OpenSolaris, Linux was just destroying the io numbers I was getting under OpenSolaris. My test was a simple "dd if=/dev/zero of=test bs=4048 count=100000 conv=fsync"--nothing fancy, but enough to demonstrate an issue. Linux numbers were around 60 MB/s while OpenSolaris numbers were in the 15-20 MB/s. No settings helped out the OpenSolaris numbers--dd block sizes, file system block sizes, zfs settings, etc. Interestingly enough, on an older computer, the disk io was just fine under OpenSolaris, so why was it so slow on newer/faster computer?<br /><br />I was almost ready to give up and wipe the OpenSolaris partition once more, but I had one last area I had not tried. I remembered the SATA settings that are within the bios settings of my Intel motherboard. I changed the SATA mode from Legacy to AHCI. Sure enough, my OpenSolaris hard drive speeds were now on par with Linux. Inspection of the loaded modules showed that OpenSolaris had loaded the ahci driver. Additional online research shows that one should set the mode to AHCI for OpenSolaris.<br /><br />I'm definitely happy with the results on all 4 home machines. 3 diverse desktop models and 1 laptop are running very smoothly. I'll plan on detailing some lessons learned and tutorials in the near future.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-41984752903419341092009-07-01T17:26:00.003-06:002009-07-01T18:17:41.444-06:00OpenSolaris 2009.06 Progressing QuicklyPreviously, I spoke of my <a href="http://opensolaris.org/os/">OpenSolaris</a> experiences. Over the past week, I've been on vacation, and I decided to try the latest release out to see how it's moving along. I installed version 2009.06 over my laptops Fedora installation. Installation was once again very simple--just a few questions, and it was off installing. I typically choose to use the entire drive as a single ZFS pool. OpenSolaris does not support disk encryption out of the box like Fedora or other Linux distributions, but <a href="http://www.opensolaris.org/os/project/zfs-crypto/">work is underway</a> in this area. <br /><br />After the initial install, I immediately upgraded to the development repositories to bring in the more more bleeding-edge stuff( Fedora is pretty bleeding edge too ). An update and a reboot into the new boot environment, and I was up and running. <br /><br />I discovered there are a few really nice new features and surprises in the latest builds.<br /><br />First off is the integration of the <a href="http://www.opensolaris.org/os/project/opensound/">new sound system--Boomer</a> for OpenSolaris. This is now all integrated with the latest development builds. Sound playback worked wonderfully on my Laptop. In flash videos and playback in general under the previous sound system, sliding the volume control up and down caused serious pauses and stutter. The new sound system works much more smoothly and I noticed no more pauses or stutters while changing the volume. I have noticed that I get no headphone sound right now on my laptop, but overall, the new sound system is a nice improvement.<br /><br />The next thing I noticed was the brightness control finally works on my laptop. The hotkeys don't work, but the Gnome brightness applet allows me to control the brightness. This was a major drawback of previous builds, since the only solution seemed to be a Linux live cd boot to fix the brightness.<br /><br />Just a few days ago, I notice that <a href="http://mmartinsoftware.blogspot.com/2009/02/opensolaris-wireless-disappoints.html">my other major gripe</a> has been fixed too--drivers for my two home computers wireless cards are <a href="http://www.opensolaris.org/os/community/laptop/wireless/rwd/">now available</a>! I'll be testing this out soon, since this means I have the option to put OpenSolaris on two home computers without hardware upgrades.<br /><br />As I've moved around to different Wifi points, the Network Manager has had no problems connecting up to the different access points automatically using WPA2 and WEP encryption. I've had fewer issues with the automated OpenSolaris Network manager than the Fedora network manager.<br /><br />As far as usability, my laptop experience has been far more pleasant than previous versions of OpenSolaris. With <a href="http://eclipse.org/">Eclipse Galileo</a> builds supporting OpenSolaris ( 32 bit ) as a first class citizen, my development IDE needs are met.<br /><br />Off the top of my head, there are three areas still lacking when comparing OpenSolaris to modern Linux distributions. <br /><br />The first area is one I mentioned earlier--ZFS/filesystem encryption. I prefer, and many companies now require laptops to have encrypted hard drives. At the rate things are moving in the OpenSolaris development, I suspect this will no longer be an issue in the months to come.<br /><br />The second area lacking is multimedia support. The issue here is a licensing issue where OpenSolaris can not ship with codecs to provide mp3 playback or encrypted dvd playback support. Attempting to play such media pops up an information box allowing one to get the mp3 from <a href="http://www.fluendo.com/">Fluendo</a> for free or to pay for the suite of codecs ( I'm not even sure if this package will allow dvd playback). An alternative solution is to download the latest <a href="http://www.mplayerhq.hu">MPlayer</a> source code and compile the code. There were a few issues getting MPlayer to compile, but drop me a line if you need help. Once MPlayer was compiled with Xv support, I was able to play back some dvd's though I did see an annoying video stutter happen every few seconds. I suspect one should also be able to compile the gstreamer plugins that provide the proper mp3 and video codecs too, though I've not gotten to try that yet.<br /><br />The final area is performance. Linux has made great strides in the last year in performance. Boot time races between Ubuntu and Fedora have made a very noticeable difference for Linux users who run laptops or desktops and pay attention to the boot up time. OpenSolaris is not quite there on startup time. It still takes a bit longer to get to a login screen compared to Fedora 11 or Ubuntu 9.04, however, it's not terrible. The first OpenSolaris bootup after install is a lot longer than subsequent boot times, so don't give up right away if startup times are important to you. Shutdowns are fast enough to not be an issue for me. The desktop is very responsive, though I do see some waits when say trying to open a new terminal while un-tarring a large file. Linux has been tuned to provide a snappy desktop response in most distributions now, I suspect there are some kernel knobs in the OpenSolaris kernel or ZFS settings to help out here too. For the most part though, I find OpenSolaris as responsive now as I find Linux, but I think Linux still has a slight out-of-the-box advantage here.<br /><br />OpenSolaris 2009.06+ is already much better that the 2008.11 version I tried earlier. Six months has brought in new drivers and new functionality for the desktop. As Oracle hopefully continues to support the effort, I think the future is holding a definite spot for OpenSolaris. Give it a shot and try it out.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-74189322410832133782009-04-30T15:11:00.005-06:002009-04-30T15:20:28.086-06:00Linux Kernel 2.6.30 Fixes Filesystem Latency IssuesAfter reading the post <a href="http://www.h-online.com/open/Kernel-Log-What-s-coming-in-2-6-30-File-systems-New-and-revamped-file-systems--/news/113157">Kernel-Log-What-s-coming-in-2-6-30-File-systems-New-and-revamped-file-systems--/news/113157</a>, I saw improvements were made to problems with the Linux kernel regarding slowness under heavy disk I/O.<br /><br />After running 2.6.30-rc3, my computer no longer grinds to a halt under large amounts of disk I/O.<br /><br />My only legitimate reason to abandon Linux for another OS ( BSD, Solaris ) has been resolved.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-23510567098736888112009-02-27T16:21:00.003-07:002009-02-27T16:29:35.316-07:00Pixie Hollow Flash Problems With Linux ReturnIt seems the folks at Disney's Pixie Hollow site now force everyone to use the Flash 10 player to hit the site. Since the combination of Flash 10 and Linux fail on this site ( see my earlier post <a href="http://mmartinsoftware.blogspot.com/2009/01/flash-linux-and-pixiehollow.html">here</a>, my kids are out of luck until this is resolved. <br /><br />This is the only site I have ever seen that fails to be cross-platform/Flash compliant. If I were real ambitious, I'd investigate it further. But for now, telling my kids to play on another site works just fine.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com3tag:blogger.com,1999:blog-1492374798042002505.post-39910338331582686932009-02-27T15:50:00.004-07:002009-02-27T16:21:05.998-07:00OpenSolaris Wireless DisappointsIn yet another attempt to play with the latest OpenSolaris builds, I was sorely disappointed when I went to get the wireless card working. <br /><br />A desktop had been giving me hard freezes with the latest Debian install, so I threw on OpenSolaris to see if that would help. Only after a complete install did I come to find out the Linksys WMP54G ( RT2561/RT61Chipset ) is not supported under OpenSolaris. This is a few common card I've picked up at my local Best Buy.<br /><br />In one last attempt to fix the freezing system, I threw on Ubuntu. Ubuntu is a little nicer about discovering and automatically installing proprietary drivers, so it put on the Nvidia drivers. I noticed it was using a different version of the drivers. <br /><br />A re-install of Debian Lenny with the legacy 173.14.xx Nvidia drivers and I have yet to have a freeze.<br /><br />Linux wins again.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-27427813579843458632009-01-25T18:30:00.005-07:002009-01-25T18:50:22.304-07:00The KDE 4 to GNOME SwitchI was happy to see the latest news that <a href="http://www.computerworld.com/action/article.do?command=viewArticleBasic&taxonomyName=Software&articleId=9126619&taxonomyId=18&pageNumber=1">Linus switch to GNOME</a>--a move I made and blogged about previously. <br /><br />While testing out KDE4 and deciding on GNOME, I kept thinking, "...but if <a href="http://mail.gnome.org/archives/usability/2005-December/msg00021.html">Linus prefers KDE</a>, I must be missing something." <br /><br />Anyway, the word on the street is that "KDE 4.2" is the "KDE 4" we've been waiting for. I'll definitely give it a spin and see. <br /><br />I think KDE 4 visually looks great--even when in non-compiz/non-accelerated mode--the widgets and desktop look good. <br /><br />In order for GNOME and KDE to compete with modern OS's, they need to look and behave like other modern desktops. The non-compiz GNOME desktop is starting to look dated to me, and I just don't trust a compiz-enabled GNOME desktop to be stable enough--based on my most recent Fedora 10 testing. Sure you can run compiz and change out panels and add cool applets, but that's a lot of work especially for the non-techie desktop user. Out-of-the-box, KDE 4 just looks modern, though it's been buggy and lacking in usability.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-42111412461709505132009-01-25T18:00:00.002-07:002009-01-25T18:28:58.730-07:00Flash, Linux, and PixieHollowSo I decided to try a little experiment and move some household computers over to Linux. Going into it, I figured there wouldn't be too many problems. The games played by my kids are, for the most part, online games developed in Flash. With Flash 10 now readily available for Linux on 32 and 64 bit machines, Linux would be on par with Windows Flash functionality.<br /><br />With the computers now happily booting into Debian, I had one of my children log in to test it out. Wouldn't you know it, the latest online Flash-based game <a href="http://pixiehollow.go.com/">Disney's Pixie Hollow</a> failed to load. Everything looks fine until you get a strange error message about it losing the login information.<br /><br />After trying several different combinations of Firefox and other browsers I found a solution.<br /><br /><span style="font-weight:bold;">Solution:</span>Use a Flash 9 version of the Linux plugin--not the latest Flash 10 plugin. From there, everything has worked fine.<br /><br />On a 64 bit Linux install, this means running a 32-bit version of Firefox with the Flash 9 plugin. Running nspluginwrapper didn't work either, so I stuck with the 32 bit Firefox / Flash 9 combination.<br /><br />To date, all the online Flash games play great and are indistinguishable from their Window's counterparts on the outside. Of course, I sleep better knowing what's driving the code.<br /><br />Locating older versions of Flash to download was little tricky, so <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14266&sliceId=2">here is the link</a>.<br /><br />So far, no major complaints from the family on the migration. I still have a Windows machine for iTunes and a few other Windows games floating around. My goal will be to move that functionality to Wine or VirtualBox in the very near future.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com1tag:blogger.com,1999:blog-1492374798042002505.post-88558712526331161932009-01-07T19:11:00.003-07:002009-01-14T22:26:00.882-07:00Linux 64 bit disk IO PerformanceYou may be asking yourself why I've even bothered looking at other operating systems if Linux with an accompanying distro does everything I need. The answer is that Linux has two main problems that have been driving me crazy lately--no glitch free audio and terrible responsiveness when copying large files.<br /><br />The audio problem is well known, and efforts have been underway to address the issue. I think the Linux audio playback is getting better now with PulseAudio, so this issue doesn't bother me as much any more.<br /><br />The disk io responsiveness issue is less known. The issue appears when copying lots of or large amounts of data on a 64-bit kernel. The kernel load escalates to the point the system is unresponsive ( the load climbs up to 9+ on a beefy machine with a single copy command running). This is the primary reason I started looking at other operating systems.<br /><br />A few days ago, I came across <a href="http://bugzilla.kernel.org/show_bug.cgi?id=7372">this linux kernel bug</a> entered over 2 years ago. Interestingly enough, the load only escalates when I boot up using a 64 bit kernel--the 32 bit kernel is fine. I'm planning to jump onto <a href="http://bugzilla.kernel.org/show_bug.cgi?id=12309">this related kernel bug</a> and see if I can offer testing or other support here shortly.<br /><br /><br /><span style="font-weight:bold;">Follow up 1/14/2009</span>: Looks like there's some progress on the performance bug. A Slashdot article <a href="http://it.slashdot.org/article.pl?sid=09/01/15/049201">here</a> explains more.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-10919126352879969922009-01-07T17:30:00.007-07:002009-01-07T19:11:54.973-07:00FreeBSD 7.1 Laptop Experience<a href="http://www.freebsd.org/">FreeBSD 7.1</a> was release a few days ago. I gave it a run on my x86 laptop over the past few days, and I really liked everything I experienced. Here are a few quick bullets on what I focused on and encountered:<br /><ul><br /> <li><span style="font-weight:bold;">Stability</span> -- No problems. The OS ran fine, and I never had to force a reboot. I did have to force a power off once or twice--GNOME hung on a shutdown menu command.</li><br /> <li><span style="font-weight:bold;">Audio</span> -- The audio experience on FreeBSD was glitch free despite any other tasks I was running.</li><br /> <li><span style="font-weight:bold;">Flash 9 support</span> -- I got flash 9 running in a native FreeBSD Firefox browser using nspluginwrapper. Flash audio worked fine too, and I didn't have any crashes or other stability issues.</li><br /> <li><span style="font-weight:bold;">Java Support</span> -- I had a native JDK 6 running fine with Netbeans 6.5. I read that Glassfish would also work, but never installed it.</li><br /> <li><span style="font-weight:bold;">USB Yank Support</span> -- This is a nit-pick for server usage, but I consider it a critical bug for desktop usage. If you yank out a mounted USB drive on FreeBSD and try to force an unmount, the kernel blows up and hangs. I did come across a post somewhere that this is now being addressed by the <a href="http://www.freebsdfoundation.org/">FreeBSD Foundation</a>. Yay!!!</li><br /> <li><span style="font-weight:bold;">Misc. Stuff</span> -- The only thing I really missed from Linux to FreeBSD on the laptop was the extra buttons support. OpenSUSE installed the necessary stuff to make the laptop's mute/volume/brightness buttons work out of the box. FreeBSD supplied the necessary module to control my laptop's brightness, but I would need to research on how to tie the buttons into brightness and volume control functionality. I also don't know if this is really a kernel issue or a user space program issue. My guess is I could probably make the buttons work by installing some user space programs and configuring GNOME.</li></ul><br /><br />FreeBSD would support all my computing needs, but there is still one major issue holding me back from full adoption--NVidia driver support on x64 architectures. It's unclear who exactly to blame for this. NVidia is waiting on FreeBSD full kernel support to handle the binary NVidia driver, and the kernel developers are not focused on making the extensive changes required to fully support the driver. While progress is being made, it's a slow process ( over 4 years now ). Just check out <a href="http://www.nvnews.net/vbulletin/showthread.php?t=41545">this nvnews thread</a> for the ugly details. <br /><br />One solution I have would be to run the 32 bit FreeBSD kernel. The problem I have here is the machine has >4GB of memory. Now, FreeBSD supports <a href="http://en.wikipedia.org/wiki/Physical_Address_Extension">PAE</a> to address all the memory, but FreeBSD does not support loadable kernel modules with PAE. I'm unable to convince myself to yank some memory out of the machine to make the graphics card work. I'd even be willing to sacrifice 3d support if I could get decent 2D dual headed DVI support in a 64 bit kernel. From reading the forums, this seems iffy too using either the nv or nouveau open source nvidia drivers. <br /><br />It seems myself and many other "would-be" 64 bit NVidia FreeBSD users are out of luck for now.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-78354040210465559712008-12-27T11:59:00.003-07:002008-12-27T12:07:07.356-07:00OpenSolaris No More (again)After getting most everything up and running, I finally got a chance to "work" on the OpenSolaris machine. Unfortunately, I was less than impressed with the desktop performance--even with the zfs memory changes. The desktop became sluggish to me. <br /><br />I can sleep well now knowing I gave OpenSolaris a good, fair comparison to Linux for what I needed. Linux ( OpenSuse 11.1 ) comes out on top as the winner for me in performance, routing/nat capabilities, device driver support and best overall server/workstation experience.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com1tag:blogger.com,1999:blog-1492374798042002505.post-79429665606525731312008-12-26T13:43:00.003-07:002008-12-26T14:15:27.009-07:00OpenSolaris Audio And MemorySound is now working. I installed the latest <a href="http://www.opensound.com/solaris.html">OSS</a> package. After a reboot, the update did not fix the sound issue--the card was still not recognized. I then tried source files, but had issues getting it to build. Un-installed the oss package, rebooted, and the audio worked. I can't explain what changed, but audio is now working on an Intel Corporation 82801JI (ICH10 Family) HD Audio Controller just fine.<br /><br />OpenSolaris is getting a <a href="http://www.opensolaris.org/os/project/opensound/">new sound engine</a>--let's hope it works better than the <a href="http://www.matusiak.eu/numerodix/blog/index.php/2008/12/19/linux-audio-confusing-as-ever/">various Linux offerings</a> we've struggled with over the years.<br /><br />I did have to reboot the OpenSolaris box this morning. For the second day in a row, all the memory was used up in the morning, and the machine became completely un-responsive. I came across the post <a href="http://solarisdesktop.blogspot.com/2008/11/where-is-memory-gone.html">Where is the memory gone?</a>, and I applied the limits to the ZFS cache. Hopefully, that will fix the problem.<br /><br />The machine has been running great other than the memory issue. I have NAT and Firewalls working now too.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-52778811179364898562008-12-22T15:32:00.003-07:002008-12-22T15:48:03.611-07:00OpenSolaris with Blender 3D, Fetchmail, Sendmail, Procmail , Dovecot, and the GimpToday I got the OpenSolaris install a few steps closer to the replaced Linux install. I compiled Blender 3D, the Gimp, Procmail, and Dovecot--a few issues with Blender compiling, but then a Wiki explained how to build on OpenSolaris. <br /><br />OpenSolaris already has fetchmail and sendmail packages in the main repo, so it was a matter of configuring sendmail to use the procmail mailer. The hardest part was figuring out how to make procmail use Maildir format. The answer was simple: <br /><br />in /etc/procmailrc add this line:<br /><br />DEFAULT=$HOME/Maildir/<br /><br />The trick was the "trailing" slash to tell procmail to use maildir format. The man page for procmailrc clearly states so. I'm sometimes to quick to google something before RTFM, and what is really a simple solution becomes overly complex by endless online searches.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com2tag:blogger.com,1999:blog-1492374798042002505.post-74040873548254484392008-12-21T16:42:00.005-07:002008-12-21T18:12:39.232-07:00OpenSolaris 2008.11 Revisited<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeasBXDqkJV-nfc1mju4o-A_Wtdzlp7ZDKBZoL7fUhlpmIDxTSCy8AuX50abCMrS4FhuoEUYq4T-smZ4kQIQElpx6z9OOGO4RtAw4TTd7zQ19yZ1PumJdtQmUpauhuUcczWgM6ls2l8iU/s1600-h/Screenshot.png"><img style="cursor:pointer; cursor:hand;width: 400px; height: 125px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeasBXDqkJV-nfc1mju4o-A_Wtdzlp7ZDKBZoL7fUhlpmIDxTSCy8AuX50abCMrS4FhuoEUYq4T-smZ4kQIQElpx6z9OOGO4RtAw4TTd7zQ19yZ1PumJdtQmUpauhuUcczWgM6ls2l8iU/s400/Screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5282415850824686674" /></a><br /><br />Picture of OpenSolaris 2008.11 Desktop.<br /><br />I last spoke about my encounters with OpenSuse, FreeBSD, and OpenSolaris. After writing that entry, for some reason, I kept thinking about my encounter with OpenSolaris. Maybe it was that I'm back on Solaris machines at work, or maybe it was the small OpenSolaris icon Firefox mistakenly replaced on one of my always visible bookmark links. Either way, I've decided to give it another go--this time diving in.<br /><br />Initially, I ran it for a few days on my laptop. The primary purpose being to get more familiar with its capabilities as a desktop machine. Once I was satisfied and more familiar with it's capabilities, I wiped my "just-updated" OpenSuse 11.1 off my main home computer. My experience is still a work in progress, however, I am very happy with it so far. It does have a learning curve--even for an experience Linux user, however, I think it will be worth it.<br /><br />Here are some high level thoughts in various areas:<br /><br /><u>Install Experience:</u><br /> Very simple, if not easier than the most recent Linux Fedora/OpenSuse distros. The most complicated piece for me was partitioning--the install gui does not let do any advanced partitioniong, so you must bring up a command terminal and run the "format" command. While text-based, the entire format/fdisk capabilities are very easy for anyone with any fdisk or parted experience.<br /><br /><u>Startup Experience:</u><br /> I _really_ like the whole service-based system as opposed to the rc.d/init.d scripts. Once you learn the svcadm and svcs commands, it's really cool. Services are managed very well and each has a dedicated log file. Failed services go into a maintenance mode where an admin can diagnose and restart. The initial boot time was slow, however, future boots are much faster. Linux users familiar with grub will be right at home. OpenSolaris uses grub with the additional Boot Environment capabilities to manage multiple "versions" of the installed software on the zfs file system--very nice for user updates and kernel updates.<br /><br /><u>Initial Desktop / Network Experience:</u><br /> OpenSolaris ships with NVidia drivers, so it was a few mouse clicks to have the initial desktop up and running with Compiz on a dual-head display. The desktop network icons work fairly well to automagically attach to wireless or cabled networks. I had a few issues with wireless, so I had to come up to speed with ifconfig and dladm. The nice thing about both tools is they are very well documented in man pages and online docs. <br /><br /><u>32 / 64 bit differences:</u><br /> This was hard to figure out--most Linux distros you just download the 32 or 64 bit installer, then you have that version installed. Of course 64 bit installs run 32 bit code. OpenSolaris is a little different. It's a unified OS, so the installed installs 32 and 64 libs. During the boot, the system figures out which kernel to boot.<br /><br /> Now, even though my kernel is 64 bit, when I launch firefox, it's the 32 bit version. Many programs have 32 and 64 bit version, so my guess is you can choose you desired architecture on many programs. Look for the bin/amd64 and lib/64 folders to get an idea--I'm still figuring this out.<br /><br /><u>Software and Updates:</u> <br /> The IPS ( network based package system ) does a decent job of updating packages. One of the criticisms of OpenSolaris is the available number of software packages. Even from the Linux crowd, you come across this argument from time to time ( shame on you ). It is noteworthy to see the available number of packages already available. I did feel that many of the packages on BlastWave and other repos were just too old. Any experienced Linux user would realize that the argument of "Distro X has 10k packages and OpenSolaris only has a fraction of that" is not really an argument. Linux was in the same boat just a few years back, and OpenSolaris ( IPS infrastructure in place now ) will catch up quickly. In addition, all one has to do ( just like we all did a few years ago on Linux ) is to download the source code to a package with its dependencies-- a few ./configure / make / make install commands later and it's there.<br /><br /> I did this on OpenSolaris and now have running dansguardian, openldap, mplayer, postgres, squid, kdelibs, kmymoney, and others. Some of these do have pre-compiled packages--I chose to get more recent versions the old fashioned way. Needless to say most compiled without incident--and using 64 bit flags or 32 bit flags where I desired. <br /><br /> Bottom line is don't let the current list of available pre-packaged software hold you back--if you know how to build src pacakges, you're set. Otherwise ask around or just give it time.<br /><br /><u>Device Driver Supprot</u><br /> I have 2 issues with device driver support. The first is audio on the ICH10 hd intel chip. The second is printers. I believe the audio is being looked into now. OpenSolaris printing gives you 2 options ( the default lp service or CUPS). Switching between the two is simple ( print-service command ). Under lp, I printed fine to my laserjet, but not to the hp inkjet. Both printers were detected fine. Under CUPS, neither printer worked--I believe there is a known CUPS issue with USB printers.<br /><br /> I'm not too concerned here, as even the latest Linux distros suffer from audio issues or other device problems. Linux does support more devices right now. Given how far OpenSolaris has come in the past 6 months, I think 2009 will be a huge package/support device year for OpenSolaris.<br /><br /><u>Advanced Networking</u><br /> I use a few advanced Linux networking features--namely virtual networks, bandwidth throttling, firewalls, and NAT routing. I have not got my OpenSolaris box doing this yet--I have to learn how to do this on OpenSolaris. I think firewalls and NAT are already there. Bandwidth control and virtual network cards are part of the OpenSolaris CrossBow project. Just recently, the capabilities were merged into the OpenSolaris kernel. I did the Linux equivalent of a kernel update on my laptop to learn how. My next big step will be to do it on this server. More to come in this department.<br /><br />To summarize: <br /><br />Is OpenSolaris ready for the desktop? <br />...YES. As ready as Linux is. You could set up an OpenSolaris box for any non-techie member of your family, and they could surf the web, get emails, write documents, etc. Linux and OpenSolaris still can not satisfy one's need for IPOD sync, camera photo management without a knowledgeable Unix go-to-guy to call.<br /><br />Is there a Linux to OpenSolaris learning curve and initial struggle?<br />...YES. However, it's much less that say a Windows to Linux/BSD/Solaris conversion.<br /><br />Is the struggle worth it?<br />...YES. For me, I'm very impressed and happy. I certainly don't want to say Linux is better or BSD is better or OpenSolaris is better. Choice is good and so is competition -- even in an open source world arena. I'm not sure why I like OpenSolaris. All I can say is it just feels good. I don't get too caught up in the licensing differences and arguments. If I can run it at home and at work and it's open source, I'm satisfied. It's also refreshing to have an excellent performing, stable OS capable of running my favorite open source programs with a company like Sun behind it. I sort of feel like the days when I switched from Windows to OS/2 Warp 3.0. Although Solaris has been around for a long time, to me, it feels like an evolutionary step forward. I still have lots to learn here too.<br /><br />I'll be adding posts related to this migration experience as I learn more and become more familiar with OpenSolaris.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-49579559450399285892008-11-29T09:52:00.005-07:002008-11-29T10:44:38.838-07:00Fedora, OpenSuse, FreeBSD, OpenSolarisI've been running Fedora for some time at home and on several work computers--most recently the latest Fedora 10 development branches. I ventured out to try OpenSuse, and brought in Beta 5. I must admit, I was blown away. I had last run OpenSuse a year or so ago, and was not as impressed as I was with Ubuntu at the time. In case you're wondering my preferred Linux distro goes something like this ( this goes back a ways )<br /><br />Slackware->RedHat->Gentoo->Ubuntu->Fedora->OpenSuse<br /><br />Even given all the hype around the recent Fedora 10 release, I am still much more impressed with OpenSuse. I prefer zypper more than yum, and YaST2 either in console mode or graphics mode is much nicer than anything I've seen in Fedora or any other distro I've tried.<br /><br />Earlier I posted about Fedora directory server and openldap. Well, I'm running OpenLDAP now and very happy with it. Fedora still has the nice gui admin tool. I stumbled on OpenSuse's User and Group Management tool which fully and graphically supports a back-end ldap configuration. So, it's easy to manage your ldap users with OpenSuse!<br /><br />OpenSuse is well polished, looks great, easy to install ( again the best installer I've used ), the DVD even has graphical tools that analyze and help you fix a broken system.<br /><br />Bottom line, if you haven't tried OpenSuse, I'd recommend trying release 11.1. <br /><br />In my spare time the last few days, I also tried out FreeBSD. I ran it on my laptop for a few days and was impressed--getting to know the system and how it worked in comparison to Linux. I often try testing things out first in a virtual machine, but I don't think you really know an OS until you run it on bare hardware--especially with things like 3D acceleration support and hardware support.<br /><br />I eventually decided I would really test it out, and cleared of my home server/workstation--could FreeBSD support everything I needed??? The first road block I hit was no NVidia 3d support on the AMD64 bit platform. Even though I checked NVidia's site, I somehow missed the i386 on the driver listed. Ok, I'll through on the i386 FreeBSD version. Well, this time I realized that virtualization products ( like VirtualBox I use ) have not been ported to any BSD. I do like running VirtualBox on my Linux system. We'll, as much as I wanted to really dig deep and run FreeBSD, I decided against it--I could have lived without VirtualBox, but knowing I had full 64 bit 3D support on Linux and VirtualBox, I decided Linux suited my needs better.<br /><br />Next stop...OpenSolaris 2008.11. I'd run 2008.05, but had to ask myself what it really gave me over Linux outside of ZFS and DTrace which I can personally live without. I installed 2008.11 on my workstation. OpenSolaris has a great installer--very simple. Booting up caused me a little pain, because the installer did not overwrite my previous OpenSuse boot loader. I had to wipe out the MBR, reinstall, then it was fine.<br /><br />OpenSolaris 2008.11 booted up into Gnome and it looks great. It immediately identified my printers ( both HPs ), but I had no full sound card support. I ran it for a bit, but was again asking myself, "do you really want to go through the trouble. Re-compiling from scratch all the packages you just get with a standard Linux distro. Installing add-on packages just to get features you get out of the box with Linux like firewalls, traffic shaping, network virtualization??" Not that those couldn't be done with OpenSolaris, but again I asked myself "why go through the pain?" when Linux already does it and does it very well. The answer was "no", and I am back with OpenSuse. <br /><br />OpenSolaris and FreeBSD are great operating systems, however, Linux has come a long way and has so much to offer me today.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com3tag:blogger.com,1999:blog-1492374798042002505.post-56120478940606102102008-11-27T10:35:00.003-07:002008-11-27T11:10:41.396-07:00Encoding Video Using Mencoder for the Xbox 360 with AC3 5.1 Surround SoundSome time ago, I spent a lot of time learning how to encode video using the <a href="http://www.mplayerhq.hu">MPlayer</a> encoder mencoder. I eventually found settings that worked, but the final video did not support AC3 ( 5.1 ) surround sound.<br /><br />The question came up to me the other day about the Xbox's ability to play back 5.1, and I thought I would revisit the issue. I found an existing video on the net the said it was an AVI for the Xbox with 5.1 sound. Sure enough, I threw it on a usb drive, plugged it in, and had 5.1 surround sound.<br /><br />I looked at the specs of the file, and after a few trial and error attempts, I had a dvd converted and playing back on my Xbox 360 in full glorious 5.1 surround sound.<br /><br />The magic command I use is:<br /><br /><code>mencoder dvd://1 -ovc lavc -oac copy -channels 6 -lavcopts vcodec=mpeg4:threads=2:vbitrate=4500:autoaspect:turbo:mbd=2:trell=1:vpass=1 -o test.avi -ffourcc xvid -mc 0 -noskip -vf scale=854:480,softskip,harddup -ofps 24000/1001</code><br /><br />This command produces an avi file with a variable-rate mpeg4 video and a 5.1 AC3 audio channel. <br /><br />A few interesting points on the command. I use two-pass encoding. So, you'd have to run the command 2x changing the vpass to 2 on the second run. Even though I told it to copy the stream, unless I specifically added the "-channels 6" command, mencoder only encoded 2 channels. Another issue is that you have to force the FOURCC to xvid. The final issue I had was the aspect ratio. Without forcing the scale to 854x480 ( 16/9 DVD ), the Xbox would not scale it to 16/9. mencoder allows the -aspect flag, however, as the mencoder man page states, it is only recognized by mplayer. So, scale the video while encoding it, and it plays back fine.<br /><br />There are lots of other options to mencoder--it's got to be the most complex command I've ever seen. The documentation for mplayer is great, so check there if you have questions.<br /><br />If anyone knows how to or can figure out if you can encode H264 videos using avi or mpeg format with a 5.1 audio channel, drop me a line. <br /><br /><a href="http://handbrake.fr/">Handbrake</a> is another great tool for converting videos. They have an XBox 360 preset, but it looks like it only supports faac two channel audio with x264 video. Handbrake is great since it auto-crops the video. Using mplayer/mencoder, I have to play the video first to figure out if it needs cropping and to get the correct cropping parameters to pass into mencoder.<br /><br />Now, if only I had a huge server farm to encode my DVD collection.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-49527535675406448322008-10-12T22:00:00.003-06:002008-10-12T22:27:07.939-06:00EXT3, EXT4, JFS, XFS Weekend EncountersSometimes I'm a gluten for punishment when it comes to technology. My self-inflicted punishment this weekend was spending time formatting and copying data using xfs, jfs, and ext4 filesystems under Linux.<br /><br />It started out several days ago when I got the itch to move from ext3 to a different filesystem to test the performance. I've been through this before, but it had been a while. I was tempted to try ext4 right off the bat, but decided to try xfs. I ran xfs for several days, and I really liked it. However, in an effort to fix my sound card not living up to Fedora's 10 promise of glitch-free audio ( this is another story in and of itself ), I had to hard-reboot my computer and ended up with a 0-length file on an opened file. This is not unusual for an unclean shutdown of xfs, so I wasn't mad, but decided to try jfs. A few reboots later, and a lot of time sitting around waiting to backup/restore a 90+GB root partition, jfs was up an running on the root partition. No problems, but I then came across the ext3 options for "xfs-like and jfs-like" behaviour by adding data=writeback,nobh,commit=30 mount options. So, back to ext3 with those options, and I was impressed. No official benchmarks to post, but it felt good and I was back on an ext filesystem.<br /><br />After running ext3 for a while, I realized Fedora Rawhide had moved from ext4dev ( the pre-release ) to ext4. Why not, I already had the data backed up, so...reboot, rsync, mkfs.ext4, and a cp and I was back up running ext4 with the "data=writeback,nobh,commit=30" mount options. <br /><br />While these mount options are a little more risky on hard reboots, it appears the worst that should happen is stale data--not a 0 byte file like xfs was so kind to produce. I can live with old data, but corrupt data is where I draw the line.<br /><br />So far, the ext4 is blazing fast. It's running over a software raid 0 config. On the first reboot, the raid device forced a fsck. I was very impressed the 150GB partition fsck finished in less than a minute--compared to the several minute fsck the ext3 partition took on it's initial boot.<br /><br />ext4 is the filesystem of choice for me now.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com1tag:blogger.com,1999:blog-1492374798042002505.post-48144544821183013962008-09-24T18:40:00.002-06:002008-09-24T18:43:37.184-06:00GNOME is Back for meI previously posted about KDE 4.1. While I enjoyed it's cool looks, I've found GNOME is currently just more productive for me. So, I find myself running GNOME at work and home. Choice is great, and I'm sure this won't be the last time I try out KDE.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-10590377339384556442008-08-03T20:06:00.002-06:002008-08-03T20:23:06.662-06:00KDE 4.1 Much ImprovedI installed KDE 4.1 today on a few of my machines. I'm quite happy with it now, and I will be making the switch from GNOME back to KDE. KDE 4.0 was too buggy to work with. After a few crashes of KDE 4.0 within the first hour of installation, I went right back to GNOME 2.22. <br /><br />GNOME is fine for the most part, though there were often times I wanted to customize something that I just couldn't do ( dual headed background limitations, running a separate screensaver process per head slamming the cpus, and lack of any customization in the newly, revamped gdm architecture come to mine ). But I digress. For me, KDE 4.1 is stable, looks great, and so far is not lacking any customizations I need. It took a few minutes of figuring out where the team is headed with Desktop folder views. I think they're way cool, and they help one keep a nice, organized desktop. <br /><br />If you gave up on KDE 4.0 like I did, jump back on! KDE 4.1 shows the dedication of the KDE team to answering issues and pioneering the way for the Linux desktop.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-1461110667264032152008-07-07T11:08:00.002-06:002008-07-07T11:18:09.768-06:00Flex BlazeDS XML ParsingI've received some great comments on my recent entry <a href="http://mmartinsoftware.blogspot.com/2008/05/simplified-blazeds-and-jms.html">Simplified BlazeDS and JMS</a>. A few people had some issues, and I wanted to clarify one thing I discovered early on, fixed, forgot, and then was reminded of as others encountered the same problem -- <u>Flex BlazeDS xml parsing does not remove any spaces or linefeeds from the xml between the xml tags and the value</u>. If, for instance, your xml formatter places line feeds between your xml tags and the containing text values, you will encounter problems. <br /><br />Also I've set up an email at mmartinsoftware@comcast.net for those who wish to email me or want sample code emailed to them. I'll have to look for some hosting space to make it easier down the road.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com0tag:blogger.com,1999:blog-1492374798042002505.post-23162586227383259382008-05-16T09:54:00.004-06:002008-05-16T10:13:57.990-06:00OpenLDAP 2.4.9 Multi-Master Replication Stability ImprovedI pulled in OpenLDAP 2.4.9 to re-visit some multi-master testing I had done on the previous version. 2.4.9 was a better experience for me than 2.4.8. I re-ran some tests of running two replicated servers on the same machine. I would continuously load in several hundred or thousand user records on one server, then delete them. <br /><br />The stability is improved from 2.4.8. I have yet to have a server core on me--even after abruptly shutting done one or both servers during a batch load or delete.<br /><br />My only issue now is that when performing a bulk load, if you interrupt the client during the load ( Control-c ldapadd ) the servers get out of sync. The server you directly attach to in order to load the records contains more records than the "replicated" server. Under most circumstances, this would not be a huge issue, but it does show an easy way for a client to get the servers out of sync.<br /><br />With the 2.4.9 release of OpenLDAP, I would trust the multi-master synchronization enough now for use on production systems.Michael Martinhttp://www.blogger.com/profile/06287331995903071075noreply@blogger.com5