perjantai 27. kesäkuuta 2008

Making logos and user guide

EnigmaNG uses xpm format for channel logos. I couldn't find good set of logos so I decided to do them by myself. I noticed that Photoshop doesn't support xmp format at least by default, so first thing I did was to install Gimp for Mac.

The basic procedure was to use Google's image search to find correct logo, load it to Photoshop for editing and resizing (80x80px) and saving it as PNG. Then I opened this image to Gimp, changed the color mode from RGB to indexed mode with 13 colors and saved it as xpm. It took few hours, but now I have full set of channel logos for cable and terrestial channels, about 100 logos.

I also started making user guide for the VDR. I took a picture of the remote and some screenshots from VDR using xwd command line program, edited them in Photoshop and Gimp and attached them to Word dodument.

torstai 26. kesäkuuta 2008

Testing, tweaking and scripting

Even though it has been quite for sometime I've done something for this project. I've been editing my scripts for startup and shutdown. Also today I moved the Mini to our kitchen for couple of hours to get some signal and see if the picture is ok in tv.

I did some overscan compensation to /etc/X11/xinit/Xclients file. Now the xrandr sets the borders to 15, 20, 15, 31. Final tweaking must be done for the actual tv unit I'm goint to be using.

I also tried to finetune Modelines from xorg.conf as I noticed that there is some minor sync problems when using Xine's deinterlace options. But I couldn't find perfect Modeline yet, so I need to revisit that again.

One thing that I managed to complish was to get the startup chime to mute. I booted to OS X and downloaded and installed StartupSound.prefPane. Now the Mini wakes up silently so nightly recordings doesn't wake up anyone :)

Next things I will do is to finish the scripts and make some channel logos.

tiistai 17. kesäkuuta 2008

Tweaking startup and using TV out

Burn plugin still needed GenIndex application which can be found from here. After that I was able to create DVD with DVB ot Teletext subtitles.

MP3 plugin needs CDFS to be able to play audio CDs, so I patched it to be able to compile it for latest kernel and tried it out, but I couldn't get it work. I also had some problems with DVD plugin so I decided to give a try for xineliboutput.

Xineliboutput seems to work fine so far. I had to install xinelib related packages for it. I also noticed that default volume level for sounds was always zero and system didn't have mixer installed so installed alsa-utils to get alsamixer.

Next change was to prevent XCFE start on boot, so I changed runlevel to 3 from 5 from /etc/inittab

id:3:initdefault:

After that I can start XCFE by typing startxcfe4 or start plain X Window system by typing startx. Later is better for VDR usage, but by default it launched some applications like clock and xterm. That can be prevented by editing /etc/X11/xinit/Xclients. I added comments to xclock, xterm and firefox. I also added following entry for setting overscan to zero for TV out.

    if [ -x /usr/bin/xrandr ] ; then
        exec /usr/bin/xrandr --output TV --set BOTTOM 0 --set RIGHT 0 --set TOP 0 --set LEFT 0 -display :0
    fi

/etc/X11/xorg.conf needed also changes for Mac Mini's TV out, those instructions can be found from here. After those changes I can get great full screen picture on my TV with Mac Mini.


torstai 12. kesäkuuta 2008

Tweaking remote handling

