Uwe Hermann - driverhttp://hermann-uwe.de/taxonomy/term/1102/0
enPlaying Starcraft on Linux using Winehttp://hermann-uwe.de/blog/playing-starcraft-on-linux-using-wine
<p><a href="http://www.hermann-uwe.de/node/1411"><img src="http://www.hermann-uwe.de/files/images/winehq_top_logo.png" width="209" height="99" align="right" hspace="5" alt="Wine logo" /></a></p>
<p>Here's a quick HOWTO for using <a href="http://winehq.org/">Wine</a> to play <a href="http://en.wikipedia.org/wiki/Starcraft">Starcraft</a> on a Linux machine.</p>
<h2>Starcraft Installation</h2>
<pre>
$ <strong>apt-get install wine</strong> (as root)
$ <strong>winecfg</strong>
</pre><p>
The winecfg (graphical) utility will setup some config file defaults in your <strong>~/.wine</strong> directory. Click on <strong>Graphics</strong> and activate <strong>Allow DirectX apps to stop the mouse leaving their window</strong>. Also, click on <strong>Audio</strong> (a dialog will pop up, just click <strong>OK</strong>). This will autodect your soundcard and setup Wine to use it. Under <strong>Drives</strong> click <strong>Add</strong> (this will add <strong>D:</strong>) and change the path to <strong>/media/cdrom</strong>, so that Wine knows about your CD-ROM drive. Finally click <strong>OK</strong> to close winecfg and save the settings.</p>
<p><a href="http://www.hermann-uwe.de/node/1414"><img src="http://www.hermann-uwe.de/files/images/winecfg.jpg" width="200" height="273" align="right" hspace="5" alt="winecfg screenshot" /></a></p>
<p>The next step is to insert the Starcraft CD-ROM into the drive and start the installer using Wine:</p>
<pre>
$ <strong>mount /media/cdrom</strong> (as root)
$ <strong>wine /media/cdrom/setup.exe</strong>
</pre><p>
Follow the instructions in the installer until the Starcraft install is finished (you'll need your CD key number), then exit the installer (don't start playing Starcraft right away).</p>
<p>The next step is to get the latest patch and get rid of the need to insert the CD-ROM every time.</p>
<pre>
$ <strong>wget http://ftp.blizzard.com/pub/starcraft/patches/PC/SC-1161.exe</strong>
$ <strong>wine SC-1161.exe</strong>
</pre><p>
After the patch is installed click <strong>OK</strong> and Starcraft will be started (very annoying). Leave the game again. We'll get rid of the CD-ROM requirement now:</p>
<pre>
$ <strong>cp /media/cdrom/install.exe ~/.wine/drive_c/Programme/Starcraft/StarCraft.mpq</strong>
</pre><p>
That's a pretty big file, it may take a while. You might have to change "Programme" in the path (I have the German Starcraft version). That's it. You can now play Starcraft (without needing the CD-ROM) using:</p>
<pre>
$ <strong>wine ~/.wine/drive_c/Programme/Starcraft/StarCraft.exe</strong>
</pre><h2>Notes</h2>
<p>A good thing is, it even works nice and fast with the open-source <strong>nv</strong> NVIDIA driver (no need to install the proprietary driver).</p>
<p>I noticed one very annoying "bug" with the mouse behaviour at first. The mouse would sometimes just get stuck during the game (which is a total disaster of course, if you're in the middle of a fast-paced game). Left-clicking somewhere would "unstuck" the mouse, but it's still very bad. After many, many hours of <a href=http://appdb.winehq.org/objectManager.php?sClass=version&amp;iId=51"">reading</a> bugreports and trying various patches I finally found out the root cause for the problem.</p>
<p>It's somehow related to my window manager (<a href="http://www.icewm.org/">IceWM</a>); whenever you move the mouse to the bottom of the Starcraft screen (where the IceWM status bar is, even though it's not on top or even visible, and even though Wine/Starcraft runs in full-screen mode!), something funny happens with X11/IceWM and the mouse gets stuck. I haven't yet found out if/which IceWM option could fix this behavior, but I have a small work-around. Just start Wine directly on a second X11 server with Starcraft (without any window manager being involved):</p>
<pre>
$ <strong>xinit -e '/usr/bin/wine ~/.wine/drive_c/Programme/Starcraft/StarCraft.exe' -- :1</strong>
</pre><p>
No patches needed (stock Wine from Debian unstable works fine, that's version 1.0.1 right now). I hope this saves other people some debugging time...</p>
<h2>Brood War Installation</h2>
<p>In order to play the <a href="http://appdb.winehq.org/objectManager.php?sClass=version&amp;iId=149">Brood War</a> expansion you can follow a similar procedure. Insert the Brood War CD-ROM, then:</p>
<pre>
$ <strong>mount /media/cdrom</strong> (as root)
$ <strong>wine /media/cdrom/setup.exe</strong>
$ <strong>cp /media/cdrom/install.exe ~/.wine/drive_c/Programme/Starcraft/BroodWar.mpq</strong>
$ <strong>wget http://ftp.blizzard.com/pub/broodwar/patches/PC/BW-1161.exe</strong>
$ <strong>wine BW-1161.exe</strong>
</pre><p>
After you've done that, you can start both Starcraft (classic) and Brood War via:</p>
<pre>
$ <strong>wine ~/.wine/drive_c/Programme/Starcraft/StarCraft.exe</strong>
</pre><p>
You will be asked in the game whether you want to actually play the Starcraft or Brood War variant.</p>
<h2>Reducing CPU load</h2>
<p>As of <strong>version 1161</strong> for the Starcraft / Brood War patch, there's a new game option which can drastically lower the CPU load while playing Starcraft. First fire up Starcraft and start any game. Then, press <strong>F10</strong>, select <strong>Options / Game speed</strong>, and check the <strong>"Enable CPU Throttling box"</strong>. You'll probably need to restart Starcraft afterwards.</p>
<h2>Multiplayer and Firewalls</h2>
<p>Multiplayer LAN games work just fine (didn't try BattleNet that much yet), but if you use a <a href="http://www.hermann-uwe.de/security/my-firewall-iptables-scripts">strict firewall rule set</a> as I do (which blocks most ingress as well as egress traffic) you have to open a number of different ports. Here's what I added to <a href="http://www.hermann-uwe.de/files/fw_laptop">my firewall script</a>:</p>
<pre>
$IPTABLES -A OUTPUT -m state --state NEW -p udp --dport 6111 -j ACCEPT
$IPTABLES -A INPUT -m state --state NEW -p udp --dport 6111 -j ACCEPT
$IPTABLES -A OUTPUT -m state --state NEW -p udp --dport 6112 -j ACCEPT
$IPTABLES -A OUTPUT -m state --state NEW -p tcp --dport 6112 -j ACCEPT # BattleNet
</pre><h2>Starcraft on netbooks</h2>
<p><a href="http://www.hermann-uwe.de/photoblog/one-a110-netbook-running-starcraft"><img src="http://www.hermann-uwe.de/files/images/one_a110_starcraft.preview.jpg" width="200" height="150" align="right" alt="One A110 netbook running Starcraft" /></a></p>
<p>Starcraft works just fine on various netbooks; for instance, I tested it on my <a href="http://www.a110wiki.de">One A110 netbook</a> (VIA VX800) with 256 MB of RAM, <em>and</em> the whole <strong>.wine</strong> directory being on a USB thumb drive (thus slow; but my internal SSD was already full). I bet it'll also work fine on the <as href="http://en.wikipedia.org/wiki/ASUS_Eee_PC">ASUS Eee PC</a> and other netbooks...</p>
<p>Audio works fine, and game speed is quite OK, the only minor "problem" is that you should use an external USB mouse, the touchpad is just too small (and too slow to use) for such a fast-paced game.</p>
<p>The full Wine package (and all dependencies) consume quite a lot of space on the (usually very small) hard drive or SSD of a netbook, but luckily you can get away with only a minimal Wine install for playing Starcraft:</p>
<pre>
$ <strong>apt-get install wine-bin libwine-alsa</strong> (as root)
</pre><p>
That's sufficient, and a <em>lot</em> smaller than installing the full <strong>wine</strong> package.</p>
<p><strong style="color:red">Update 2010-06-23:</strong> There's a contributed <a href="http://wubutu.webatu.com/?p=310">Hungarian translation</a> now (thanks!)<br />
<strong style="color:red">Update 2009-03-04:</strong> Added info about patch 1161 and CPU load reduction.<br />
<strong style="color:red">Update 2008-12-19:</strong> Added Starcraft-on-netbooks section.<br />
<strong style="color:red">Update 2008-12-13:</strong> Added BroodWar and multiplayer info.</p>
http://hermann-uwe.de/blog/playing-starcraft-on-linux-using-wine#commentsblizzarddebiandriveremulationicewmlinuxmanagermousenvproblemstarcraftunstablewin32windowwindowswineWed, 03 Dec 2008 21:20:28 +0100Uwe Hermann1412 at http://hermann-uwe.deNouveau - Free Software 3D acceleration for NVIDIA cards is making progresshttp://hermann-uwe.de/blog/noveau-free-software-3d-acceleration-for-nvidia-cards-is-making-progress
<p>Nice... the <a href="http://nouveau.freedesktop.org/">Nouveau project</a>, which aims at creating Free Software drivers with accelerated 3D graphics for NVIDIA cards, is <a href="http://nouveau.freedesktop.org/wiki/Nouveau_Companion_8">making some progress</a>...</p>
<p>I'm looking forward to the day when I can replace "nv" with "nouveau" in my <code>xorg.conf</code>.</p>
<p><strong style="color:#ff0000">Update 2006-11-27</strong>: Yes, I know it's spelled "nouveau" (not "noveau"), which means "new" in French. Need more coffee ;-)</p>
<p>(via <a href="http://www.pro-linux.de/news/2006/10526.html">Pro-Linux News</a>)</p>
http://hermann-uwe.de/blog/noveau-free-software-3d-acceleration-for-nvidia-cards-is-making-progress#comments3daccellerationdriverdrmfree softwarefreedomnouveaunvidiareverse engineeringMon, 27 Nov 2006 15:44:43 +0100Uwe Hermann1170 at http://hermann-uwe.deNVIDIA Binary Graphics Driver Root Exploithttp://hermann-uwe.de/blog/nvidia-binary-graphics-driver-root-exploit
<p>A <a href="http://www.rapid7.com/advisories/R7-0025.jsp">security advisory</a> was released today which warns about a severe security issue in the <a href="http://www.nvidia.com/object/unix.html">binary-only NVIDIA drivers</a>:</p>
<blockquote><p>
The NVIDIA Binary Graphics Driver for Linux is vulnerable to a<br />
buffer overflow that allows an attacker to run arbitrary code as<br />
root. This bug can be exploited both locally or remotely (via<br />
a remote X client or an X client which visits a malicious web page).<br />
A working <a href="http://www.rapid7.com/advisories/nv_exploit.c">proof-of-concept root exploit</a> is included with this<br />
advisory.
</p></blockquote>
<p>The only possible solution (as NVIDIA still hasn't fixed the issue, although they know about it since 2004):</p>
<blockquote><p>
Disable the binary blob driver and use the open-source "<a href="http://wiki.x.org/wiki/nv">nv</a>" driver that is included by default with X.
</p></blockquote>
<p>Yes, you won't have 3D acceleration any more if you do that. Yes, that sucks. Complain to NVIDIA that they don't provide documentation so that free drivers can be written.</p>
<p>Luckily I stopped using the NVIDIA binary-blob quite a while ago, and I don't intend to ever use it again. This exploit clearly shows me that that's a good decision. For now, I'll have to live with the fact that I must use software-rendering for 3D (which is slow). When I buy my next computer it won't have an NVIDIA card, that's for sure.</p>
<p>But maybe there's hope. Maybe, just maybe, NVIDIA releases proper documentation one day (but don't hold your breath).</p>
<p>Alternatively, I just learned about the <a href="http://nouveau.freedesktop.org/wiki/">nouveau</a> project: <em>a project which aims at producing Open Source 3D drivers for nVidia cards</em>. I don't know what the current status is and whether it's usable already, but this is definately a project which is worth trying out and worth supporting!</p>
<p>(via <a href="http://kerneltrap.org/node/7228">Kerneltrap</a>)</p>
http://hermann-uwe.de/blog/nvidia-binary-graphics-driver-root-exploit#commentsbinaryblobclosed-sourcedriverexploitfree softwarelinuxnvnvidiasecurityMon, 16 Oct 2006 22:30:22 +0200Uwe Hermann1144 at http://hermann-uwe.deLook ma, I found a kernel bug!http://hermann-uwe.de/blog/look-ma-i-found-a-kernel-bug
<p>Oh great. I have experienced random hangups of my Laptop recently, and I had absolutely no clue what caused them, even after a reboot and looking into the logfiles. Today, after another hangup/crash I think I found the problem (but not the solution):</p>
<pre>
May 16 00:08:35 localhost kernel: NETDEV WATCHDOG: eth0: transmit timed out
May 16 00:08:35 localhost kernel: sky2 eth0: tx timeout
May 16 00:08:35 localhost kernel: x45 [sky2]
May 16 00:08:35 localhost kernel: [pg0+943960755/1069376512] sky2_poll+0x469/0x548 [sky2]
May 16 00:08:35 localhost kernel: [pg0+953407031/1069376512] nv_kern_isr+0x31/0x63 [nvidia]
May 16 00:08:35 localhost kernel: [net_rx_action+82/199] net_rx_action+0x52/0xc7
May 16 00:08:35 localhost kernel: [__do_softirq+52/125] __do_softirq+0x34/0x7d
May 16 00:08:35 localhost kernel: [do_softirq+34/38] do_softirq+0x22/0x26
May 16 00:08:35 localhost kernel: [irq_exit+41/52] irq_exit+0x29/0x34
May 16 00:44:32 localhost syslogd 1.4.1#17.2: restart.
May 16 00:44:32 localhost kernel: klogd 1.4.1#17.2, log source = /proc/kmsg started.
</pre><p>
Note that I could do absolutely nothing on the laptop anymore, no moving the mouse, no typing on the keyboard, no switching from X11 into a text console, no CTRL+ALT+BACKSPACE to kill X11, no CTRL+ALT+DELETE to reboot, nothing.</p>
<p>I think sky2 (network driver) or the NVIDIA driver may be the culprit (or a combination of both). After some searching it seems other people have/had <a href="http://www.ussg.iu.edu/hypermail/linux/kernel/0605.0/0252.html">similar</a> <a href="http://www.redhat.com/archives/rhl-beta-list/2006-February/msg00880.html">problems</a>, but not quite the same...</p>
<p>I guess I'll have to file a bugreport somewhere...</p>
http://hermann-uwe.de/blog/look-ma-i-found-a-kernel-bug#comments2.6.16bugdriverhangupkernellinuxnetworksky2Tue, 16 May 2006 01:00:55 +0200Uwe Hermann933 at http://hermann-uwe.deSUSE/Novell plans to no longer distribute proprietary drivershttp://hermann-uwe.de/blog/suse-novell-plans-to-no-longer-distribute-proprietary-drivers
<p>That's nice. Apparently <a href="http://www.novell.com/linux/suse/">SUSE/Novell</a> are planning to no longer include any proprietary (kernel) drivers in their Linux distributions. (Most of) the kernel developers dislike binary drivers in the kernel and SUSE/Novell are clearly supporting the developers with their move.</p>
<p>Although they plan a system for including binary drivers from userspace somehow, I still think this is a good sign. I hope it will help to convince some hardware manufacturers to release the source code of some of their (now) proprietary drivers...</p>
<p>This whole debate was started by <a href="http://thread.gmane.org/gmane.linux.kernel/354704">Arjan van de Ven's original post to the LKML</a> in December 2005, AFAIK.</p>
<p>(via <a href="http://www.heise.de/newsticker/meldung/69555">Heise</a>)</p>
http://hermann-uwe.de/blog/suse-novell-plans-to-no-longer-distribute-proprietary-drivers#commentsdriverkernellinuxnovellopen sourceproprietarysuseTue, 14 Feb 2006 17:41:23 +0100Uwe Hermann777 at http://hermann-uwe.deFor those who care about SN9C10x based webcamshttp://hermann-uwe.de/blog/for-those-who-care-about-sn9c10x-based-webcams
<p><a href="http://www.hermann-uwe.de/photoblog/webcam"><img src="http://www.hermann-uwe.de/files/images/webcam.thumbnail.jpg" width="100" height="75" align="right" hspace="5" alt="Webcam" /></a><br />
<a href="http://www.hermann-uwe.de/node/721"><img src="http://www.hermann-uwe.de/files/images/sonic-snap.thumbnail.jpg" width="100" height="82" align="right" hspace="5" alt="Sonic-snap screenshot" /></a><br />
<a href="http://www.hermann-uwe.de/node/722"><img src="http://www.hermann-uwe.de/files/images/sonic-snap-gui.jpg" width="100" height="154" align="right" hspace="5" alt="Sonic-snap-gui screenshot" /></a><br />
<strong>Note:</strong> Yeah, I'm abusing the latest Debian <strike><a href="http://lists.debian.org/debian-project/2006/01/threads.html#00083">flamewar</a></strike> meme for some attention mongering. Sue me.</p>
<p>A few days ago, I have tested <a href="http://www.hermann-uwe.de/photoblog/webcam">my cheap, crappy webcam</a> I bought more than a year ago for the first time. Using the <a href="http://www.linux-projects.org/modules/mydownloads/viewcat.php?cid=2">latest SN9C10x driver</a> (which is already included in recent 2.6.1x kernels) worked fine, i.e., the USB webcam was recognized.</p>
<p>I tried running <a href="http://www.stolk.org/sonic-snap/">sonic-snap</a> (site is currently down, try the <a href="http://66.249.93.104/search?q=cache:W1Q1IcSyko8J:www.stolk.org/sonic-snap/+sonic-snap&amp;hl=en">Google Cache</a>) in order to get snapshot images and/or videos off the webcam, which initially didn't work. But I soon found out what the cause of the problem was and created a <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi/webcam.patch?bug=348198;msg=5;att=1">trivial patch</a> which fixed the problem for me.</p>
<p>Then, after <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348198">I made myself look like an idiot</a> by reporting a bug against a non-existing sonic-snap Debian package, I finally sent the patch to the upstream author. I'll probably <a href="http://www.debian.org/devel/wnpp/#l2">ITP</a> the package, though, as I might be using the webcam more often...</p>
<p>I also tested the webcam with <a href="http://www.gnomemeeting.org/">Gnomemeeting</a> for some <a href="http://en.wikipedia.org/wiki/Video_conferencing">videoconferencing</a> fun, which didn't work at first either. After some stupid guessing and googling, I finally found out that you need to <a href="http://mteixeira.webset.net/blog/20050919/v4l2-webcams/">apt-get install libpt-plugins-v4l2</a>, which is not installed by default (why?). Other than that (and apart from the really, really crappy image quality of the webcam), it worked really nice...</p>
<p>Here's the exact <code>lsusb</code> output for Google to parse, other people might be searching for this info:<br />
<code><br />
Bus 003 Device 003: ID 0c45:602a Microdia Meade ETX-105EC Camera<br />
</code></p>
http://hermann-uwe.de/blog/for-those-who-care-about-sn9c10x-based-webcams#commentsdebiandrivergnomegnomemeetingkernellinuxsn9c10xsonic-snapstupiditywebcamSun, 22 Jan 2006 03:24:22 +0100Uwe Hermann727 at http://hermann-uwe.de