Wölfischhttps://woelfisch.de/blog/2011-09-06T19:26:00+00:00Jörg's BlogDoes my TV want to spy on me?2011-09-06T19:26:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/does-my-tv-want-to-spy-on-me<p>Yesterday, my TV asked me:<br/><blockquote>For quality and improvement purposes, your usage statistics about the TV system and remote will be sent to the Sony server. It will exclude personal and individually identifiable information. Would you like to enable this setting?</blockquote><br/>At least they are asking, but it does leave a couple of questions:<ul><li>What exact information gets collected?</li><li>What does Sony consider being "personal information"?</li><li>How do they ensure that it is not "individually identifiable"?</li><li>What exactly are those "improvement purposes"?</li><li>Where exactly do they collect this information?</li><li>How well is it secured, especially with Sony's less than stellar track record in this regard?</li><li>How can I be sure that it's not collecting the data anyway regardless that I turned it off?</li></ul>I guess the only way to answer the last question is to buy a managed network switch that lets me monitor traffic on specific ports...</p><p>Oh, and while I'm at it. If you are one of those who are dodging the TV licence fee ("Rundfunkgebühr" in Germany), you'd better not connect the TV to your network at all: That newfangled <a href="http://en.wikipedia.org/wiki/Hybrid_Broadcast_Broadband_TV">HbbTV</a> thingy European public broadcasters are introducing apparently causes the TV to request the index for the online content each time you switch to such a channel. This doesn't mean much of course, unless your other network activity allows correlation between you or at least your household and your IP number.</p><p>I am paying the fee, of course, but I'm considering pulling the network cable anyway... This is the only way to be 100% sure that it cannot phone home. Even though I have to admit the online features are quite nifty, indeed.</p><p>This is of course an issue with all network connected appliances. But I'm not convinced that Sony understands privacy concerns at all. For example, their remote control application for Android phones sports ads and a recent version of it wanted access rights to the browser history of the phone. I declined that update and removed the app instead.</p>Stereo to 2.1 "upmix" on Linux - part 52011-04-19T06:47:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/stereo-to-21-upmix-on-linux-part-5<p>But I want a software mixer. Pulseaudio to the rescue! Apart from the fact that the documentation of remap-sink leaves a bit to desire, this is fairly easy. First, our <kbd>~/.asoundrc</kbd> reduces to</p><p><blockquote><pre><br/>pcm.!default {<br/> type pulse<br/> hint.description "ALSA Pulse output"<br/>}</pre></blockquote></p><p>ctl.!default {<br/> type pulse<br/>}</p><p>pcm.ac3 {<br/> type rate<br/> slave {<br/> pcm {<br/> type a52<br/> format s16<br/> channels 6<br/> bitrate 448<br/> }<br/> rate 48000<br/> }<br/> hint {<br/> description "AC3 output"<br/> }<br/>}<br/></p><p>Next, we copy /etc/pulse/default.pa to ~/.pulse/ and add the following to the <kbd>.fail</kbd> section:</p><p><blockquote><pre><br/>load-module module-alsa-sink sink_name=Surround5.1 device=ac3 rate=48000 channels=6 mmap=0 channel_map=front-left,front-right,rear-left,rear-right,center,lfe<br/>load-module module-remap-sink sink_name=Stereo2.1 master=Surround5.1 channels=3 channel_map=front-left,front-right,lfe master_channel_map=front-left,front-right,lfe remix=0<br/></pre></blockquote></p><p>Surprisingly, the remap-sink module automatically seems to do the right thing to the mono channels (i.e., sum of left and right)</p><p>Not directly related to the upmix task, but useful as we're going to disable auto detection:</p><p><blockquote><pre><br/>load-module module-alsa-sink sink_name=Headphones device=hw:0,0 rate=48000 channels=2 mmap=0<br/>load-module module-alsa-source device=hw:0,0<br/></pre></blockquote></p><p>Also, I'd like to have Stereo2.1 being my default like:</p><p><blockquote><pre><br/>set-default-sink Stereo2.1<br/></pre></blockquote></p><p>Hmm, while we're at it, 4.1 upmix may be nice as well:</p><p><blockquote><pre><br/>load-module module-remap-sink sink_name=Stereo4.1 master=Surround5.1 channels=5 channel_map=front-left,front-right,lfe,front-left,front-right master_channel_map=front-left,front-right,lfe,rear-left,rear-right remix=0<br/></pre></blockquote></p><p>Talking about disabling auto detection, comment out module-udev-detect:</p><p><blockquote><pre><br/># load-module module-udev-detect<br/></pre></blockquote></p><p>We may also want to avoid unnecessary conversion from 48k to 44k1 and back to 48k, thus edit <kbd>/etc/pulse/daemon.conf</kbd> (or better copy it to <kbd>~/.pulse/</kbd> and edit it there) to set</p><p><blockquote><pre><br/>default-sample-rate = 48000<br/></pre></blockquote></p><p>And you know what I should have googled for to directly find the solution as outlined in this part of my little serial?</p><p><blockquote><pre><br/>pulseaudio ac3<br/></pre></blockquote></p>Stereo to 2.1 "upmix" on Linux - part 42011-04-18T16:33:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/stereo-to-21-upmix-on-linux-part-4<p>I cannot find any other tool that encodes AC3 to IEC958 than vlc and mplayer. Both are not suitable for the task for different reasons. One idea would be to modify the alsaplay (aplay) ALSA example application to do the encoding. But while researching the topic I asked myself: why couldn't just ALSA do it by itself? It's just wrapping AC3 into a bit stream, and the mplayer code for it looks fairly simple. Let's see how ALSA plugins are working anyway... So I downloaded the alsa-plugins source code and... WAIT, WHAT IS THAT?! There is a directory "a52". It contains exactly the module I was looking for. It does not encode an AC3 stream to an IEC958 transport stream, it creates the whole transport-encoded AC3 data from PCM data and writes it to the SPDIF device of the sound card. That's even more I asked for!</p><p>So I compiled it and added the following to <kbd>~/.asoundrc</kbd>:</p><p><blockquote><pre><br/> pcm.ac3 {<br/> type a52;<br/>}<br/></pre></blockquote></p><p>and changed the slave PCM of stereo21 to:</p><p><blockquote><pre><br/> slave {<br/> pcm "ac3" # was iec958mux<br/> channels 6<br/> }<br/></pre></blockquote></p><p>And... It did not work. Not out of the box.</p><p>Long story short and a debugging session later: current GIT versions of libav / ffmpeg have changed the default codec for AC3 encoding to floating point format, but the ALSA a52 plugin supports only the signed integer format. You need to get the current source code from GIT for alsa-plugins for a working a52 plugin. </p><p>Very sweet, that works, without any race conditions, yet one drawback: the ALSA "dmix" software mixer works only on hardware devices. Of course you cannot dmix an AC3 stream, thus only one application at a time will be able to play sound on this device. How annoying. Especially when knotify starts a kdeinit4 process that keeps blocking the sound interface.</p>Stereo to 2.1 "upmix" on Linux - part 32011-04-18T07:06:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/stereo-to-21-upmix-on-linux-part-3<p>The upmix pipe is nice, but quite complex and limited to applications which have piped output. Maybe we can get the latency down and probably can get sox out of the mix... ALSA can remix channels with the "route" plugin, and it can output to a pipe. Let's put the following in the <kbd>~/.asoundrc</kbd>:</p><p><blockquote><pre><br/>pcm.stereo21 {<br/> type route<br/> slave {<br/> pcm "iec958mux"<br/> channels 6<br/> }</pre></blockquote></p><p> ttable.0.0 1; # front left<br/> ttable.1.1 1; # front right</p><p> ttable.0.2 0; # rear left<br/> ttable.1.3 0; # rear right</p><p> ttable.0.4 0; # center left (muted)<br/> ttable.1.4 0; # center right (muted)</p><p> ttable.0.5 0.5; # sub left<br/> ttable.1.5 0.5; # sub right</p><p> hint {<br/> description "Stereo to 2.1"<br/> }</p><p>}</p><p>pcm.iec958mux {<br/> type file<br/> slave.pcm null<br/> file "|/usr/local/bin/play-5.1"<br/> format wav<br/>}<br/> </p><p>This is exactly the "sox" part of the pipe, and every audio player that can output to an ALSA "PCM" device can use it:</p><p><blockquote><pre><br/>aplay -Dstereo21 test-stereo-48k.wav<br/></pre></blockquote></p><p>The stereo21 PCM performs the upmix and sends the resulting stream to the iec958mux PCM, which will pipe it to <kbd>/usr/local/bin/play-5.1</kbd></p><p>And here comes the surprisingly tricky part. In a first iteration it looked like this:</p><p><blockquote><pre><br/>aften -v 0 - - | \<br/>mplayer -rawaudio format=0x2000 -demuxer rawaudio -ao alsa:device=iec958 -ac hwac3 -really-quiet -<br/></pre></blockquote></p><p>We're using <kbd>aften</kbd> because of lower latency and that I couldn't find a way to tell ffmpeg to STFU — it keeps printing stuff to console whatever I do. As you can imagine, this only almost works. Mplayer complains about underruns. As "aften" is just a converter without being able to output to ALSA, it leaves us no choice than abusing vlc for the task:</p><p><blockquote><pre><br/>aften -v 0 - - | vlc -I dummy stream:///dev/stdin<br/></pre></blockquote></p><p>But this results in a hanging vlc because it does not catch end of file of the pipe (it blocks SIGPIPE). We need to kill it explicitly. With SIGKILL. As vlc also blocks SIGCHLD, it is not enough to kill the script. Since the "dummy" interface of vlc isn't capable of writing the PID (only the interactive interfaces are), we need to write a wrapper <kbd>vlc-pipe</kbd>:</p><p><blockquote><pre><br/>#!/bin/sh<br/>echo $$ >$1<br/>exec vlc -I dummy stream:///dev/stdin<br/></pre></blockquote></p><p>The argument of the script is the file name to write the PID of vlc to. With some additional armor around it, our play-5.1 script looks like this:</p><p><blockquote><pre><br/>#!/bin/sh</pre></blockquote></p><p>WAITTIME=0.5<br/>PIDDIR="$HOME/.cache/play-5.1"<br/>LOCKFILE="$PIDDIR/lock"<br/>PLAYERPID="$PIDDIR/player"</p><p>[ -e "$PIDDIR" ] || mkdir "$PIDDIR"<br/>while [ -e "$LOCKFILE" ] ; do sleep $WAITTIME ; done<br/>echo $$ >"$LOCKFILE"</p><p>(aften -v 0 - - ; sleep $WAITTIME ; kill -9 $(cat "$PLAYERPID")) | \<br/>vlc-pipe "$PLAYERPID"</p><p>sleep $WAITTIME<br/>rm "$LOCKFILE" "$PLAYERPID"<br/></p><p>We assume a maximum latency of half a second, which is indeed enough. Extremely ugly, but at first, it seems to work reliably. Thus, let's see what happens if we make it the default PCM. And of course add the automatic rate conversion to 48 kHz sampling rate. Just add the following few lines to <kbd>~/.asoundrc</kbd></p><p><blockquote><pre><br/>pcm.!default {<br/> type plug;<br/> slave {<br/> pcm stereo21;<br/> rate 48000;<br/> }<br/>}<br/></pre></blockquote></p><p>Yes! That works! Until you start firefox and play flash animations.</p><p>We end up with hanging instances vlc again, because opposed to vlc the play-5.1 script does catch signals, and if a process closes the ALSA device before the half-second sleep is over, we'll have a hanging vlc again, and stale lock files on top of it. Ugh. Okay, we might be able to catch most races eventually, but I'd very much prefer to avoid using vlc altogether.</p>Stereo to 2.1 "upmix" on Linux - part 22011-04-17T21:50:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/stereo-to-21-upmix-on-linux-part-2<p>How to construct a 2.1 signal from a stereo signal? We are going to encode it as AC3 ("Dolby Digital"), with the original stereo channels left and right mapped to front left and right, center and rear channels being muted, and bass getting the sum of half of the level of left and right channel. Strictly speaking, we should run the the bass signal through a low pass, but it is not necessary for my speaker system, as the active bass box has a built in low pass with an adjustable cutoff frequency.</p><p>As a first attempt, let us just create such a signal. We're going to do this the Unix way: with pipes. Since sox has some issues with WAV streams on non-seekable input such as pipes, and it does not come with ffmpeg bindings on openSUSE for legal reasons, let's first create a PCM stream from anything with ffmpeg:<br/><blockquote><pre><br/>ffmpeg -i - -ar 48k -f s16le - <br/></pre></blockquote><br/>It'll take anything from stdin and convert it to an 48 KHz sampling rate 16 bit signed little endian integer PCM stream. Thinking about it, it probably should only take the first two channels from the input, but let's ignore that for now. Now pipe that to sox to create a six channel WAV stream according to above mapping:<br/><blockquote><pre><br/>ffmpeg -i - -ar 48k -f s16le - | \<br/>sox -t s16 -L -c 2 -r 48k - -t wav - remix 1 2 0 1,2 0 0<br/></pre></blockquote><br/>If you are wondering about the channel order for surround sound in WAV files (and thus expected by the AC3 encoder): it is front left, front right, front center, lfe (bass), rear left, rear right <a href="http://msdn.microsoft.com/en-us/windows/hardware/gg463006.aspx">as defined by Microsoft</a>. The channel order for AC3 is even weirder (<a href="http://www.atsc.org/cms/standards/a_52-2010.pdf">ATSC A/52 standard, section 5.4.2.3, table 5.8</a>), fortunately the encoder is taking care of this.</p><p>Talking about encoding, we need to convert it to AC3 with ffmpeg next:<br/><blockquote><pre><br/>ffmpeg -i - -ar 48k -f s16le - | \<br/>sox -t s16 -L -c 2 -r 48k - -t wav - remix 1 2 0 1,2 0 0 | \<br/>ffmpeg -i - -ab 192k -ac 6 -f ac3 -<br/></pre></blockquote><br/>Now we just need something to actually write the stream to the audio device. Mplayer can do this for us, however don't ask how long it took me to find all the options:<br/><blockquote><pre><br/>ffmpeg -i - -ar 48k -f s16le - | \<br/>sox -t s16 -L -c 2 -r 48k - -t wav - remix 1 2 0 1,2 0 0 | \<br/>ffmpeg -i - -ab 192k -ac 6 -f ac3 - | \<br/>mplayer -rawaudio format=0x2000 -demuxer rawaudio -ao alsa:device=iec958 -ac hwac3 -really-quiet -<br/></pre></blockquote><br/>Let's try that and 'cat' an MP3 file to this pipe... Yes, we have sound! A quick test with Daft Punk — Tron Legacy Soundtrack: oomph oomph!!</p><p>The latency is even bearable.<br/><br/>Unfortunately, using the pipe as the output to VLC results in mplayer complaining about underruns frequently. Also, other applications don't even allow piping their audio output. But the approach is still good to play single files and experiment a bit without having to confuse the whole audio setup of the system.</p>Stereo to 2.1 "upmix" on Linux - part 12011-04-17T13:42:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/stereo-to-21-upmix-on-linux-part-1<p>I recently upgraded my set of speakers after my old Braun boxes finally reached their end of life. The "surrounds" of the speakers were degraded too far after almost 30 years. Given that the speaker system was from Braun's budget series of speakers (still relatively expensive at the time) it does not make sense to refurbish it. So I replaced the front speakers with a set of <a href="http://www.nubert.de/">Nubert</a> nuJubilee 35 (comparable to nuLine 32) speakers. If you are a fan of the 70th classic music sound like me: give Nubert speaker systems a try. At least the nuLine series is quite close to the sound of medium to large Brauns, though slightly more modern (i.e., more bass.)</p><p>The center, rear and bass speakers were from a Teufel Magnum E system, which barely worked well enough with the Braun speakers, but does not fit to the new speakers. The center was always far too small, so I replaced it with a nuLine WS-12. Could have a bit more bass, however as I can only mount the center hanging on a shelf and everything larger would be too heavy, this has to do. And it sounds great when watching movies! Alas, the sound of the bass box doesn't fit anymore, and the rears were also too limited, thus I ended up with two new rear speakers (nuLine DS-22) and a bass box (nuJubilee 35), completing the upgrade.</p><p>The new system sounds exactly the way I want it to sound. Probably way too dry for other people, but perfect for me. The only thing that buggers me is the AV receiver: With stereo signals, I can either have stereo output, but that won't feed the bass. Or I can have a Dolby ProLogic II upmix which does weird things. Luckily, the receiver can be configured to NOT send a sum signal to the center speaker in that mode, but it still has some phase shift and delay on the rears. This is usually okay for pop music, but I do not want to hear the trombone from almost-rear right when listening to an opera... I cannot get any analog line out signal from a digital source, either. Said opera recording, even though a digital production, was mastered with vinyl records in mind, so it doesn't have any frequencies low enough for the bass box to be needed, but I do have some recordings that would benefit from a 2.1 "upmix". Or even 4.1 with just the unmodified stereo signal sent to the rears.</p><p>Since I'm playing all recordings I own from a openSUSE 11.4 system via TOSLINK / SPDIF / IEC958, how about creating the upmix on the machine, encode it as AC3 and use SPDIF pass-through to send it to the AV receiver? Sounds simple, it even is, but information about how to do it is hard to find, unless you know that instead of googling for "alsa ac3", which gives you tons of information on how to split up a 5.1 signal to analog output, you have to google for... Nope, won't tell you yet. ;-)</p>Sewing machine2011-02-10T20:30:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/sewing-machine<p>I bought a cheap sewing machine at Lidl (a German grocery chain) today for only 60 Euros. An independent test report said it's okay for the price, and indeed it is. It does sew neat straight seams. However, the manual is a bit confusing and if I hadn't learned how to use a sewing machine (well, at least the basics) on a quality machine ten times worth this one I would have been totally lost. Which leads me to the question who is the targeted user of this machine? Everyone from experienced hobbyist level on would rather spend some more money for a quality machine. A beginner would quickly despair and give up.</p><p>How does this relate to software? Well, for example: <a href="http://cinelerra.org/">Cinelerra</a> certainly is a great video editing software with all features a professional wishes for. And in the hands of a professional editor it is indeed very powerful. Yet, the pro will rather spend the money on Adobe Premiere CS or Sony Vegas and the like as those have a more consistent workflow. And the beginner will not be able to even edit a five minute video of yesterdays birthday party. Or, to a lesser degree, take a look at <a href="http://www.gimp.org/">The Gimp</a>. Same problem. Adobe Photoshop or Lightroom have a far better workflow, even though you can achieve the same results with The Gimp. Don't get me wrong, both The Gimp and Cinelerra are great tools. I'm exclusively using The Gimp to edit my photos, but it took quite long to learn to get the results I want (which are often just one or two mouse clicks in Photoshop.) Also, I'm currently using Cinelerra for my video editing as I plainly do not want to spend THAT much money on Premiere CS for my few projects. Yet, I know a lot of artists and observe how they work. They'd simply not get their work done in time being forced to follow sub-par workflows.</p><p>But software can evolve. Remember <a href="http://www.blender.org/">Blender</a> from a couple of years ago before it became free software? You couldn't work with it. If you never had a second look at it, this is the time. Yes, the current 1.5 beta probably has some few issues. But I see one render artist after another moving away from their proprietary extremely expensive tools to Blender. Because it now has a consistent workflow and it has almost all features needed. And you know how this happened? Because they have a very active and innovative community of developers and users. Many of the developers are even users of Blender. In my opinion something this wonderful can only happen with Free and Open Source Software.</p>Streifen, an amazing animation movie2010-10-28T09:30:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/streifen-an-amazing-animation-movie<p>The days are getting shorter, the nights are getting longer... The perfect season to watch movies! And for those who haven't been to Eurofurence, or who missed its premiere there, I have a recommendation:<em>Streifen</em> by German fantasy artist, animator and film maker <a href="http://users.livejournal.com/kyomotion/">kyo</a>.</p><p><em>Streifen</em> is a feature-length animation movie written and made almost entirely by <em>kyo</em>, with just a little help from some friends. The story is not as straight-forward as your average Hollywood animation movie, but it kept at least me captivated for the whole length. If you don't understand right away what this is about: don't worry, it will come together during the show. It has some few adult scenes, violence and probably disturbing concepts, but the movie is too complex for children anyway.</p><p>If you like animation art, you can download the movie at <em>kyo</em>'s website <a href="http://www.fireball.org/">fireball.org</a> or <a href="http://www.vimeo.com/15785324">watch it on Vimeo</a>. Hint: watch it on the largest screen you can find. It's worth it.</p>Improving the small shoulder support2010-07-06T21:10:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/improving-the-small-shoulder-support<p>Does anyone remember <a href="http://woelfisch.livejournal.com/102625.html">the shoulder unicycle</a>? It used to be just an aluminum bracket to rest against the shoulder. Very simple and very effective.</p><p>In the meantime, I have added an L-bracket with a hot shoe mount for a microphone holder and purchased a Swit LED camera light which comes with an adapter for Sony L series batteries that has to go somewhere. Time for some improvements. Now it's a <em>pimped shoulder unicycle</em>:</p><p><a href="http://img.woelfisch.de/shoulder-support/sm-shoulder-sup-update.jpg"><img height="221" src="http://img.woelfisch.de/sm-shoulder-sup-update.jpg" width="240"/></a></p><p>In retro-perspective I just could have bought a rail support. But where's the fun in that?</p>Upgrading from openSUSE 11.1 to 11.2, continued2009-11-17T18:54:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/upgrading-from-opensuse-111-to-112-continued<p>After more or less successfully upgrading three very different machines online and at least ending up with usable network afterwards, I dared to upgrade the machine in the data center at the other end of town. And promptly ran into <a href="https://bugzilla.novell.com/show_bug.cgi?id=546575">bnc#546575</a>, which earned me a trip to said data center as the machine wasn't accessible by network anymore.</p><p>If you want to upgrade a machine with a fixed network configuration, better check if <kbd>/etc/udev/rules/70-persistent-net.rules</kbd> contains the string <kbd>ATTRS{address}</kbd> and change it to <kbd>ATTR{address}</kbd> before starting the update.</p>Upgrading from openSUSE 11.1 to 11.22009-11-13T21:28:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/upgrading-from-opensuse-111-to-112<p>I've encountered some unusual obstacles during the upgrade from <a href="http://www.opensuse.org">openSUSE</a> 11.1 to 11.2. Apparently, my setup is a bit outside of the spec... This is what I had to do.</p><p><center>⁕⁕⁕</center></p><p>I have the <a href="http://packman.links2linux.de/">packman</a> repository added and lots of packages installed from there. Packman sometimes changes package dependencies during the lifetime of an openSUSE release, which don't necessarily get resolved by <kbd>zypper up</kbd>. This can lead to zypper attempting to convert an x86_64 system to i586 on the actual upgrade to 11.2. With many packman packages installed it gets near impossible to find the cause. My advice: make sure to run <kbd>zypper dup</kbd> with the 11.1 repositories before the upgrade.</p><p><center>⁕⁕⁕</center></p><p>After the update, the X11 server came up without working keyboard and mouse. It didn't work with the old xorg.conf configuration file, it didn't work with the server started by sax2. For upgrades, the option<br/><kbd>Option "AutoAddDevices" "off"</kbd> in the ServerFlags section of xorg.conf should had been added, but wasn't.</p><p>Manually adding that option at least gave me back a working server. But it should work without it. Looking at the process list revealed that I had hundreds of <kbd>hald-addon-cpufreq</kbd> processes, but not a single <kbd>hald-addon-input</kbd> process. Running <kbd>hal-device</kbd> revealed every single entry, including the one for the mice and keyboard, being and CPUFreq interface (<kbd>info.interfaces = { org.freedesktop.Hal.Device.CPUFreq' }</kbd>). Strange. But at least I had a working X11 server again.</p><p><center>⁕⁕⁕</center></p><p>Oops, but what's that? Suspend doesn't work either? Okay, I have to go and fix the hald configuration after all. But how, I don't know anything about it and everyone I ask claims to know even less... So I reinstalled the rpm with <kbd>zypper in -f hal</kbd> and ran <kbd>rchal restart</kbd>, and... Wow, it works! And even the autoconfigured X11 works now.</p><p><center>⁕⁕⁕</center></p><p>Sound needs an "rcalsasound restart" to work.<s>I haven't investigated yet why.</s> Speechd was blocking the sound card.</p><p><kbd>rcspeechd stop<br/>insserv -r speechd</kbd></p>Not so much fun with mp3 tagging2009-10-22T20:41:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/not-so-much-fun-with-mp3-tagging<p>I've been observing problems mp3 tags not being displayed on some devices, while others display the information just fine. By chance, I found out why.</p><p>My new Tomtom Go 930 GPS navigation device can play mp3s, which is quite important to me, as the built-in speaker is quite bad. I can barely understand the spoken instructions. I'd rather have the GPS unit hooked up to the line in of the radio. But of course, without the mp3 player it would be quite a boring ride. Actually, the player works quite fine most of the time. But on boot the Tomtom needs several minutes to scan 520 files. During that time, it gets less and less responsive and the GUI almost comes to a halt. This is not acceptable, I cannot wait ten minutes for the GPS almost each time I want to leave.</p><p>Running a search on Google didn't turn up much useful, does everybody only have ten songs on their SD card, or what? I found someone mentioning that the player doesn't like embedded cover art pictures. After discovering that the MP3s indeed had one set and removing them, the Tomtom at least remained somewhat usable during the scan. However, it still took many minutes. But while I was at it, why doesn't it read the title, album and artist information anyway? What's wrong with the id3 tags? Let's have a look at one of the files:</p><p><pre>$ mid3v2 01\ -\ Uprising.mp3 <br/>IDv2 tag info for 01 - Uprising.mp3:<br/>TDRC=2009<br/>TIT2=Uprising<br/>TRCK=01<br/>TLEN=302826<br/>TPE1=Muse<br/>TALB=The Resistance<br/>TSSE=LAME 64bits version 3.99 (alpha 1, Oct 6 2009 09:40:19) (http://www.mp3dev.org/)<br/>$ </pre><br/>Hmm, a pretty normal looking id3v2 tag. What does the Tomtom need, anyway? Some experiments later by manually tagging a file: it needs exactly that, an id3v2 tag. And it will ignore any v1 tag. Didn't I tag everything with both?</p><p><pre>$ mpginfo 01\ -\ Uprising.mp3 <br/>[..]<br/>01 - Uprising.mp3<br/> Audio : Mpeg 1 layer 3<br/> Estimated Duration: 05:02.95s<br/> 128 kbps 44100 Hz<br/> Frame size: 417 bytes<br/> Joint Stereo: (Intensity stereo off, M/S stereo on)<br/> No emphasis, original<br/> ID3 v1.1 tag<br/> ----------------<br/> title : Uprising <br/> artist : Muse <br/> album : The Resistance <br/> track : 1<br/> year : 2009<br/> ----------------<br/> ID3 v2.4.0 tag (more info on http://www.id3.org/)<br/> ----------------<br/> TSSE : LAME 64bits version 3.99 (alpha 1, Oct 6 2009 09:40:19) (http://www.mp3dev.org/)<br/> TIT2 : (empty)<br/> TPE1 : (empty)<br/> TALB : (empty)<br/> TRCK : (empty)<br/> TLEN : 302826<br/> TDRC : (empty)<br/> ----------------<br/>$ </pre><br/>Err, what? The v2 tags are present, but do not have any content if there is a v1 field for the same information available. Okay, let's recreate the idv2 section:</p><p><pre>$ mid3v2 -d 01\ -\ Uprising.mp3<br/>$ mid3v2 -C 01\ -\ Uprising.mp3<br/>$ mpginfo 01\ -\ Uprising.mp3 <br/>[..]<br/>01 - Uprising.mp3<br/> Audio : Mpeg 1 layer 3<br/> Estimated Duration: 05:02.95s<br/> 128 kbps 44100 Hz<br/> Frame size: 417 bytes<br/> Joint Stereo: (Intensity stereo off, M/S stereo on)<br/> No emphasis, original<br/> ID3 v1.1 tag<br/> ----------------<br/> title : Uprising<br/> artist : Muse<br/> album : The Resistance<br/> track : 1<br/> year : 2009<br/> ----------------<br/> ID3 v2.4.0 tag (more info on http://www.id3.org/)<br/> ----------------<br/> TIT2 : Uprising<br/> TPE1 : Muse<br/> TRCK : 1<br/> TALB : The Resistance<br/> TDRC : 2009<br/> ----------------<br/>$ </pre><br/>Further investigation showed that all applications which write the incomplete v2 tags in presence of v1 tags are using <kbd>libid3tag-0.15.1b</kbd>. I haven't found out yet whether this is a bug of the library or the application.</p><p>After re-tagging all 520 titles on the card, the Tomtom Go finally shows the tag information. Scanning the files now takes just a couple of seconds and the Go stays responsive. Mystery solved!</p>A small shoulder support2009-10-11T21:49:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/a-small-shoulder-support<p>The <a href="http://woelfisch.livejournal.com/97448.html">large shoulder support</a> I built a while ago is really useful and I don't want to film without it anymore. However, it is also quite bulky and heavy, which means it is quite impractical to take it on air travel.</p><p>Thus, I built a very small one to rest against my shoulder, not on it. After <a href="http://users.livejournal.com/xanaeth/">Xan</a> <em>shoulder moped</em>, after my own <em>shoulder chopper</em>, let me present the <em>shoulder unicycle</em>:</p><p><a href="http://img.woelfisch.de/shoulder-support/sm-shoulder-sup.jpg"><img height="154" src="http://img.woelfisch.de/sm-shoulder-sup.jpg" width="240"/></a></p>Shoulder Support, rev 1.02009-06-11T21:57:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/shoulder-support-rev-10<p>And here's the solution to my small puzzle. It has something to do with rods, indeed. In fact, it is my first attempt at building a should support for large video camera. It all starts with purchasing materials (notably, aluminium profiles, screws, bolts rivets and tools):</p><p><a href="http://img.woelfisch.de/shoulder-support/shoulder-sup-01.jpg"><img height="142" src="http://img.woelfisch.de/shoulder-sup-01.jpg" width="240"/></a></p><p>The first step is to cut all the aluminium profiles into nice, handy smaller parts so they are easier to dispose... Just kidding.</p><p><a href="http://img.woelfisch.de/shoulder-support/shoulder-sup-02.jpg"><img height="206" src="http://img.woelfisch.de/shoulder-sup-02.jpg" width="240"/></a></p><p>The main rails are 55 cm long, connected with the narrow plates to a rigid frame. The inner width of the frames is 10 cm. Within the frame, there are two adjustable sleds: one to carry the camera plate, one to place to shoulder on. These were constructed with the short rails and the wide plates. Here's everything marked and centre-punched:</p><p><a href="http://img.woelfisch.de/shoulder-support/shoulder-sup-03.jpg"><img height="190" src="http://img.woelfisch.de/shoulder-sup-03.jpg" width="240"/></a></p><p>How do I secure the sleds on the frame? The idea was to have one (for the shoulder sled) or two (for the camera sled) M6 hexagon-socket screws to clamp the sleds to the rails. Alas, the rails are only 1 mm thick, a thread would tear quite quickly. I purchased a couple of L-type weld nuts, drilled some holes</p><p><a href="http://img.woelfisch.de/shoulder-support/shoulder-sup-04.jpg"><img height="75" src="http://img.woelfisch.de/shoulder-sup-04.jpg" width="240"/></a></p><p>and riveted (is that a verb?) them to the rails that carry the plates of the sleds:</p><p><a href="http://img.woelfisch.de/shoulder-support/shoulder-sup-05.jpg"><img height="114" src="http://img.woelfisch.de/shoulder-sup-05.jpg" width="240"/></a><br/>(Never mind the machine screw I used for the photo)</p><p>The next picture shows the components with all holes drilled:</p><p><a href="http://img.woelfisch.de/shoulder-support/shoulder-sup-07.jpg"><img height="213" src="http://img.woelfisch.de/shoulder-sup-07.jpg" width="240"/></a><br/>(Yes, I forgot the screws for the shoulder sled in this photo...)</p><p>As security nuts are for one-time use only, I did a test assembly with normal ones:</p><p><a href="http://img.woelfisch.de/shoulder-support/shoulder-sup-08.jpg"><img height="211" src="http://img.woelfisch.de/shoulder-sup-08.jpg" width="240"/></a></p><p>It worked quite well, however to properly secure the camera sled I had to fasten the screws so far that the main rails bend outwards. Not good in the long run. But the tests revealed that the camera plate slides wide enough that the sled could remain in one location most of the time. Holes (slightly smaller than M6) in the rail locks the screws (and the sled) properly without stressing the rails too much. Another discovery was that the shoulder sled doesn't really has any benefit that way. I was having a hard time stabilizing the camera both with and without it. Adding a plate in front of the sled solved that issue. </p><p>The final assembly, with the additional plate in place:</p><p><a href="http://img.woelfisch.de/shoulder-support/shoulder-sup-09.jpg"><img height="75" src="http://img.woelfisch.de/shoulder-sup-09.jpg" width="240"/></a></p><p>Still missing are a shoulder pad, and the counter-weights to compensate for the weight of the camera. Holding 3 kg of camera at half-arm length is quite strenuous in the long run. The construction (with the correct counter weight) could easily support a Betacam camera, but unfortunately the frame is too wide for my significantly smaller camera. I'll probably build a smaller version of this support, but only after some experience with this version. For a first-time project it turned out quite well, I think.</p>Tinkering2009-06-07T21:56:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/tinkering<p>The current status of a little project I'm working on, done today while waiting for updates on a Hot Issue support call:</p><p><img height="217" src="http://img.woelfisch.de/tinkering.jpg" width="240"/></p><p>I don't know if this will work out in the end, if it does I'll post the result here. If it doesn't you probably won't hear anything about it again. ;-)</p>The old PowerBook2009-06-05T21:31:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/the-old-powerbook<p>After six years of operation, the battery of my 15" PowerBook G4 died. Admittedly, this is an amazing lifespan for a lithium rechargeable battery, but I think I'm not going to replace it. The only (non-Apple) battery packs I'd trust to not set my flat on fire start at 96 Euros. The wireless card started acting up recently, the hardware clock battery has been empty for two years (a non-standard type, soldered to a PCB, which itself is glued to the frame) and to be honest, six years are quite a lifetime for a laptop computer. My netbook, worth 10% the price I paid for the PowerBook, is faster than it. I'll retire the laptop to operate as an Internet terminal while I'm editing videos. For the rest of the year the netbook will be my travel companion even for trips where I'd rather carry a large laptop.</p><p>It's a pity: the PowerBook's TFT display is still the best I ever had.</p>Vacation video (pt 2)2009-05-18T18:58:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/vacation-video-pt-2<p><div style="width: 30em"><em>I am constantly amazed at how easy it is to accomplish things in Linux once someone works out the process. DVD Authoring is a good example of this.<br/><div style="text-align: right">— Chris Stoddard, <a href="http://linuxgazette.net/issue83/stoddard.html">Linux Gazette #83</a></div></em></div></p><p>I beg to differ. But once you understand how it works, it is not hard to automate most of the annoying time consuming steps.</p><p>So I have this DVD Video compliant MPEG stream, but I'd like to have some menu. First of all, forget all the graphical frontends to dvdauthor. "Q" DVD Author sure looks nice and you can easily create rather complex menu structures, but it crashes often and there is no manual (just a bunch of more or less helpful tutorials.) It didn't fit my requirements, at least I wasn't able to define different pictures for highlighted and selected menu entries. You can define differently coloured borders or semi-transparent masks to overlay a picture, but I wanted to have a white icon turning yellow on highlight and grey on select.</p><p><img height="48" src="http://img.woelfisch.de/lj-dvdmenu-play-w.png" width="60"/> <img height="48" src="http://img.woelfisch.de/lj-dvdmenu-play-y.png" width="60"/> <img height="48" src="http://img.woelfisch.de/lj-dvdmenu-play-g.png" width="60"/> </p><p>I've also tried kdvdauth, gdvdauthor, and several more that were not able to properly design a menu the way I wanted it to behave. Okay, let's dig up one of the numerous tutorials from the lazyweb and do it manually.</p><p>Unfortunately, most of the tutorials don't explain why something is done a certain way. The first thing you need to know is that DVD menus are just regular MPEG audio/video tracks with subtitles, glued together with a rather simple scripting engine during authoring. That means that you just need to convert your background image to a video, encode audio, create two subtitle tracks containing the button overlays (one for highlighted buttons, one for selected, or clicked, buttons), and multiplex everything. Very simple, but with some limitations: the video has to be shorter than 30 seconds, it must have an audio substream (can be silence, though) and the button layer graphics can only have four colours at a time, including the background colour, as they are implemented as subtitle graphics.</p><p>Did I mention that it is crucial to understand that highlighting/selectable elements, also called buttons, are in fact subtitles? Okay, so here's the config file for spumux, a subtitle generator and mulitplexer:</p><p><pre><br><subpictures><br/><stream><br/><spu force="yes"<br/> start="00:00:00.00"<br/> select="mask-selected.png"<br/> highlight="mask-highlighted.png"<br/> autooutline="infer"<br/> autoorder="rows"/><br/></stream><br/></subpictures><br/></br></pre></p><p>Our mask layer images are <kbd>mask-selected.png</kbd> and <kbd>mask-highlighted.png</kbd>. These contain all the buttons, spumux will automatically try to detect their position and geometry and enumerate them. You tell <kbd>dvdauthor</kbd> what these do later.</p><p>Now comes the part that needs more thought. I have a video with 34 chapters and up to six chapters per menu. This results in 6 chapter menus, not counting the main menu. The chapter menus look like this:</p><p><img height="144" src="http://img.woelfisch.de/lj-dvdmenu-scenes1.png" style="border: 1px solid" width="180"> <img height="144" src="http://img.woelfisch.de/lj-dvdmenu-scenes2.png" style="border: 1px solid" width="180"> <img height="144" src="http://img.woelfisch.de/lj-dvdmenu-scenes6.png" style="border: 1px solid" width="180"/></img></img></p><p>It's a major PITA to align all the icons for each slide just by calculating their position, thus I did it with The Gimp and multiple layers:</p><p><table><tr><td><img height="144" src="http://img.woelfisch.de/lj-dvdmenu-background.png" style="border: 1px solid" width="180"/> <br/>Background</td><br><td><img height="144" src="http://img.woelfisch.de/lj-dvdmenu-deselected.png" style="border: 1px solid" width="180"/> <br/>Deselected</td><br><td><img height="144" src="http://img.woelfisch.de/lj-dvdmenu-highlighted.png" style="border: 1px solid" width="180"/> <br/>Highlighted</td><br><td><img height="144" src="http://img.woelfisch.de/lj-dvdmenu-selected.png" style="border: 1px solid" width="180"/> <br/>Selected</td></br></br></br></tr></table></p><p>The additional <em>Deselected</em> layer makes it easy to just replace the background image by keeping the graphical elements intact.</p><p>However, exporting single layers and converting them to two bit colour depth is more work than anticipated: every other layer except the one to be exported needs to be removed, otherwise The Gimp creates a palette from the colour information of all the layers... Uargh. And besides, what for do I have a computer? But as I already have layers, and the menu generator of Premiere Elements does something quite cool with Photoshop layers, why not re-implement that?</p><p>I was too lazy to read into The Gimp's scripting engine, and ImageMagick currently recognizes only two layers of an XCF file, so I downloaded and compiled <a href="http://henning.makholm.net/software">XCFTools</a> (thank you Wikipedia for the link!) which unfortunately isn't available from the openSUSE build service (yet). The tools do not require The Gimp's libraries and can convert from xcf to png or pnm.</p><p>With that in mind, I wrote the following script to convert an XCF file to DVD menu:</p><p><pre><br>#!/bin/sh<br/>menu="$1"</br></pre></p><p># Extract background and normal overlay<br/>xcf2png -o "$menu/background.png" "graphics/$menu.xcf" Background Deselected </p><p># Extract and convert highlight overlay<br/>xcf2pnm -a /dev/null "graphics/$menu.xcf" Highlighted | \<br/> convert pnm:- -fuzz 10% -transparent black -colors 2 "$menu/mask-highlighted.png"</p><p># Exctract and convert select overlay<br/>xcf2pnm -a /dev/null "graphics/$menu.xcf" Selected | \<br/> convert pnm:- -fuzz 10% -transparent black -colors 2 "$menu/mask-selected.png"</p><p># Convert the background to an MPEG2 video<br/>png2yuv -n 25 -I p -f 25 -j "$menu/background.png" | \<br/> mpeg2enc -F 3 -n n -f 8 -a 2 -o "$menu.m2v"</p><p># Adjust config file for subtitle / button layer<br/>sed "s:mask:$menu/mask:g" spumux.xml >"$menu/spumux.xml"</p><p># multiplex everything to a DVD stream<br/>mplex -f 8 -o /dev/stdout "$menu.m2v" silence.mp2 | \<br/> spumux -v 2 "$menu/spumux.xml" > "$menu/menu.mpg"</p><p># remove temporary video (you may want to remove the PNGs as well)<br/>rm "$menu.m2v"</p><p>The file <kbd>silence.mp2</kbd> is an MPEG1 L2 audio stream with... silence, of course. Replace with something else if you want audio for your menu, it just has to be MP2 or AC3 encoded. For <kbd>spumux.xml</kbd>, see above. The script takes one argument, the name of the menu. If you run it as "<kbd>./create-menu.sh myMenu</kbd>", it expects the gimp file at <kbd>graphics/myMenu.xcf</kbd> and will write the stream to <kbd>myMenu/menu.mpg</kbd>.</p><p>With The Gimp and a few lines of bash script it really becomes easy to design and author menus for video DVDs. But don't ask how long it took to actually research everything.</p><p>Finally, create a configuration file for dvdauthor (see one of those other tutorials for how to do it) and author the DVD.</p>Vacation video done, at last (pt 1)2009-05-16T22:49:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/vacation-video-done-at-last-pt-1<p>In case you wondered why I didn't update my LJ for several weeks (and rarely said something on Twitter, either): I was busy editing last year's vacation video. I won't link it here, it is mostly personal stuff and the quality of the footage is rather poor, but it was a nice exercise to learn editing. As <a href="http://www.kdenlive.org">Kdenlive</a> still isn't suitable for such a large project (but progressing quite well currently,) I had to resort to a non-free editing solution. <a href="http://www.adobe.com/products/premiereel/">Adobe Premiere Elements</a> did the job amazingly well, at least I didn't miss any feature of the professional version. Granted, as a 32 bit application it runs out of memory quite often with such a comparatively large project, but I've seen much worse behaviour of much more expensive software. The movie had <s>more than 700</s> 774 clips on the time line in the end, and runs for 94 minutes.</p><p><img height="272" src="http://img.woelfisch.de/prel-screenshot.jpg" with="340"/></p><p>The built-in DVD menu generator is not so useful: You can only slightly modify the pre-defined templates, unless you peek around a bit in the file system and discover that those are actually multi-layered Photoshop project files. I purchased the bundle with Photoshop Elements, thus I was able to modify a template a bit more, however opposed to Premiere Elements, Photoshop Elements is lacking some crucial features like guard lines (you can see but not create or move them) and some effects aren't directly accessible (you can "copy" them from some existing project, though.) I ended up installing The Gimp on the Vista system for the other graphics needed.</p><p>PRE's built-in export modules for DVDs and H.264 are broken. This is one frame from the DVD <br/>generated by PRE:</p><p><img height="255" src="http://img.woelfisch.de/rt-dvd-artifact.jpg" width="340"/></p><p>The (animated) caption is wrong, here's a close-up:</p><p><img height="122" src="http://img.woelfisch.de/caption-artifact.jpg" width="240"/></p><p>The vertical black line next to the blue box is in any export via the "distribute" menu. A DV video export does not have this artifact:</p><p><img height="122" src="http://img.woelfisch.de/caption-dv.jpg" width="240"/></p><p>What now? Well, reboot to my usual openSUSE Linux desktop, grab some multimedia conversion tools from <a href="http://packman.links2linux.de">Packman</a> and convert the DV file with ffmpeg. Et voila:</p><p><img height="122" src="http://img.woelfisch.de/caption-fixed.jpg" width="240"/></p><p>Unfortunately, FFmpeg is currently <em>a bit</em> too restrictive regarding DV AVI files generated by Windows. I get literally thousands of messages like <em>AC EOB marker is absent pos=64</em>. This is being tracked as <a href="https://roundup.ffmpeg.org/roundup/ffmpeg/issue1060">issue 1060</a> by the FFmpeg issue tracker, but not resolved yet. Don't think that MPlayer's mencoder would do any better: it relies on FFmpeg for reading DV files. Additionally, it crashes before it could finish conversion. What now? Extracting video and audio with <em>tcdecode</em> from the <a href="http://www.transcoding.org/">transcode</a> package does work, but I wasn't able to multiplex the streams again, as the current version of ffmpeg seems to ignore <kbd>-itsoffset</kbd> and transcode insists on re-encoding the whole video...</p><p>A colleague mentioned <a href="http://fixounet.free.fr/avidemux/">Avidemux</a> a while ago, and indeed: it is able to rebuild the stream without re-encoding its content. It also is able to encode to other formats, so I had some well encoded MP4 files very quickly. And it can even create MPEG2 streams suitable for DVD authoring! Or so I thought. Well, the lavc encoder sure has excellent compression, and it looked very well on the computer screen. However, my DVD player didn't like the stream at all. Apparently, it swapped the half-pictures, despite using the correct options. Mplayer and vlc don't care about it (in fact, they don't even recognize that something is wrong), so I had to rebuild the track again with FFmpeg after I was done with the menus and mastered the first DVD. Ugh. Hint: use single pass encoding to check whether it works at all, and afterwards recreate the stream with two-pass encoding. But don't fix the chapter entry points before you've created the final stream, as the start of the GOPs will change and FFmpeg cannot place GOP starts at pre-defined times.</p><p><em>To be continued...</em></p>About eating your own dog food2009-04-16T11:39:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/about-eating-your-own-dog-food<p>I've successfully updated my machine located at the data centre from openSUSE 11.0 to 11.1 via a remote SSH connection and "<kbd>zypper dup</kbd>" yesterday. Contrary to my previous experiences with online upgrades, only minor obstacles were encountered:<br/><ul><li>Jabberd, the only package from OBS, got rebuilt between downloading the meta data and the package itself</li><br/><li>Zypper somehow got confused by blank characters in repo locations midway through the update (simply restarting zypper helped)</li><br/><li>I had to copy back my manually edited postfix configuration as it was replaced by the generic one from the RPM</li><br/><li>Tomcat6 startup scripts missing JAVA_HOME</li></ul><br/>Just two hours of work (mainly observing zypper working and checking functionality), no serious breakage, no trip to the data centre, no manual update of half of the packages. I'm truly impressed.</p>Wake on LAN doesn't2009-04-08T12:39:00+00:00o'wolfhttps://woelfisch.de/blog/author/owolfhttps://woelfisch.de/blog/wake-on-lan-doesnt<p>One difference between openSUSE 11.0 and 11.1 really bugged me: even though I enabled Wake on LAN (WOL) on eth0, the driver would switch off the transceiver on suspend to RAM. After some investigation I found that the atl1e driver has the "wakeup" flag for power management set to "disabled", regardless what I set with ethtool. After enabling it with "<kbd>echo enabled >/sys/class/net/eth0/device/power/wakeup</kbd>", WOL works again. As a quick workaround I created a file <kbd>/etc/udev/rules.d/78-enablewol.rules</kbd> with the following udev rules:<br/><pre>SUBSYSTEM=="net", ENV{INTERFACE}!="eth*", GOTO="skip_wol"<br/>SUBSYSTEM=="net", ACTION=="add", RUN+="/bin/sh -c 'echo enabled >/sys/class/net/$env{INTERFACE}/device/power/wakeup' "<br/>LABEL="skip_wol"</pre><br/><strong>Edit:</strong> Forgot that redirections aren't implemented in udev. Sigh.</p><p><strong>NB:</strong> Of course you also need to actually turn on WOL. Either by setting "<kbd>ETHTOOL_OPTIONS='wol g' </kbd>" in <kbd>/etc/sysconfig/network/ifcfg-eth0.cfg</kbd> if you are using "traditional" network setup with ifup/ifdown, or by adding <pre>SUBSYSTEM=="net", ACTION=="add", RUN+="/sbin/ethtool -s $env{INTERFACE} wol g"</pre> to above udev rules.</p>