I've been busy with other things so I haven't got time to continue with the project. But anyway I had to make some changes for VDR to handle Apple Remote (or Lirc's macmini driver) better.

The problem is that Apple Remote keypresses are detected as keyrepeat if you press the same button within about 700ms. This causes problems in VDR usage as you need to press for example Ok-button several times in row to advance in menus and VDR prevents keyrepeat errors so that user doesn't go to somewhere by mistake.

I tried to find out the repeat detection from Lirc, but finally I found out it easier to modify the VDR's Lirc handling from lirc.c. The change was that I modified 'count' comparison from == 0 to < 7. Now VDR allows some repeats before changing to 'repeat-mode' and usage is quite nice.

torstai 5. kesäkuuta 2008

Installation of VDR and plugins

Before installing VDR, I downloaded dvd-apps and made a channel scan with following command:

scan -o vdr -e 4 fi-Oulu > /video/channels.conf

I need to do that again when I'm in Kokkola so I get Kruunupyy's channels to the conf-file.

I installed VDR 1.6.0 and the followin plugins:
  • Softdevice
  • Burn
  • DVD
  • MP3
  • EPGSearch
  • Femon
  • SkinEnigmaNG
  • Text2skin
  • TvOnScreen
  • TtxtSubs
  • OSDTeleText
In addition to the plugins I patched VDR with liemikuutio patch which includes UI-tweaks etc. I also copied bash scripts from my own VDR: vdrd.sh, vdr_errorlogger.sh and vdr_shutdownscript.sh to name them. First of them starts the VDR and makes sure that it is running. Second one follows the syslog for driver errors (now empty for this project as I don't know which kind of error Artec will give). Third one is the script that VDR calls when it initiates shutdown. I need to update that to set the Mini to sleep and use /sys/class/rtc/rtc0/wakealarm instead of /proc/acpi/alarm.

I also teached the remote buttons for VDR, and tweaked VDR a bit for the remote, but I will make a own post about that.

Before installing the plugins I added Livna repository to get some extra packages:

su -c 'rpm -i http://rpm.livna.org/livna-release-9.rpm'

I also already knew that Burn plugin will need Java, so I installed JDK by following these instructions.

Softdevice plugin:

Softdevice needs ffmpeg to work so I installed quite new SVN version that I had on my MacBookPro's hard drive. Softdevice version is 0.5.0 and I'm using it with xv output currently.

Burn plugin:

I checked out the plugin from CVS.Burn plugin needs also quite many other things, so here's a short list of the dependencies and how I got them:
  • Burn plugin conf-files from my own VDR
  • Old CVS version of ProjectX from my own VDR
  • bbe for burn plugin fix about letterbox bit in IFO-files
  • yum install dvdauthor
  • yum install dvd+rw-tools
  • yum install mjpegtools
  • requant from URL provided in Burn plugin's readme file
  • pxsup2dast from URL provided in Burn plugin's readme file
Then I modified installation paths from vdrburn-dvd.sh for requant etc. and configured ProjectX.ini in /video/plugins/burn to handle teletext subtitles.

Because Fedora 9 is using Gcc 3.4 some additional patching was needed for the plugins. Mostly it was adding #includes to header files. , and were the most common ones between the plugins. I haven't tested the burning yet, so it is in todo list.

MP3 plugin:

MP3 plugin version I use is 0.10.1.MP3 plugin needed the followin packages to be installed:

yum install libmad
yum install libsndfile
yum install libid3tag

Also it requires mplayer but it got installed with mjepgtools mp3sources.conf file in /video/plugins which defines the path for the media files. I haven't tested this plugin either yet.

DVD plugin:

DVD-plugin's name already tells what it does,
I also fetched this from CVS. It needs following packages to gain full functionality (read: able to play copyprotected DVDs):

yum install libdvdnav
yum install libdvdcss
yum install a52dec
yum install xine-lib-extras-nonfree

Actually the last one is not needed, but I installed it as it provides the support for Kaffeine DVD playback which I used to test the DVD playback first. As Mini doesn't have eject button for DVD I defined a command to /video/commands.conf to eject the disc:

Eject DVD: eject -r

I tested DVD playback and it worked otherwise ok, but commercial DVD didn't have sound. A bit of research revealed that Dolby Digital sounds were enabled in VDR settings and after disabling it audio was played from internal speaker. Also DVD's created with VDR didn't show default language subtitles (fi), but commercial DVD did show, so there is something wrong with Burn plugins. Subtitles appears anyway when I press 2 two times.

Text2skin plugin:

Fetched from CVS. I installed Text2skin plugin and patched it, but probably I'm not going to use it as I found the skinEnigmaNG which doesn't need text2skin. Anyway I installed ImageMagick.

yum install ImageMagick-c++-devel


SkinEnigmaNG:

As I wrote above, I'm going to use EngimaNG as the skin for the VDR, version is 0.0.6. Logos and channel logos I put under /video/plugins/skinenigmang. I still need to make the channel logos for the Finnish channels as it seems that they are either old or does not exist at all.

EPGSearch:

EPGSearch version is 0.9.24. It has patch included for VDR called MainMenuHooks which enables replacing the Schedule option in the VDR's main menu, so I applied the patch. There was also GCC problems described earlier so I needed to do some patching also by myself.

OSDTeletext:

Version is 0.5.1 and it needs patching that can be found from somewhere :) I had the patch on my own VDR so I just used it. Not tested yet because I don't have good reception

Other plugins:

I installed and patched TvOnScreen 1.0.141, but I'm not sure if I'm going to use that or not. Ttxtsubs 0.0.5 are also included now, patched with raastinrauta-edition, but I haven't tested the subtitles yet and I don't know if there is something wrong with the settings as now the main language is fi_ and it is giving input field if I edit it. Secondary and the third language can be selected from list so there's something funny there. Femon is working ok, version is 1.6.0.

Basic functionality is now reached and the tweaking starts.

tiistai 3. kesäkuuta 2008

Installation of new drives and start from the beginning

Last weekend I went to my parents and got new optical drive and hard drive. On Monday I installed those to my Mini. Here's a good video how to change those drives.

After updating the hardware I pretty much started from the beginning, to make it short here's the list what I did:
  • Minimum install of OS X 10.4.7 (3GB)
  • Installation of Boot Camp Beta (1.4) and partitioning (8GB OS X, rest for Linux)
  • Installation of rEFIt (modified refit conf file so that legacy OS is first selection and timeout 1 second)
  • Installed Fedora 9, This time partition map was like this: 8GB to /, 131GB to /video and 2GB swap partition
  • I didn't install Gnome, but XFCE instead. Also left out other packages as much as possible I ended up with 798 packages to be installed
This I didn't need to do any tricks to get booting of Fedora working. But when I tried to login and login window just reappeared. The reason is that DVD doesn't actually include packages for XFCE as can be read from here.

So in login screen I pressed Ctrl+Alt+F6 to get in terminal, logged in and installed XFCE by typing:

yum groupinstall XFCE

First thing I did in desktop was disabling of SELinux. As the Mini won't be connected to Internet it is easier to do everything without SELinux.

Then I downloaded firmware for the Artec T14 from here. The correct file is dvb-usb-dibusb-6.0.0.8.fw and it needs to be put under /lib/firmware.

Next thing was to install Lirc. I Downloaded 0.8.3 version from www.lirc.org. The setup didn't run because there was no dialog program in the system so installed it by typing:

yum install dialog

Then I ran setup for the Lirc just to realise that it is better to do that manually so I can get two drivers compiled.

./configure --enable-dyncodes --with-driver=macmini --with-driver=samsung

make
make install

Then I started to learn the codes with irrecord.

irrecord -H macmini -d /dev/hiddev0 apple1.conf

At the end irrecord ask to press repeatly same button as fast as possible, but macmini driver doesn't actually work like that so I just pressed two buttons and after irrecord ended I comment ed min_repeat and toggle_bit_mask lines from the conf-file.

I then tested the configuration by starting lirc and using irw to see the commands.

/usr/local/sbin/lircd -H macmini -d /dev/hiddev0 ./apple1.conf