howto run a TechniSat Skystar HD2 on linux

since i’m switching from my analog WinTV-PVR-500 to a DVB-S setup in my mythtv box I installed a TechniSat Skystar HD2 card (a rebranded Azurewave AD SP400 CI VP-1041) and to my surprise I got it running fairly quickly.

here’s a description on the first steps i took in creating a mythtv box with DVB-S and hopefully DVB-S2.

install mercurial (distributed version control system). In debian based systems:
sudo apt-get install mercurial

then obtain the latest mantis multiproto drivers. there is no patching necessary for the card to run.
hg clone http://jusst.de/hg/mantisthen compile and install.
make
make install

more info can be obtained here under “Method 2″.

the modules can be loaded manually but to test the correct loading a reboot is easier. now the card should be loaded at boot.

to create a channels.conf you’ll need scan from the dvb-apps located on linuxtv.org.
the way to get this working quite easy is described here. the TerraTec Cinergy S2 PCI HD CI is another clone of the same card.

make sure that the changed line in the Makefile has the correct path. in the example it is
CPPFLAGS += -I/usr/src/mantis/linux/includebut since i compiled in my home directory my path was different (this is quite obvious but i thought i’d state it to be sure).

EDIT:i noticed that scan with the patch don’t work anymore… it should work just using the compiled scan in the dvb-apps/utils directory!

while running scan:
./scan dvb-s/Astra-19.2E > ~/.szap/channels.confcheck to see if these lines (or any stating: Using ‘STB0899 Multistandard’ DVB-S2) appear.
----------------------------------> Using 'STB0899 Multistandard' DVB-S2
Tune to frequency 11914500
DVB-S IF freq is 1314500
0x0006 0x0081: pmt_pid 0x0062 PREMIERE -- PREMIERE HD (running, scrambled)
0x0006 0x0082: pmt_pid 0x0063 PREMIERE -- DISCOVERY HD (running, scrambled)
0x0006 0x0084: pmt_pid 0x0065 BetaDigital -- ANIXE HD (running)
0x0006 0x0083: pmt_pid 0x0064 BetaDigital -- ASTRA HD+ (running)
then you know that DVB-S2 is working also! yay!

afterwards i had 1187 services only on Astra 19.2E. half of them scrambled but hey, the numbers count ;)

now to test the whole thing enter the dvb-apps/test directory and try zapping to a channel (check in the ~/.szap/channels.conf to see which number is good to go and not scrambled).
./szap2 -r -n 085
the output will show you some channel data and as soon as “FE_HAS_LOCK” is displayed (keep szap running) open mplayer in a different terminal
mplayer /dev/dvb/adapter0/dvr0
and you should see a picture! alright, the card is up and running!

all seems good but i still have a problem with DVB-S2. and that is as soon as i’m trying to display a DVB-S2 channel like ANIXE HD (channel #550 in my channels.conf)
./szap2 -r -t 2 -n 550i get a “FE_HAS_LOCK” but mplayer then just returns:
TS file format detected.
VIDEO MPEG2(pid=1535) AUDIO A52(pid=1539) NO SUBS (yet)! PROGRAM N. 0

and that’s it…

i think i’m missing some codecs or something (w32codecs,DeCSS, x264, etc. is installed).
any help is appreciated though ;)

NOTE: don’t forget to add the option “-t 2” for DVB-S2 for szap

