Computer, Coffee & Co
Beiträge getaggt mit linux
Ubuntu, Apparmor and moved home dirs
17. Jun
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.
VDR hack: Stream video with synced audio
10. Jun
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.
Stream of the World Cup 2010
08. Jun
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%\Videolan\vlc\vlc.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…
Asus M4N78-VM and wakeup under linux
20. Apr
I guess if I wait until I’ve completed something, I’ll never blog about stuff like this. So I’ll try to have this here in smaller bites:
My new mainboard for the vdr (Asus M4N78-VM) runs great so far with linux, especially at the moment yavdr: HDTV on the DVI worked out of the box. And my biggest fear that I’ll get problems with the wakeup are completely wiped out: The board woke up after setting a time with acpi-wakeup. (Well, it didn’t boot up, because there are some problems with the standby mode, but I don’t need that too bad.)
Only real bummer: The board doesn’t fit in my gorgeous Silverstone LaScala SST – LC 11M. Don’t know what to do yet, the case is really nice, but quite small. I would like to buy something where I can fit pci cards without a riser card, but that on the other hand doesn’t fit in my living room anymore.
Installation via USB
19. Apr
I just got some new hardware for my new (or overhauled) vdr. (More on that later…) I wanted to try out yavdr and needed a cd drive for the installation. I looked in my basement for an old drive, finally found one in an old IBM Intellistation and got it out of there. Then I burned the cd, very sloooowly, so the old drive can read it, found a PATA cable to connect the drive and booted. Half through the boot process the drive couldn’t read the cd anymore… All that hassle, just because I seem to be too oldschool to think of usb drives. Since I already got the iso image on my computer, it took around 3 minutes to use usb-creator to create a bootable usb drive. Too easy for me I suppose…
Samba+Cups with 64bit Windows clients
11. Feb
The new Dell desktops we get at work, don’t come with an Windows XP license anymore. And I guess it’s kinda time to exchange the old XP installations, at least on the new desktops. But now we had the problem, that the current windows cups driver doesn’t support 64bit windows. Solution: Check out the current driver from the subversion repository. (Source)
So, that problem seems solved, but now I need a newer samba version to push the drivers to the clients. I’ve got the current Ubuntu 8.04 LTS version (3.0.28) and as far as I understand, I need a 3.4.x. Now I wait for the new LTS version of Ubuntu, which should arrive in April. Further information:
Emacs keybindings in gnome and firefox
04. Feb
For those who love their readline/emacs keybindings, you can have firefox and all gtk applications behave a little bit like that. This article describes how easy you can activate it and what keybindings there are. I recently created a new user profile for myself and missed the keybindings I got used to. To activate it under gnome, it’s enough to run the following command and have shortcuts like C-a, C-e or C-k work again.
gconftool-2 --set /desktop/gnome/interface/gtk_key_theme Emacs --type string
uTorrent & wine
05. Jul
Ich habe ja Ewigkeiten meine Finger von wine gelassen. Es ist ein tolles Projekt, wirklich, aber ich habe VMWare installiert und für die meisten Programme ist es einfach besser, vorallem seit es die Virtualisierungsunterstützung in den CPUs gibt. Aber diesmal musste es mal sein, da ich auf meinem kleinen Server kein VMWare installieren will – da wären die Via EPIA CPU (trotz 1,3Ghz) und die 512 MB RAM ganz gut gefordert.
Ich benutze sehr gerne rtorrent, ein super Torrent-Client: Sparsam (lief auf meiner NSLU2 mit 233Mhz und 32MB RAM) und zuverlässig (er lief immer bis ich die NSLU2 nach einigen Wochen ausgemacht hab
). Ich kann torrents jedem empfehlen: Ob es die aktuelle Debian/Ubuntu-CD ist oder ein OpenSource-Ego-Shooter, viele Software-Anbieter bieten ihre CDs als torrent an. Und was einige nervig finden finde ich gerade gut: Ich habe die aktuelle Debian-CD bei der Arbeit mit 3,5MB/s gezogen, besser wirds nicht, da die Uni-Bremen keinen Debian Mirror hat. Außerdem spart man Ressourcen, also meist Geld, des Anbieters, die Upload-Bandbreite bei den Usern ist doch sowieso ungenutzt.
Soviel zur Einführung.
Heute musste ich etwas von einem Torrent-Tracker laden, der leider rtorrent und einige andere Unix-Clients verboten hatte. Nachdem ich keinen finden konnte, hab ich auf der Liste der unterstützten Clients utorrent gefunden. Und wine installiert. Und es klappte ausgezeichnet, ich hab utorrent in einem VNC-Server gestartet, damit ich remote drauf zugreifen kann, die Installation lief sauber durch und es startete auch. Als ich dann später zuhause ankam und mal gucken wollte, wie die Last auf meinem Serverchen aussieht, war ich echt erstaunt, wie wenig das war. Falls es Leute gibt, die sich mit rtorrent nicht anfreunden können, weil sie von Windows rübergeschwappt sind, die sollen mal utorrent mit wine ausprobieren, es ist schnell und verbraucht nicht viel.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 29559 lenfers 18 0 2596m 13m 7692 S 1.0 2.8 21:23.78 utorrent.exe 25938 lenfers 15 0 18340 13m 5020 S 3.0 2.8 12:58.66 Xvnc 29593 lenfers 18 0 2588m 6528 4980 S 0.0 1.3 0:00.35 explorer.exe
VDR Zwischenstand: Vernetzt, divx, automatische Aufnahmen
30. Mai
Mir ist aufgefallen, dass ich eigentlich nach der Einrichtung meines VDRs mal schreiben wollte, was denn jetzt alles funktioniert, da ich sowas (passend für mein geplantes Setup) damals vor dem Kauf nicht finden konnte. Zuerst mal zum Setup:
- Im Wohnzimmer steht der Haupt-VDR (chalooby), der mit zwei Sat-Karten das Signal von der Sat-Schüssel bekommt, die Aufnahmen macht und all den anderen tollen Kram.
- AMD XP2400+ (leider) mit 256MB in einem Silverstone LaScala SST – LC 11M
- Eine FullFeatured-Technotrend-Sat-Karte und eine Budget-Karte
- DVD-RW zum Abspielen von DVDs und zum Brennen von Aufnahmen
- Samsung 160GB Platte für die Aufnahmen (etwas klein mittlerweile…)
- Eine Fernbedienung (mit der Möglichkeit über diese den VDR ein und auszuschalten)
- c’t-VDR 5.0 mit Debian Sarge und vdr-Quellen von e-tobi erweitert
- Im Schlafzimmer steht der Zweit-VDR yeti:
- Angebunden ausschließlich über 100Mbit (kein Sat-Kabel)
- P2-450Mhz mit 128MB in einem schönen schwarzen schlanken IBM-Desktop-Gehäuse
- Eine FF-Sat-Karte als MPEG2-Decoder und für den TV-Out
- Eine 1GB CF-Karte an einem CF2IDE für das System
- DVD-Laufwerk
- Eine einfache Universal-Fernbediehnung an einem selbstgebauten seriellen Empfänger
- c’t-VDR 5.0 mit Debian Sarge und vdr-Quellen von e-tobi erweitert
Der Haupt-VDR funktioniert sehr gut, nur ist er durch das kleine Gehäuse zu laut geworden. Meiner Ansicht nach hat iTV:Media da Mist gemacht und ihre eigene Beschreibung nicht gehalten. Aber die sind mittlerweile Pleite und ich wunder mich auch nicht wieso… Aber folgendes funktioniert gut:
- Fernsehen mit schnellen Umschaltzeiten für Digital-TV und EPG
- Automatisches Aufnehmen von Sendungen anhand von Regeln (bis zu RegEx auf Titel/Beschreibung etc.)
- Abspielen von allen Formaten, die mplayer abspielen kann direkt auf dem Fernseher
- Time-Shifting und Aufnehmen von mehreren Sendungen, während man eine andere guckt (je nach Anzahl SAT-Karten dann nur eingeschränkte Sender-Auswahl)
- Aufnahmen übers OSD auf DVDs brennen
- Automatisches Ein- und Auschalten vor und nach programmierten Aufnahmen
- Programmieren von Aufnahmen über ein Webinterface (zusätzlich zum OnScreen-Menü)
- Musik (MP3s) abspielen
- TV ins Netz streamen, so dass man am Desktop z.B. per mplayer TV gucken kann. Diese Methode finde ich jedoch nicht so komfortabel, aber um mal zwischendurch Wer wird Millionär zu gucken reichts allemal.
- Mit verschiedenen Plugins noch erweiterbar: Wetter, Spiele uvm.
Durch die beeindruckende Netzwerk-Fähigkeiten muss ein VDR keine SAT-Karte haben (die in yeti ist nur für das Dekodieren des MPEG2-Signals zuständig) und mit Hilfe eines anderen VDRs dennoch alles machen, was er mit normalem Sat-Anschluss könnte. (Evtl. kleinere Einschränkungen.) In meinem Szenario gehört dazu:
- Einfach TV gucken. Die Umschaltzeiten sind etwas länger als am Haupt-VDR, aber mit 2 Sekunden noch im Rahmen. Dafür gibt es alles, was dazugehören muss: EPG, je nach Sender auch mit erweiterten Infos.
- Aufnahmen vom Haupt-VDR abspielen. Da gibt es bedienungstechnisch absolut keinen Unterschied, ich mounte das Verzeichnis automatisch übers Netz und kann dann ganz normal übers Menü Aufnahmen abspielen.
- Auch DVD abspielen funktioniert ohne nennenswerte CPU
- Übers Remote-Menü kann ich auch Aufnahmen am Server programmieren.
Fritz!Card PCI, Anrufbeantworter (vbox3) und Ubuntu
29. Mai
Nachdem ich mit der Fritz!Card USB soviel Ärger hatte (bis zur Kernel Panic am Ende), habe ich im Keller eine Fritz!Card PCI gefunden, die jetzt erstmal im einzigen PCI-Slot des VIA Epia Boards arbeitet. (Find ich zwar verschwendet, aber noch hab ich nichts anderes, was da rein soll und vielleicht bessert sich die Lage mit der Fritz!Card USB.)
Aber dafür funktioniert sie jetzt gut. Ich habe gestern nur noch mit Ubuntu-Mitteln alles zum Laufen gebracht. (Wobei mir in der Anleitung gefehlt hat, dass man (ich zumindest) neben den Modulen capi und capifs auch noch capidrv und isdn braucht.) Das Installieren von vbox3 hat Ubuntu übernommen, die Konfiguration habe ich aus einem pro-linux Workshop. Die erste Testphase hat er überwunden und ich werde ihn die Tage dann richtig aktivieren. Die Vorteile einer solchen Lösung sind vielfältig:
- Mein alter AB hatte eine lausige Qualität, die die ISDN-Qualität bei weitem unterschritten hat. (Also liegts nicht an der Leitung oder so.)
- Man bekommt eine E-Mail mit dem aufgesprochenen Text als .ogg zugeschickt und kann dann falls es wichtig ist sofort reagieren (Handy, etc.)
- Personalisierte Ansagen lassen sich sehr einfach realisieren
- Und das wichtigste: Ich kann endlich ganz genau sagen, wie oft der AB klingeln lassen soll, das ging bei unserem 2-3 Jahre altem AB nicht.
- Man kann außerdem ziemlich einfach zu Schlafenszeiten den AB sofort oder nach einmal klingeln dran gehen lassen.
- Mit ein wenig Phantasie und einigen Skripten geht bestimmt noch viel mehr
Als nächstes will ich mich mit faxen&Linux beschäftigen, um das eine Mal im Jahr, in dem ich faxen möchte, das auch zu können.







