Ubuntu, Apparmor and moved home dirs

I got a new HDD recently and linked /home to a new partition mounted on /data/, /data/home/. Just like I did a dozen times before. Now a realized, that my pdf viewer evince (and surely some other programs) aren’t working anymore. Evince crashes with this error message:

(evince:22792): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported
(evince:22792): Gtk-WARNING **: Attempting to read the recently used resources file at `/home/lenfers/.recently-used.xbel', but the parser failed: Datei »/home/lenfers/.recently-used.xbel« konnte nicht geöffnet werden: Permission denied.
** (evince:22792): WARNING **: Error creating last_settings file: Fehler beim Öffnen der Datei »/home/lenfers/.gnome2/evince/last_settings«: No such file or directory

As I found out, that is caused by AppArmor, a surely useful innovation to secure your computer, but new enough that I haven’t took the time to get to know it. AppArmor is activated by default on Ubunut 10.04 (and IIRC 9.10 and maybe 9.04 as well) and restricts access of programs on certain files. Due to the change of my home directory, evince tried to access files which for AppArmor are in /data/home/lenfers/ and consequently disallowed access to them.

The solution to this is easy, after I found it: Make your new location for home directories known to AppArmor: Add the path of your home direcories to the HOMEDIRs var in  /etc/apparmor.d/tunables/home. Now the line looks like that for me:

@{HOMEDIRS}=/home/ /data/home/

Now back to work. 🙂

What do you think of this post?
  • Useful (8)
  • Awesome (6)
  • Boring (4)
  • Interesting (3)
  • Sucks (1)

VDR hack: Stream video with synced audio

VDR streams very well with the streamdev-plugin, but only unicast http streams. That is usually no problem, because even 3 streams aren’t nearly too much for a normal 100Mbit home network and I wouldn’t need any more at home. But with the world cup starting tomorrow me and Karin are going to watch some games that aren’t that interesting to us at the computer while doing other stuff. We did this before, but the downside is that we never got the http stream really synchronized and nothing is more annoying than the same audio stream with a one second delay in one room. (Our solution was to mute one stream, but thats not a real solution because one of us always has to have a asynchronous audio to the video signal.)

My hack I will be using for the world cup the next four weeks is the following: I described how to stream the world cup at your office for all your colleagues a few days ago. I will do that at home too, and then just play that stream, in which the video and the audio are really in sync, at least for my ear. I have to play the stream, because the VDR still has control over the DVB devices and VLC couldn’t open them. And the VLC on my VDR is quite ancient, since I’m using an older version of c’t-vdr.

So, on one computer I start VLC with the following options (all in one line):

cvlc  http://vdr:3000/S19.2E-1-1101-28106  ":sout=#rtp{dst=226.42.42.42,port=5004,mux=ts}"

You can get the URL for each channel from your vdr at http://vdr:3000/channels.html.

And on all the computers that are supposed to view the stream, VLC has to be started with the following command:

vlc rtp://@226.42.42.42:5004/

Sure there is now a slightly higher delay (two streams), but I don’t mind those three seconds when we can watch the games with synced audio. You can get a bit more information about streaming in my world cup streaming post and a lot more in the VLC streaming documentation.

What do you think of this post?
  • Interesting (5)
  • Useful (4)
  • Awesome (1)
  • Boring (1)
  • Sucks (0)

Google Maps Navigation nun auch in Deutschland

Seit heute ist es möglich ein Android Mobiltelefon mit Google Maps als Navigationssystem mit „Turn-by-Turn-Navigation“ und Sprachausgabe zu benutzen. In den USA gibt es das Feature nun schon einige Monate, nun dürfen wir in Deutschland auch. Ich habe die Funktion eben auf dem Rückweg von der Arbeit getestet und muss sagen, dass es ziemlich gut aussieht für eine Beta-Version. Ich hatte mir zwar für rund 30€ CoPilot Live 8 gekauft, was auch immer gut funktioniert hat, aber Google präsentiert sich als leichtere und schnellere Alternative für mich. Hätte es Googles Lösung vor einem Jahr schon gegeben, hätte ich sicherlich kein Geld für CoPilot ausgegeben, da ich es auch selten nutze. Bei meinem 15km Test eben wäre Google zwar eine andere Strecke als ich gefahren, aber das machen die anderen Navigationssysteme, die ich bisher gesehen habe auch. Ansonsten war die deutsche Sprachausgabe gut verständlich, auch wenn ich mit der Zeit auf eine natürlichere Stimme hoffe. Da es kostenlos ist, möchte ich nicht zu viel drüber schreiben, es kann sich schließlich jeder selbst ein Bild davon machen. Und wer kein Android Mobiltelefon hat, kann sich das durchaus beeindruckende Video mit den Funktionen aus den USA anschauen, wie z.B. Verkehrsdichte:

Mehr Infos und Bilder auf Googles Seite zur Google Maps Navigation.

What do you think of this post?
  • Interesting (5)
  • Boring (2)
  • Awesome (1)
  • Useful (1)
  • Sucks (1)

Flattr: Flatrate für Blog-Bezahlung

Ich habe letztens von flattr erfahren und heute meinen Beta-Invite bekommen. Falls ihr Interesse habt, verlose ich hier einige Invites. Für die, die noch nicht wissen was flattr ist, empfehle ich das unten eingebundene YouTube-Video. Flattr ist ein Micropayment-Dienst, bei dem man einen monatlichen selbst gewählten Beitrag zahlt. Dann kannst Du verschiedene Inhalte im Netz flattrn, womit Du zeigst, dass Du den Text, das Video oder ähnliches gut findest. Zahlst Du z.B. 3€ im Monat und flattrst 20 Seiten, bekommt jede Seite über Flattr 0,15€. Das ist nicht viel, aber man möchte ja auch nicht gleich 5-10€ über Paypal spenden, nur weil einem ein Beitrag gut gefallen hat. Und der Vorteil ist, durch den festen Betrag hat man volle Kontrolle und man muss sich keine Gedanken machen, dass man zu oft klickt und am Ende eine große Rechnung hat.

Um bei der Verlosung mitzumachen, hinterlasst doch einfach einen Kommentar. (Mit richtiger E-Mail-Adresse, wird nicht angezeigt, aber ich brauche sie zum Verschicken des Invites.)

What do you think of this post?
  • Interesting (3)
  • Awesome (1)
  • Useful (0)
  • Boring (0)
  • Sucks (0)

Stream of the World Cup 2010

This year I wanted to stream the FIFA World Cup 2010 (or Weltmeisterschaft 2010 here in Germany :)) to a few computers at my work. I chose VLC to do this because of its build in excellent streaming capabilities. There are also more flexible or powerful streaming solutions from VLC like VLM or DVBlast, but I wanted to keep it simple. If you know a good and simple setup guide for one of those systems, I would love a link in the comments to it.

Behold, there might be restrictions in your country, that prohibit even this personal use, please check before deploying this somewhere!

Prerequisite

  • A spare computer with Linux,Windows or I presume OSX. It doesn’t even need to be spare one: Since we don’t want to transcode, it uses virtually no resources.
  • a DVB card supported by your operating system (I’m using DVB-T in my example)
  • VLC

Setting up the stream

Setting up the stream consists of two parts: You need the source and the stream settings. For the source settings with DVB-T you’ll need to know the frequency of the channel you want to stream. Here in Bremen, Germany for example the frequency for ARD is 482000Khz. You can use the tool scan to generate a channels.conf when running linux (found in the package dvb-apps in Ubuntu) and probably OSX. I don’t know how to get a channels.con or the frequencies on a windows box, but maybe you can find a channels.conf for your region in the VDR Wiki. An entry in the channels.conf looks like that:

Das Erste:482000:I999B8C23D12M16T8G4Y0:T:27500:261:262:267:0:160:8468:3329:0

The red number in the second field is the frequency we need, here 482000Khz. You can try it out by opening VLC and choosing Media=>Open Capture Device (or Ctrl+C). The capture mode has to be set to DVB (DVB Directshow on Windows), you need to fill in your frequency, ignore the advanced options and hit Play. You should be able to see a channel, but not necessarily the one you wanted. There are usually three to four channels on one frequency, so you might need to tune manually to the channel you wanted in Playback=>Program. (The SID of the channel (160) is marked in green in the example above, we’ll use it later to tune to that channel automaticly.)

When that worked we can start setting up the stream. VLC can stream anything it can play, you could stream video files, webcams and a lot of other media. We’ll set the stream up as a multicast stream for a local network with RTP, so it will not work through internet connections. If you want to set a stream over the internet up, please refer to the VLC streaming documentation, but don’t forget that you might need a lot of bandwidth for multiple clients. The advantage of multicast over unicast streaming is that we need to send the data only once into the network and not to every client. The client either ignores the traffic or subscribes to it and receives it.

We need a multicast address to identify our stream and we can chose in the range from 224.0.0.0 to 239.255.255.255, e.g. 226.42.42.42. To set the stream up, chose Media=>Streaming (or Ctrl+S) and select Capture Device. Set the DVB settings up like you tried out above and select Stream. Your settings are copied into the Source field in the next dialog, so you could simply click next. But you might want to copy the settings into a text file for the automation later. Next you will have the possibility to set the stream settings up: As destination chose RTP and click Add. You should get something like the following, where you should put in your multicast address, uncheck the transcoding option and leave the other options on default settings:

After a click on next you get a few options you can leave alone and, like with the source before, a string for the stream. We should copy that one too to the text file and click on stream. We are now streaming a channel to the network, even though you cannot see anything.

Connecting with a client

To see the stream, you need to connect to it. You can do that locally on your own computer too, just open a new VLC and choose Media=>Open Network Stream. Check RTP as protocol and put in your multicast address:

You can now already save a playlist file to send to your clients later on. Make sure your playlist is empty besides that stream (Ctrl+L opens it) and then save it Media=>Save Playlist to File (or Ctrl+Y).

Automating the Server

This is supposed to be a quick and dirty solution, we won’t create start scripts for this or run it as a NT service. But if you don’t want to set the server settings up every time you start the stream, you can create a batch file under windows or run it completely from the command line on linux. (Preferably in a GNU screen session.)

Linux users can run cvlc without an interface, but can also use vlc if they want the interface. You can run the following line after replacing your my settings with the ones you gathered directly in a shell (or a shell with screen) or you can put it into a .sh file and run it as a script.

cvlc dvb-t://frequency=482000000 --ts-es-id-pid --program 160 ":sout=#rtp{dst=226.42.42.42,port=5004,mux=ts}"

In windows create a .bat file with a simple text editor and replace my example with your settings (all in one line). Of course you can configure a lot more settings with the GUI and get very complex settings in the first step for this. (On 64bit Windows, you might have to replace %ProgramFiles% with „%ProgramFiles(x86)%.) Then you can just run the .bat file instead of setting the stream up every time.

"%ProgramFiles%Videolanvlcvlc.exe" dvb-t://frequency=482000000 --ts-es-id-pid --program 160 :sout=#rtp{dst=226.42.42.42,port=5004,mux=ts}

The frequency is here given in Hz, not Khz, so you need to add three more zeros.

Conclusion

I hope this simple tutorial about streaming helped you to stream the word cup wherever you wanted. I wrote it, because I had some problems in the beginning, since the VLC documentation is being revised for the current 1.0 series and didn’t reflect always the current status.

I found it very impressing that I could stream a channel to three different computers in the same room and the audio was in sync, at least for my ears. I would love to see something like this to find it’s way into VDR or some other solution to stream audio (or even video!) at home…

What do you think of this post?
  • Awesome (5)
  • Interesting (4)
  • Useful (3)
  • Boring (1)
  • Sucks (0)