UPDATE: i noticed that when i zap to a HD station and wait long enough i get this error right after the “TS file format detected”:
Too many audio packets in the buffer: (4096 in 7340032 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
MPEG: FATAL: EOF while searching for sequence header.
Video: Cannot read properties.

so i’m still unsuccessful at watching HD tv.

UPDATE 2!!: to watch HD tv stations you need the option -p when calling szap2!
-p : add pat and pmt to TS recording (implies -r)

so try
./szap2 -r -p -t 2 "ASTRA HD+" and open mplayer… wow

my 3GHz system that’s gonna be the mythbackend sometimes quits with mplayer saying:
************************************************
**** Your system is too SLOW to play this! ****
************************************************
which means… my frontend system is gonna have to be upgraded!

amr sounds in 3gp videos

well ubuntu out of the box doesn’t support amr sounds often found in mobile phone videos. the problem is that ffmpeg isn’t compiled with amr support… medibuntu has a version compiled with amr support, so….

add a medibuntu repository file:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list

this creates a new source list in the sources.list.d folder and leaves your main source file unchanged.

then also add the GPG key:
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

this is also described on the medibuntu page.

you should get an update notice and if not it should be sufficient to update the libavcodec1d (ffmpeg codec library).

now your mobile phone 3gp videos should play with sounds.

from firefox to epiphany/gecko to epiphany/webkit

since firefox is getting slower each day the developers code. i started using epiphany instead.

it has some cool features like the “Smart Bookmarks” which i have configured to be some sites in my toolbar that i can directly enter the search term. in the bottom screenshot you see an example wikipedia search and how it is set up. smart bookmarks are even smarter though, check out some samples they have on the galeon website.

smart bookmarks

since the gecko engine has gradually made me sicker and sicker i decided to recompile my epiphany browser with webkit. woohoo! so i followed the howto here.

after installing libxslt-dev and the gstreamer development packages (libgstreamer-plugins-base0.10-dev and libgstreamer0.10-dev) which solved my dependency problems i compiled WebKit/GTK+ from the svn source with the option –enable-video just for the heck of it.

running the very simple browser found under ./Programs/GtkLauncher i receive the user agent
Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/525.1+ (KHTML, like Gecko, Safari/525.1+) lt-GtkLauncher

webkit gtklauncher

to fix the glib requirement version >= 2.15.6 i just installed glib from the hardy repositories. then compiled epiphany with the option –with-engine=webkit.

now if i check the user agent i get:
Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/525.1+ (KHTML, like Gecko, Safari/525.1+) epiphany

and i’m finishing this post right here with epiphany/webkit.

about

a fun little experiment but it seems it’s just not ready to actually use on a everyday surfing basis!
some things that don’t work:

  • gmail (i’m guessing because of redirects)
  • http authorization
  • flash content (no youtube browsing)
  • secure http connections
  • and it has bugs in various form fields

ace archives and unace-nonfree

well you’ve gotta love ace archives, there’s actually still people using it ;)
i received one today and wenn trying to unace in my linux i get (with t as parameter to verify the archive):
munzli@freddy:~$ unace t archive.ace
UNACE v1.2 public version

Processing archive: archive.ace

Authenticity Verification:
created on 31.3.2002 by Laudahn

thefirstfile.txt
 Analyzing
File compressed with unknown method. Decompression not possible.

Error occurred

well after searching around i found out that there is a nonfree version of unace. how handy. it’s located in the multiverse repository of gutsy and can be installed with:
sudo apt-get install unace-nonfree

now you’ve got the unace version that will decompress my archive and another version named “unace-free”. i’m not sure why they named it the other way around in the repos, but it works…

iconv script for converting character encodings

well the whole character encoding problems in the german language with utf-8 and iso-8859-1 is pretty tedious. a fine little program called iconv does the whole encoding changes pretty nicely but… (well there had to be a but huh?) you can’t switch encodings with input and output being the same file.
so moving/deleting/renaming makes it a little painfull.

i wrote a little script that does this for me, it’s really simple but simplifies everything.

#!/bin/bash
#
# Convert arguments handle different encodings
iconv -f $1 -t $2 "$3" -o "$3-new"
# Create backup
mv "$3" "$3~"
mv "$3-new" "$3"

i called it “econv” and instead of:
iconv -f iso-8859-1 -t utf-8 myfile.txt -o myfile_new.txt

then deleting the old file and renaming the new one, i just type:
econv iso-8859-1 utf-8 myfile.txt

which does the trick and even creates a “myfile.txt~” backup of the original.

put the script in your /usr/local/bin or whatever you prefer and you can use it globally.

resize a directory full of images using imagemagick

people wo have image galleries on the net know that the images that come from your digital camera are usually to big. even gallery scripts that do resize the images might fall into a timeout when uploading alot of images. i used to batch resize my images with a GIMP script, but why? i don’t know. using imagemagick is ten times simpler!

mogrify -resize 800x600 "*" *.jpg

easiest possible way to go…
and with the option -quality you can also set the quality… check out the mogrify man page for more information.

enabling desktop effects ubuntu 7.04 nvidia

well since ubuntu has the new little desktop-effects menu in system -> preferences i wanted to try it, but i kept getting this:
munzli@freddy:~$ /usr/bin/desktop-effects
modinfo: could not open /lib/modules/2.6.20-15-386/volatile/nvidia_legacy.ko: No such file or directory
modinfo: could not open /lib/modules/2.6.20-15-386/volatile/nvidia.ko: No such file or directory
modinfo: could not open /lib/modules/2.6.20-15-386/volatile/nvidia.ko: No such file or directory
nvidia hardware not available
Segmentation fault (core dumped)

my system has been upgraded from previous releases and already had beryl and compiz running before upgrading to feisty and has tons of dead entries and packages. the solution was actually quite simple, but here’s all the steps i did.

first i removed the nvidia restricted modules (as you can see i still had others from previous kernels so i removed them as well) and nvidia kernel drivers (this step is probably not necessary but i did it anyway to make sure)
sudo apt-get remove --purge nvidia-kernel-common linux-restricted-modules-2.6.15-23-386 linux-restricted-modules-2.6.17-10-386 linux-restricted-modules-2.6.17-11-386 linux-restricted-modules-2.6.20-15-386

then i reinstalled the packages (you can take the generic package but i used the 686 package since i have a P4 here at the office)
sudo apt-get install nvidia-glx-new linux-restricted-modules-686

make sure you have the nvidia specific stuff in your xorg.conf, if you don’t, the easiest thing to do is run:
sudo nvidia-xconfig --composite
sudo nvidia-xconfig --render-accel
sudo nvidia-xconfig --allow-glx-with-composite
sudo nvidia-xconfig --add-argb-glx-visuals

restart X and you should see the nvidia module, easiest check is running System -> Administration -> Restricted Drivers Manager. it should look like this (you only need the nvidia driver in there):
Restricted Drivers Manager

well i didn’t have it loaded at first and noticed that it was still missing the /lib/modules/2.6.20-15-386/volatile/nvidia.ko file, so in that directory i noticed the nvidia_new.ko so i just made a symbolic link:
ln -s nvidia_new.ko nvidia.ko

after that it still wasn’t working! well here’s the final and real step that made it work and you might only have to do this!

check the gconf-editor and make sure that no dead plugins are loaded, mine looks like this now:
active_plugins
mine still had “animations” and “3d” in there, and after removing animations it worked!

a nice way to waste some time ;)

if your cube doesn’t rotate, then also make sure that the key /apps/compiz/general/screen0/options/hsize is set to 4 or more. for others plugin go check the compiz site.

final shot

ubuntu dist-upgrade with an iso image

well since ubuntu feisty fawn 7.04 is out, i thought i’d go for the distribution upgrade… so i downloaded the iso.

upgrading through the online repositories usually is pretty time consuming so i wanted to upgrade through the iso without burning a cd, who needs cds anyways ;)

the only way i got this going was to mount the iso into a directory (in my case: /media/ubuntu)
sudo mount -o loop -t iso9660 /path/to/my/iso/ubuntu-7.04-desktop-i386.iso /media/ubuntu

then edit the sources.list in /etc/apt and replace “edgy” with “feisty” and add this line to the top
deb file:/media/ubuntu/ubuntu feisty main restricted

not very nice but the cdromupgrade is missing in feisty!

now do a:
sudo apt-get clean
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get -f install # optional
sudo dpkg --configure -a

HINT: “sudo apt-get -f install” is only needed if you get errors during the dist-upgrade.

for some reason i also needed to uncomment the normal “main/restricted” package source because it still wanted to download every package.
# deb http://archive.ubuntu.com/ubuntu feisty main restricted

if anybody has easier ways, please tell me!