Computers 'n Stuff

I here share the resolutions for my Linux problems so they might safe somebody some time.

Monday, April 07, 2008 parmanent link to this post

Computer won't Boot after Reinstalling Windows XP on a Linux/Windows Dual Boot System: Another Windows XP Bug

Using a dual boot system is sometimes a little tedious. In particular since the windows installer is keen to screw up any operating systems that are installed on your hard drive besides windows. Here is what happened to me after I had to re install a broken windows instatllation on a dual boot system.

If you mess around too much with windows it will sooner or later cease to boot. Usually it is sufficient to boot with the windows installation disk and to choose the repair installation.
However, in my case repair installation did not help, and I had to do a clean install. Yet, after finishing the Windows XP SP 2 installation my computer was completely screwed up. After the Windows XP isntall it bacame impossible to boot any operating system, neither the old windows, the old linux nor the new windows. Usually in this cases it helps to boot the computer from a rescue boot disk and then boot the required partition. But in this case it didnt help at all. Also the repair utility featured on the Linux installation disk did not help at all. So I thought my harddrive would be lost.

However, after taking a look at the master boot record (MBR) of the hard drive I figured out what the problem was:

The windows xp installer flagged both partitions of my harddrive as active after the clean install. Because after the linux installation I used GRUB as a boot loader, the linux partition was set as active in the MBR.
So the Windows XP installer set the windwos partition as the active partition and leaving the active flag for the linux partition in place. Thus, after finishing the Windows XP reinstallation my MBR ended up with two partitions flaged as active. This is a condition which should never be present in a master boot record.
To fix the MPR you have to edit it to flag the only that partition active you want to boot from, e.g. the partition containig the GRUB boot-loader. Caution: Never use the fixmbr command from the recovery console to fix the MBR. This command will overwrite your partition table and screw up your entire hard drive.
I consider this as another nasty Windows XP bug. Considering the Microsoft marketing strategy it is conseivable that Microsoft intentionally put this bug into their installation routine to deliberately screw up systems that hold other than microsoft operating systems on their harddrive.

Labels: , , , ,

Do you want to read on <<click

Friday, June 15, 2007 parmanent link to this post

Microsoft "theBad" windows vs. OpenSource Linux: Not eveything is lost


The Bad or like thy like to call themselves, microsoft, is tyining to bully Linux. Howerver, not everything is lost. Research reveals that all companies supporting Linux have a greater financial power than Microsoft.
The new goes that a couple of companies supporting Linux are depating wheather they should form a alliance against Microsoft which is threatening the open SourcCommunity with copyright infringement law sues. Should the participants of meeting choose to form a alliance to oppose "the Bad" which continues to gain momentum in the open source market, they will have almost 9 times tha market power than microsoft (397 billion USD compared to 44.3 billion). But what could the strategy against thue new bottem up attack of microft be?

Labels: ,

Do you want to read on <<click

Installation of Moneyplex 2007 with Rainer SCT cyberjack in Linux in OpenSuse 10.2 64Bit


Moneyplex is a monymanagement software supporting Smart Card identification for online Banking. Here I write what you have to keep in mind if you want to install it.


The problem with Moneyplex 2007 is that is still 32Bit. But compared to earlyer versions of OpenSuse and Moneyplex its now pretty easy to get Moneyplex running in a 64bit environment. No need to use chroot dirs or virual mashines. Just install the Moneyples software using the installer and download the updates.

Now get the 32 bit driver for the smart card reader Reiner SCT Cyperjack for Suse 10.2
install it with

# rpm -i [drivername.rpm]

now connect the Reader and do

# modprobe cyberjack

and check with

# lsmod | grep cyberjack

wheather driver has loaded.

Now add your user account to the group cyberjack e.g. using yast.

In moneyplex you have to use the CTAPI driver you'll find in
/usr/lib/readers/

and everything should work fine now.

Labels: , , , ,

Do you want to read on <<click

Tuesday, June 12, 2007 parmanent link to this post

Is Microsoft racketeering the Open Source community?


Microsoft is asking people to pay them for patents, but they won't say which ones. If a guy walks into a shop and says: 'It's an unsafe neighborhood, why don't you pay me 20 bucks and I'll make sure you're okay,' that's illegal. It's racketeering. What Microsoft is doing with intellectual property is exactly the same. It's a great company and I have great admiration for it, but this was not a well considered position," said Shuttleworth.

This is a pretty funny comparison but I can't belive that the plans of Microsoft concerning the opens source community are that simple. I can't tell exactly what it is but I believe it 's a part of a long term evil strategy of Microsoft to destoy the open source community.
There is enough evidence that Open Source has appeard already on the radar of Microsoft constanly detecting potential competitors. I has always been and it will allways be the goal of microsoft to defeat all competitiors that appear on their radar. Why should it be any different with open source? There is no obvious reason why Microsoft shoulde start to cooperate with some kind of sofware project that competes with their market. I believe its not the plan of microsoft just to earn some money I blelieve this is a strategie to attack a distributed target like the open source community. I belive its the long term goal of microsoft to infect the open source with closed source payware. These companes like Xandros, Novell and LG will serve as Trojan horses and virus droppers for Microsoft. I will be the goal of microsoft to sneak licensed technologies into the code of linux so that they can take leagl actions against any user of Linux and open source. The more companies Microsoft buys the more companies will be allowed to use this code and the more companies will distribute the infected open source Linux which will be something like Windux or Lindows that will compete with the pure opensource linux therby reducing the market share of which.

Labels: ,

Do you want to read on <<click

Saturday, June 09, 2007 parmanent link to this post

Enable SLI in Linux: My Xorg.conf as an example

The SLI mode was a little harder to enable. Here is how i got it working

Install the driver according to the nvidia howto.

sax2 -r -m 0=nvidia doesent work with SLI setup

use

sax2 -r -c0 -m0=nvidia

instead. assuming that your disply is hooked up to card 0. Else you can use Card 1 but card 1 will not work for SLI

Now here was that catch: when I wanted to enable SLI GPU 0 as detectd by

nvidia-settings

needs to be the same as chip0 as reported by

sax2 -p

the can be identified by ther pci adress. And the display has to be hooked up to card 0 too. else the display will be scrambled when you starup the display.

I had to change the Init Disply first to PEG(slot2) to get this accomplished.

then you type

nvidiea-xconfig --sli=on

and your set. It si imortant that the frst available Xscreen is the screen with you monitor hooked up to it if have more that one configured in you xorg.config.

Heres the sections relevant to xscreen config of xorg.conf as a reference with sli enabeled:


Section "Module"
Load "dbe"
Load "type1"
Load "freetype"
Load "extmod"
Load "glx"
Load "v4l"
EndSection


Section "Monitor"
Option "CalcAlgorithm" "XServerPool"
DisplaySize 338 270
HorizSync 30-82
Identifier "Monitor[0]"
ModelName "ACER AL1714"
Option "DPMS"
VendorName "ACR"
VertRefresh 43-75
UseModes "Modes[0]"
EndSection

Section "Device"
BoardName "GeForce 6800 GS"
BusID "4:0:0"
Driver "nvidia"
Identifier "Device[0]"
VendorName "NVIDIA"
EndSection


Section "Screen"
DefaultDepth 24
SubSection "Display"
Depth 15
Modes "1280x1024" "1152x864" "1024x768" "800x600"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1152x864" "1024x768" "800x600"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1152x864" "1024x768" "800x600"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1152x864" "1024x768" "800x600"
EndSubSection
Device "Device[0]"
Identifier "Screen[0]"
Monitor "Monitor[0]"
Option "SLI" "on"
EndSection


Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "Mouse[1]" "CorePointer"
Screen "Screen[0]"
EndSection


Section "DRI"
Group "video"
Mode 0660
EndSection


Nvidie Linux Driver README

Labels: , , , ,

Do you want to read on <<click

Quake 4: enable SLI in linux

Quake 4 also runs faster in SLI mode in Linux. However, it needs to configured properly to increase performance. Here is my Quake starup script with SMP enableled.


#!/bin/sh
# Needed to make symlinks/shortcuts work.
# the binaries must run with correct working directory
cd "/usr/local/games/quake4"
export __GL_DOOM3=1
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:."
exec ./quake4smp.x86 "$@"
export __GL_DOOM3=1

important is to add export __GL_DOOM3=1 to improve SLI performance

Labels: , , , ,

Do you want to read on <<click

Sunday, June 03, 2007 parmanent link to this post

My .xbindkeysrc.scm configruation file I use with the MX1000 lasermouse (for now)

This is my .xbindkeysrc I'm using with my mx1000 lasermouse. It's quite useful. with firefox. The thumbkeys can scroll in history and if you press the appbutton and use the scrollwheel at the same time you scroll through tabs.. If the mouse is setup properly it should be possible to do horizontal scrolling by the tilting th scroll wheel. However Firefox needs some adjustments for theis to function since he will scroll through history when the horizontal scroll buttons are pressed. The appbutton pushed and released alone will toggle the last active app.

The the Guru repository xbindkey suse rpm are compiled without guile support.To use xbindkeys it has to be compiled with guile support. The Guru repository does provide a xbindkeys-1.8.2-1-src.rpm that can be compiled with :
# rpmbuild --with guile --rebuild sourcepackage 

to provide guile support. where sourcepackgage has to be replaced by the name of the sourcpackage, in this matter by xbindkeys-1.8.2-1-src.rpm. You will need to install the guile-devel package in order to compile xbindkeys in this way however. The compild RPM will show up in /usr/src/packages/RPMS/`architecture` where architecture has to corrospond your hardware architechture, in my case x86_64-

;; This configuration is guile based.
;; http://www.gnu.org/software/guile/guile.html
;; This config script us supposed to live in the homedirectory.
;; This was a not so quick but probably yet dirty hack by Vee Lee.(I know nothing about coding but at least it works)
;; You'll need xmacroplay and xbindkeys with -guile support compiled for this to work..
;; This is heavily based on the domoscripts (http://hocwp.free.fr/xbindkeys/xbindkeysrc-combo.scm.html)
;; of the author of xbindkeys (hocwp at free dot fr) Many thanks and keep up the good work.
;; It assigns keybindings to the scroll wheel on the fly after the appwindow button is pressed on the mx1000 lasermous!

define (display-n str)
"Display a string then newline"
(display str)
(newline))

(define (first-binding)
"First binding"
(xbindkey-function '("b:10") second-binding)
(xbindkey-function '("m:0" "b:9") (lambda () (run-command "echo -e 'KeyStrPress Alt_L\nKeyStrPress Right\nKeyStrRelease Right\nKeyStrRelease Alt_L\n' | xmacroplay :0 &")))
(xbindkey-function '("m:0" "b:8") (lambda () (run-command "echo -e 'KeyStrPress Alt_L\nKeyStrPress Left\nKeyStrRelease Left\nKeyStrRelease Alt_L\n' | xmacroplay :0 &")))
)

(define (reset-first-binding)
"reset first binding"
(display-n "resetting first binding")
(ungrab-all-keys)
(remove-all-keys)
(first-binding)
(grab-all-keys))

;;This allows to scroll through tabs in firefox
(define (second-binding)
"Second binding"
(display-n "setting second binding")
(ungrab-all-keys)
(remove-all-keys)
(xbindkey-function '("b:4")
(lambda ()
(display-n "Scroll up")
(run-command "echo -e 'KeyStrPress Control_L\nKeyStrPress Tab\nKeyStrRelease Tab\nKeyStrRelease Control_L' | xmacroplay :0 &")
))

(xbindkey-function '("b:5")
(lambda ()
(display-n "Scroll down")
(run-command "echo -e 'KeyStrPress Control_L\nKeyStrPress Shift_L\nKeyStrPress Tab\nKeyStrRelease Tab\nKeyStrRelease Shift_L\nKeyStrRelease Control_L' | xmacroplay :0 &")
))

(xbindkey-function '(release "b:10") (lambda ()
(run-command "echo -e 'KeyStrPress Alt_L\nKeyStrPress Tab\nKeyStrRelease Tab\nKeyStrRelease Alt_L' | xmacroplay :0 &")
(reset-first-binding)))
(grab-all-keys))

(define (scroll-apps-binding)
"scroll-apps-binding"
(display-n "scroll apps binding success")
(ungrab-all-keys)
(remove-all-keys)
(xbindkey-function '("b:4")(run-command "echo -e 'KeyStrPress Tab\nKeyStrRelease Tab' | xmacroplay :0 &"))
(xbindkey-function '("b:5")(run-command "echo -e 'KeyStrPress Shift_L\nKeyStrPress Tab\nKeyStrRelease Tab\nKeyStrRelease Shift_L' | xmacroplay :0 &"))
(xbindkey-function '("b:1") reset-first-binding)
(grab-all-keys))
(debug)
(grab-all-keys)
(first-binding)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; End of xbindkeys configuration ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


I'm looking for a way to alt + tab through the application windows using the scroll wheel but I can't get this working. Suggestions are welcome

Related Posts:
Mouse setup in linux links

Labels: , , , ,

Do you want to read on <<click

Saturday, June 02, 2007 parmanent link to this post

setup of the MX1000: .xbindkeysrc with xmacroplay



Binding mouse events of the thumbbuttens to XVkdb by xbindkeys kind of sucks. I makes Firefox freeze. Hers my new .xbindkeyrc using xmacroplay.

Ok, this is my .xbindkeysrc

# Backward and Forward buttons
# "xvkbd -text "\A\[Left]"" # freezes firefox and makes mouse cursor jump
"echo -e 'KeyStrPress Alt_L\nKeyStrPress Left\nKeyStrRelease Left\nKeyStrRelease Alt_L' | xmacroplay :0 &" #better
m:0x10 + b:8"
#"xvkbd -text "\A\[Right]""
"echo -e 'KeyStrPress Alt_L\nKeyStrPress Right\nKeyStrRelease Right\nKeyStrRelease Alt_L' | xmacroplay :0 &"
m:0x10 + b:9

the idea was stolen from Stephan Reichelt Nice Work!
Get xmacro sources and make. copy xmacroplay to /usr/bin. I couldn't find a Suse rpm for this.

Related Posts
MX1000 Setup
MX1000 setup part 2

Labels: , , , ,

Do you want to read on <<click

How the Logitech MX1000 setup works in OpenSuse 10.2

Some more information about the setup of the MX1000 lasermouse in OpenSuse. Its a guide to use lomoco and keybindings with xbindkeys in conjunction with xvkdb.




In Suse 10.2 udev detects the mx1000 with this ruleset found in:
/etc/udev/rules.d/40-lomco.rules

# "C-BN34",  "Receiver for MX1000 Laser"
BUS=="usb", SUBSYSTEM=="usb_device", SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c50e", RUN="/lib/udev/lomoco.sh"

Then it runs the script:

/lib/udev/lomoco.sh



This script takes options for smartscroll enable/disable and resolution from this cofnig file:

/etc/sysconfig/logitech_mouse


So this is probalby the place to modify the lomoco settings at boot time systems wide.
For keybinding you can use xbindkeys it is a package of OpenSuse and you don't need to compile and install lmwheels. Its not maintained any more from what I understand. But check yourself if in doubt. Create .xbindkeysrc in you homedir with

# 'xbindkeys --defaults > /home/yourhomedir/.xbindkeysrc'.


Now edit .xbindkeysrc and add the following lines:

# Application-toggle button
"xvkbd -text "\[Alt_L]\[Tab]""
m:0x10 + b:10
# Backward and Forward buttons
"xvkbd -text "\[Alt_L]\[Left]""
m:0x10 + b:8
"xvkbd -text "\[Alt_L]\[Right]""
m:0x10 + b:9

The .xbindkeyserc was stolen with modification from here So how it works is that xbindkeys traces the events you trigger by pressing keys. When it catches a defind event then it launches an application which is here above the respective event in the .xbindkeysrc. In our case of the mouse events it starts xvkbd which is a virtual keybord that sends keyboard events to the xserver you define behind the -text optons. you kould define any keystroke you like instead the events here. For lmwheels you could probably define different keystrokes depending on the application you use the mouse in if you need it The b:10 and b:8 and so on are the mouse events where the number is the event the mouse sends. Here I created a listo of events triggerd by the MX1000 buttons if you need to know which number you need to use. Now execute xbindkeys and test the key bindings.

When satisfied you can make an autostart entry in your KDE Atotstart folder to start xbindkeys each time you boot. To do so execute e.g.:

# ln -s `which xbindkeys` `kde-config --userpath autostart`
links to lots of mouse setup guides

Technorati Tags: , ,

Labels: , , , ,

Do you want to read on <<click

Friday, June 01, 2007 parmanent link to this post

Logitech MX1000 USB mouse configuration / setup for X11 in OpenSuse 10.2 linux

The MX1000 Lasermouse is supported pretty well by OpenSuse. It was just a little hard to find out what you need. Here I write how I did the setup of the MX1000







To support all mouse buttons of a modern USB mouse like the Logitech MX1000 lasermouse in X11 I use the evdev driver. This driver is compiled into X11 by Suse linux so you just need to activate that driver. To do this I first modified the /etc/X11/xorg.conf now it looks like:

Section "InputDevice"
Identifier "Mouse0"
Driver "evdev"
Option "evBits" "+1-2"
Option "keyBits" "~272-287"
Option "relBits" "~0-2 ~6 ~8"
Option "Pass" "3"
EndSection

The options are stolen from the man page of evdev and are said to work for virtually any mouse. forget all about these mapping and ZAxixMapping Options, they are not supported by evdev, Check the manpage. In some forums you can read to use Options protocoll evdev. But this is obsolete and only used for older veresions of evdev. However, the identifier Mouse0 is crucial I guess, since with another identifier like mouse[0] the xserver refused to start. My explaination is that is has to match the entry in /dev/input/mouse0. This entry (node) done by udev. The configuratin is probalbly done at installation of Suse. Sombody wrote that Suse 10.2 does not support evdev any more. I think this is not true. You don't need to load it as a kernel module. evdev is compiled into the Xorg server.

I use lomoco, to control the feaures of the MX1000 lasermouse. lomoco is installed per default, it can be used to incerase the resolution from 400dpi (default) to 800 dpi:
# lomoco -8
and to turn on/off smart scrolling

# lomoco --sms
# lomoco --no-sms
in Suse linux /etc/sysconfig/logitech_mouse holds the configruation file of the lomoco config scrip that is executed on detection of a logitech mouse to configure smart scrolling and resolution of Logitech mice at startup.


What happens when you hit a mouse key depends on the xevent that is triggered and translated by the application into action. The xev command can be used to decipher the events triggerd by the mouse buttons. these xevents are generated by the mouse depending on sms or no-sms (use
# xev
in a console to test):

button event with smart scroll event without smart scroll
left 1 1
wheel pressed 2 2
right 3 3
wheel up 4 4
wheel down 5 5
wheel tilt right 6 14
wheel tilt right release 14 n/a
wheel tilt left 7 13
wheel tilt right release 13 n/a
thujb back 8 8
thumb front 9 9
app change 10 10
smart scroll up 4(as long as hold down) 11
smart scroll up release 11 n/a
smart scroll down 5(as long as hold down) 12
smart scroll down release 12 n/a

this is a list of x events triggerd by the mousbuttens in different modes of the logitech mouse.
Intersitng to note that although the MX1000 is a 12 button mouse (10 button + two for the wheel) the mouse can generate 14 events. So actually these Options Buttons 12 you can find in many forums are probably wrong anyway.

Xmodmap is used to remap the events of the mouse to other events. This technique comes in handy when an application has a hard wired reaction to a mouse event, but you want to trigger that event by another moue button. So what xomodmap does is to translate one event to another and sends that event to the application instead of the original. For example you could use xmodmap to map the thumbbuttons 8 and 9 on xevents 7 and 8 by
# xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7 10 11 12 13 14 15 16 17 18 19 20"
In this row the position of the digit is the value of original x event and the value is the new xevent that will be sent in case that event is trigged, in this matter
(digit at position 6 has the value 8) event 6 (tilt mouse wheel with smart scroll enableled) will be mapped to event 8 (thumb button) . Event 8 (thumb button) is now tranlated ot event 6 (tilt mouse wheel)
This above mapping is interesting since firefox can be configured to do horizontal scrolling or to scroll
forward and backward history on events 6 and 7 depending on the about:config settings when you don't need horizontal scrolling a lot. . This is the default setting (type about:config in the adress field of firefox to check, I used Firefox 2.0 here) which does history scrolling on events 6 and 7 , that are usually the events triggered by the horizontal mouse wheel in X11.
mousewheel.horizscroll.withnokey.action Standart Integer 2
mousewheel.horizscroll.withnokey.sysnumlines Standard boolean false
of course you can also do horziontal scrolling now with the thumb buttons if you like but you have to change Integer to 1 and boolean to true.

Other customizations of mouse xeve
nts that x applications do not recoginze by default can be done by imwheel or xbindkeys in combinatin with xvkdb or xbindkeys in combination with xmacroplay

imwheel : imwheel will directly translate mouse events to (virual) keystrokes (or xevents) that are sent to and recognized by the application. e.g. alt + left will scroll one item back in history of firefox and you can configure imwheel to sent this keystrokes to the application when the thumb buttons are pressed which are not recognized by default. The advantage of imwheels is that it can be configured to send different keystrokes when a different application is used and that it doesen't need helper applications.

xbindkeys: xbindkeys is usually used to execute applications when a key or a combination of keys is pressed.
This is usually referred to as keyboard shortcuts. The advantage over imwheels is that it is highly configurable. You can use chord keys with the mouse and you can change the keybindings on the fly. With the mouse it can be used to execute an application that itself sends (virtual) keystrokes (or xevents) to an application similar to imwheel. Applications that are capable of sending virual keystrokes would be xvkdb and xmacroplay. I prefer to use xmacroplay since it is lightwight, quicker and causes less overhead when mouseevents are triggered in rapid fashion.

Related Posts:

MX1000 Lasermouse

Usefule mouse setup links
:
linklinst of Lots of linux mouse setup guides:



Labels: , , , , , ,

Do you want to read on <<click

Tuesday, May 29, 2007 parmanent link to this post

The Novell Microsoft deal


I have read about that windows Novell deal. Since I use OpenSuse I am a little concerned about that thing. What is all this Linux Novell Microsoft thing about. I understand that Microsoft and Novell siged an agreement, but I'm not positive about the reasons why. What will be the long term goal of Microsoft and Novell concerning open source, what would a scenario look like where Microsoft could achiever ther goals concerning the open source community.

To start this analysis we first have to collect a few thing we know about Microsoft:
  1. We now that Novell is sells server applications and systems that integrate into Windows architecture.
  2. We know that Microsoft is a hostile Company strieving to dominate the market. Microsoft has used its markt power to desroy competitors
  3. Microsoft trys to replace exisiting standards by their own standards or to establish their own proprietary standards on the market.
  4. Microsoft has never been innvoative, they have always been reactive in developping standards and software and they only distribute closed source code. Patents are usually based on innovations and coping copyrighted code usually needs knowledge of the source code its unlikely that open source is using windows copyrighted code.
  5. Microsoft is leader as a provider for desktop systems but is completely out of the loop when it comes to server systems.
  6. Xen Virtualisation is more suitable for server systems
  7. If you want to migrate from one opteration system to the other it might be helpful to be able to operate both systems on the same mashine the same time.
From the above mentioned facts I can not imagine that Microsoft is likely to cooperate with to open source communitiy. They are trying to gain momentum on the server market wich is at the moment dominated the open source community. Though it is understandable from the Novell history that they want to support micorsoft operating systemes and that it might be useful for them for marketing purposes right know. However, it is highly likely that Novell will become unwillingly the Trojan horse that Microsoft will unleash to destroy the Open Sorce community. Without beeing supported by the open source community I am pretty sure that microsoft would have disapeard from the surface of our earth but now things are different.
Microsofe states that it will cooperate with tha open source community on the development of cross platform solutions but in reality they are trying to sneak in proprietary code maintained by Novell Suse and my be OpenSuse which will be indespensible for the function. In parallel they will and promote it and market it untill it they have a market share their system becomes the standard and nobody can use untainted openssource any more.
In conclusion I think it might be the strategy of Microsoft to take over the open source and taint it with closed source and then continue to maintain the code by themselves. As a result Microsoft has taken over the Linux project ....

Have fear ....


Labels: ,

Do you want to read on <<click

Sunday, May 27, 2007 parmanent link to this post

Linux toolbox: useful basic console commands to start using Linux

LLinux features an extremely powerful command line interface with an amount of commands available that windows users can only dream of. Most of the time I think the command line is faster, more flexible and powerful than any grafical user interface (GUI), especially when it comes to system administration. However, for me as a beginner it was a struggle to find and understand the basic commands you need to maintain and configure a linux desktop. Thus, I decided to write down the commands I personally found to be most frequently used. Maybe this is a kick start for some users who start to use Linux.

General syntax remarks
First of all its important to know that linux commands usually accept options which come after the command itself. The short form of the option is usually preceded by a - (one hyphen) and the long form by -- (two hyphens). If you are not sure what a command does or what its syntax is type the command followed by -h ore --help. eg:

# man -h
# man --help

this will remind you of the syntax and options the command man accepts
man
man is a lifeline for linux. man brings up the manual or man page of any command available on your system instructing you how to use that command and what it is doing. So if you stumble upon a command and you don't now how its used or what its doing then type man in combination with the command you need the information about. For example if you want to know what - man - does or which options for - man - are available type:
# man man

cd
cd is use to change the current directory. If you want to change to the root directory type
# cd /

The prompt will show you the directory you're currently in. Typing cd followed by two dots (..) will bring you one level up in the directory tree.
# cd ..

Typing cd with out any options will bring you to your home directory.
the tab key
hitting the tab key in the console will expand your input depending on the context youre using it in. e.g. linux is trying to guess what you want to type. So if you type m and the tab key linux will list all available commands starting with m. The tab key is particularly useful if you're typing long directory path-names. just type the initial letters and then press the tab key to see if linux can already expand your input to full length.

tab tab
hitting the tab key twice will list you all posible input options in the context your just in.

CTRL + C
pressing ctrl and c at the same time breaks a programm you starte from the command line.

up-arrow and down-arrow key
the up-arrow will bring up your recent iput commands. the down-arrow does the oposite. this way you can browse your input history.

Shift page-up and shift page-down
use this to scroll up and down the console text.

CTRL Alt F1, CTRL Alt F2, CTRL Alt F3 ....CTRL Alt F7
pressing CTRL Alt and one of the function keys F1 - F7 lets you swich to other consoles. The GUI (X window) lives in consel F7


su
If you're working in a console you started from a Xwindow console and you need root access to you system you can use the su command: su will prompt you for the root password and than log you in to a root console.
# su -c "somecommand"

will ask you for your your root password to execute somecommand with root privileges and will exit right after the command has finished. This is useful if you need the root privileges for only a few commands.

ls

this will give you a short list of the directory your currently in. it will return only the directory names.

ll

this will give you a long list of the directory your currently in. it will retrurn the file and directory names including the respective owner and group.

l

will give a similar output like ll put will also list hidden files and directories which are usually preceded by a . (dot).

tar

this command comes in handy if you need to extract tar archives. A lot of software for linux is dirtributed as tar archives.
# tar xvzf somefile.tar.gz

This is the command you will usually have to use to extract an tar.gz archive of the name e.g. somefile. the option x means extract, v triggers the the output of all extracted filenames, z tells tar that is has to extract a zipped archive and the flag f inicates that the filname of the archive to be processed follows.
chown
this will set the owner of a file or directory e.g.
# chown me somefile

This will set the owner of somefile to be me. Test if successful with:
# l somefile


chgrp

this will set which group a file or directory belongs to e.g.
# chgrp users somefile
will set the group of somefile to be users.

chmod

chmod is used to set if a file is writeable (w) readable (r) or execuatable (x) by owner, member of the group and the world. look for example at the following line of the ll output:
-rw-r--r--   6 root root  4096 26. Mai 14:56 somefile 

The first is a hyphen since this is a file. d would indicate a directory and l a link. the first triplet rw- sets the rights for the owner of this file which is root as indicted by the first entry in the list which is the owner. Hes allowed to read and write this file but not to execute it. The second triplet r-- indicates that members of the group root can read and execute this file but not write to it. The same access ist granted to this file to all others which is set by the last triplet of letters r--. now we assume you want to make this file executable. to do this you could use e.g.
chmod a+x somefile

In addition you want to allow members of the group root to write to this file. this could be done by
chmod g+w somefile

In depth information about Linux permissions

md
This command is used to create a directory with the name somedir
# md somedir

rd
This command is used to remove somedir. this works only if the directory is empty
# rd somedir


If you want to remove a directory with all its contained files and subfolders you could use
# rm -r somedir

rm
This command is used to remove a file with the name somefile
# rm somefile

It can also be used to remove folders with all its contents:
# rm -r somedir

find
Find is useful if you know the name of a file or directory but can't remeber where that file lives. to search your complete directory tree for somefile type
find / -name somefile

To find all files of a certen kind e.g. jpg files which end in .jpg use the asterisk * e.g.
find / -name *.jpg

lsmod
Sometimes to install hardware and stuff you need to know which modules are loaded. typing lsmod will return you a list of loaded modules. this list can be rather long so if you're looking for a module you know the name of grep in combination with a pipe comes in handy
| (the pipe)
The commands you used so far read from the standard input and print the output to the standard output which is usually the console so you can read it. But sometimes you prefer to redirect the output form the standardout to the standard input of a second command to process it further. this can be done by a pipe. To commands are linked together by a pipe in this way, e.g.:
# onecommand | nextcommand

This will send the output of onecommand to the nextcommand wich will do some further processing and sends the output to the standard out which usually happens to be your console.
grep
grep will help you to find lines containig some letters or words your interested in. So if you want to know if somemodule is loaded in your mashine you could type:
# lsmod | grep somemodule

grep is also useful if you want to search your logfiles for messages your interested in if you use it in combination with cat.

cat

Cat will print the contents of a file to the standard output which is usually your console.e.g.
# cat /var/log/messages

Will print the content of your messages logfile.this can be quite long. So if you you are only interested in lines of your log file that contain somephrase you could use :
# cat /var/log/messages | grep somephrase

to filter the output of cat
tail
tail somefile outputs the last ten lines of somefile. The -f option will print updates to the file directly to the console so you can trace whats going on. e.g.
# tail -f /var/log/messages

head
head does pretty much the same as tail but outputs the first ten lines
dmesg
This prints out all your kernel messages. Checking kernel messages is good for debugging, e.g. if some modules failed to load. this is how the linux kernel talks to you and tells you what he has been seeing.

write standard output to file >

sometimes you may need to post parts of your logs to a newsgroup for debugging purposes. To do this you can write the output of cat piped through grep to a file e.g.
# cat /var/log/messages | grep somephrase > news.txt

and the post the output which you can find in news.txt

CTRL + Z
pressing ctrl and z at the same time will interupt a programm and fork it to background you started form the command line and that is still running. Use the command fg to bring it back to the foreground or bg to continue the program in the background.

shutdown
shutdown without options does pretty much what you expect. interesting options are:
# shutdown -h now does preety much the same as:
# halt
this asks all applications to gracefully exit and stops all processes in an ordered fashion.
# shutdown -r now
this will reboot the system. Does pretty much the same as
# init 6

init

this is useful for switching runlevels
# init 5
Initiates the runvlevel with everything, network firewoall GUI login and the like.

# init 3 swichtes to a lowere runlevel and stops Xserver and GUI. this is good for debugging of Xserver.
kill
Use kill to terminate a process.
kill -term pid

where pid has to be replaced by the process id. you can find out about the process id by typing:
ps aux

use in combination with grep to reduce output

Some Links to Guides to start with:
Linux Quickstart More absolute Basic you'll need for Linux
Network commands: list of commmands and short explaination
Console commands list of console commands and brief explaination.
start with linux If you are interested to operate Linux than this would be a good point to start.
system administrator guide This is a good guide to learn how to administrate your linux
the file system learn where Linux stores stuff

Labels: ,

Do you want to read on <<click

Wednesday, May 23, 2007 parmanent link to this post

How to install AppArmor and Dazuko in OpenSuse 10.2



So you want to run Dazuko on a OpenSuse 10.2 System. However, This will not work out of the box, since Dazuko and Apparmor are using the same Linux Security Module (LSM) API. If you try to load dazuko while apparmor is running you'll get:

dazuko: failed to register
modprobe: FATAL: Error inserting dazuko (/lib/modules/xxxxx/weak-updates/dazuko.ko): Invalid argument

But there are ways to get Dazuko up and running and Apparmor even at the same time.

To run dazuko in OpenSuse 10.2 you have basically three options:
  1. Unload the apparmor module before you load the dazuko module
  2. recompile the dazuko module with syscalls enabeled (this doesen't work for chroot directories
  3. recompile the kernel to export __d_path
Here I discribe all three of these options: How to do it and how to choose the right option.

Option 1:
This is the right option if you don't need AppArmor. You need to install Antivir using the ./install script that comes with the installation file which can be downloaded from avira. In addition you have to install the dazuko module using e.g. the Yast utility from the OpenSuse 10.2 distribution.
# modprobe -r apparmor
# modprobe dazuko
# avguard start

Use the Yast runtim configuration to make the changes permanent.

Since the default SuseLinux 10.2 default kernel is an SMP kernel for both single and multi CPU systems which does not export __d_path you there are only the following ways to get dazuko running together with AppArmor:

Option 2:
download the sources of the dazuko module and compile the module with syscalls enableled to circumvent the LSM API apparmor uses , local dpath disableled to avoid problems with the SMP kernel and disabbeled chroot support to get it running without __d_path. This is the right choice if you don't need chroot'd directories.
# ./configure --disable-local-dpath --disable-chroot-support --enable-syscalls --mapfile=/boot/System.map-`uname -r`
# make

now install and load the module

Option 3:
This assumes your in the folder wher the patch lives. Its in the extracted source folder of the dazuko moudIf you need support for chroot directories you have to patch kernel source e.g.

# patch /lib/modules/`uname -r`/build/fs/dcache.c patch_dpath.diff


and recompile the kernel in order to make him export __d_path. However this command seems not to work when you never build a kernel yourself. In this case use

# patch /usr/src/linux/fs/dcache.c patch_dpath.diff
# make clean
# make oldconfig
# make
# make modules_install
# make install

The dazuko module can only be compiled after compiling and loading the kernel so that the dazuko module will be compiled with the correct System.map. Else you get
dazuko: loaded, version=2.3.2
dazuko: no version for "__d_path" found: kernel tainted.
when loading the module

The Dazuko module can be configured and installed in this way to support chroot'd directories:
# cd /usr/lib/Antivir
# ./configure --disable-local-dpath --enable-syscalls --mapfile=/boot/System.map-`uname -r`
# mv /lib/modules/2.6.18.2-34-default/updates/dazuko.ko /lib/modules/2.6.18.2-34-default/updates/dazuko.ko.orig
# cp dazuko.ko /lib/modules/2.6.18.2-34-default/updates



everything is detailed in the Suse README of the AntiVir Distribution:

AntiVir README for users of the SUSE distribution
=================================================

There are issues with the on access scan feature on recent SUSE systems. More
thorough and up to date information is available at the www.dazuko.org site.
See the FAQ at http://www.dazuko.org/faq.shtml and the installation
instructions at http://www.dazuko.org/howto-install.shtml for more details.
The RELEASE_NOTES file that came with this installation package discusses the
issues with the latest Linux 2.6 kernels in more depth.


The on access scan feature of the AntiVir Server and AntiVir Workstation
products (commonly referred to as "Guard") runs on top of the Dazuko kernel
module. That's why it is essential that this module is available and fully
functional on a system where on access scans will be used.

By default Dazuko prefers the LSM API to interface with Linux 2.6 kernels to
capture file events. Unfortunately the AppArmor and SE Linux projects block
this API and prevent other modules from accessing it, which is why the
AppArmor and SE Linux features cannot be employed together with other LSM
using modules such as Dazuko.

In these setups it's necessary to switch to the so called syscall hooking
method to interface with a Linux 2.6 kernel. It's suggested to use at least
Dazuko version 2.3.1 and run the configure script with the --enable-syscalls
option. It's essential to specify a System.map file with the --mapfile=
option which exactly fits the kernel which the module gets built for.

Unfortunately there are System.map files which declare kernel data pages as
read only while they actually are not. Taking action at runtime based on this
information when it's incorrect leads to a kernel BUG() while not taking
action at runtime while the information is correct results in Oopses and
crashes. This situation cannot be detected by software without actually
running into the problem. Neither at build time nor at run time is it
possible to determine the correctness of this information.

At this point it's important that the administrator does know whether the
kernel data pages on this system actually are read only or whether they are
not and were wrongly declared so. With this information the Dazuko configure
script can be invoked with the appropriate options. Should this information
not be available, a test system should be used to try which approach works for
such a configuration (this is not suggested to be done on a production
system).

SUSE distributions usually do not have read only kernel data pages. Which is
why the Dazuko configure script assumes that the System.map information is not
correct and issues a warning message to this effect. Should loading a module
which was built this way result in a kernel BUG(), the module unfortunately
cannot be unloaded and the machine needs to be rebooted instead. The module
then needs to be built with the additional --sct-readonly flag passed to the
configure script.

and here:

==============================
README for Linux 2.6 kernels
==============================

In order to lookup full file paths (even in chroot environments), Dazuko
uses the kernel function __d_path(). Unfortunately this function is no
longer exported to kernel modules in the Linux 2.6 kernel.

Dazuko has its own copy of this function but unfortunately it is only safe
for UP (uni-processor or non-SMP) kernels. This is because the real __d_path()
function uses a kernel lock, which is not available to kernel modules.

If your kernel is not configured as SMP, then it is safe to use Dazuko's
copy of the __d_path() function. This is default.

If your kernel is SMP then you should _not_ use Dazuko's copy of __d_path().
You can disable Dazuko's local copy of __d_path() by configuring Dazuko with:

$ ./configure --disable-local-dpath

Since Dazuko requires __d_path(), your kernel will have to export it if you
disable the local copy. Some GNU/Linux distributions have a modified kernel
that does export this function. The "vanilla" Linux kernel does _not_ export
this function. You can check if your kernel exports this function with:

$ grep __d_path /proc/kallsyms

The results can be interpreted as:

xxxxx T __d_path <= exported xxxxx t __d_path <= not exported If you are running an SMP kernel and __d_path() is not exported, then you will have to modify your kernel source code to export the symbol and rebuild your kernel. The modification is very simply and can be made by using the included patch to modify the fs/dcache.c file. Here is an example: $ patch /lib/modules/`uname -r`/build/fs/dcache.c patch_dpath.diff The location of your Linux kernel source code may be different. Once you have patched the fs/dcache.c file, you can rebuild and install your kernel and kernel modules. If your GNU/Linux distribution doesn't export the __d_path() function, you may want to write them email suggesting that this function be exported in the next release. Note: As a workaround, Dazuko now offers the configuration option --disable-chroot-support. This will disable Dazuko from trying to resolve chroot'd filenames, thus making Dazuko safe for SMP kernels that do not export __d_path(). However, if this option is used, registered applications will only be able to work with chroot'd filenames if they resolve the filenames from within userland. If the application you plan to use with Dazuko requires handling chroot'd filenames (and you have an SMP kernel that cannot export __d_path()), then you should contact the application developer to make sure it supports this option.

Related Post:
Howto Install Dazuko (with AppArmor and AntiVir or ClamAV) with the default kernel in OpenSuse 10.2 64Bit version

Labels: , , ,

Do you want to read on <<click

Tuesday, May 22, 2007 parmanent link to this post

Azureus I2p Network plugin configuration Howto for Linux


So Azureus comes with a lot of nice plugins for download. Let's see which of them I'll install .... wait, what is this I2P network plug in... allows use of the I2P network ... Hm, no idea what I2p network really is, sounds useful though ok let's install the plugin and see what happens.

These were my first thoughts when I stumbled upon the I2P network and the corresponding Azureus plugin. Had I only known how much work i took to get it up and running I probably wouldn't have installed it. Here I write what It takes to set up the Azureus I2P Network plugin.

Outline:
  1. Install the i2prouter
  2. configure the server tunnel
  3. configure Azureus to send the i2pnetwork destination hash of the server tunnel to the tracker instead of the local ip adress.
  4. configure Azureus to listen on the target port of the server tunnel of the 12prouter
  5. configure Azureus and the i2p network plugin to communicate with each other via an proxy network relay port

Introduction:

Ok, what is the I2P network

The I2p network is a anonymous Network inside the Internet. It is a distributed network technology to make it harder to the the server to find out your IP address. I like to think of it as a Network layer on top of the Internet protocols. The Internet is usually not as anonymous as you might think since if you connect to e.g. a server over the Internet a connection is established such that the server knows your IP address. This IP address and the data transmitted from and to this address can be logged. Since ISPs (Internet service provider) log which IP address has been assigned to which user its no problem to trace back the person who established this connection. To cut long things short, your IP address usually reveals you real identity

Things get a little different if you connect to the internet through a proxy. In this case only the proxy knows your IP adress but the servers in the internet only know the IP address of the proxy. Every computer behind such a proxy appears to the internet as only one IP address. And heres what the I2P Netwokr does: It turns your computer into a proxy and all your internet communication has to go through that proxy and the peers are identified by hash keys to each other and not by their real IP address and treaffic is dynamically tunneled through multiple proxys. Since the traffic is encrypted and no single proxy knows all IP addresses of the proxys participating in the tunnel and from the outside its not clear if your only routing the tunnel or are the end of the tunnel it becoms extremely hard to trace which hash key belongs to which IP address.

Ok, what does the Azureus I2P Network Plugin do?

Well, I like to think the I2P Network plugin serves as some kind of proxy to which Azureus connects.In this way the plugin can trace all Azureus traffic and if it detects that Azureus is trying to connect to the I2P Network it redirects the traffic to the port of the I2P router/proxy which knows to handle the torrent protocol in the I2P network. (usually 7654 on your localhost). In other words the I2P network plugin redirects the outgoing I2P traffic of azureus to your I2P router that is if Azureus is trying to connect to some peer outside.

The Incomming traffic is not handeled by the plug in. To allow for incomming traffic you have to configure a server tunnel in your I2P-router and forward this tunnel to some port on the machine where azureus lives and listens. For this to work you have to instruct azureus to overwrite the address sent to the tracker with the hash key for that server tunnel

So, what's next?

Configuration and installation of the i2prouter:

Download the I2P proxy and install it to /usr/local/i2p and fire it up

# java -jar i2pinstall.exe
# cd /usr/local/i2p
# ./postinstall.sh
# ./i2prouter start

now fire up your browser and connect to the i2pconsole at:

http://localhost:7657/index.jsp

If you can see the the I2p proxy console now your i2p router should be up and running. Make sure you do the general I2P router configuration and itis working properly (configuring NAT and the like where applicable) Inbound TCP connection need to be enabeled if you want remote source to connct to Azureus (NAT OK)

Now do the Azureus specific I2P router configuration:

  • Click on "I2P tunnel" Or you can click here
  • Select add new server tunnel standard and click create.
  • Enter a Name e.g. Azureus and a Description e.g. Azureus server tunnel.
  • Check Auto Start (yes) so that the Server tunnel gets opened automatically when you fire up your i2p router.
  • enter the target host which is the IP address or name of the machine where Azureus lives. If your I2P router and Azureus running on the same box its usually ok to enter localhost here.
  • As Target host Port enter the port number your Azureus is listening on incoming TCP connections e.g. 57431
  • Enter a name for the Private key file e.g. AzureusPriv.dat.

The rest can remain unchanged.

  • Now click save and the I2P router will generate a local destination hash.
  • Copy the local destination hash to the clipboard that will appear in the status message window. The hash will be the address or identifier which will be announced to the tracker and wich peers from the i2p network will use to connect to you.
    If you lost this hash you can also copy it from the Local Server Tunnel entry. You will find a new entry und local server tunnels with the name you have chosen above e.g. Azureus. Click on the Name and a Tunnel configuration window will pop open. Now you can copy the hash from the local destination field . Make sure you get the whole thing its very long.

Now your finished with the I2P router configuration

Configuration of Azureus
  • go to Azureus/Tools/Ḱonfiguration/Tracker/Client
  • Click on overwrite announce ip address options and paste the local destination hash in here which you copied from the server tunnel you just created.
  • Move the curser to the end of the hash and append
.i2p
This is important. If you don't do this correctly it will render Azureus unresponsive when you open a torrent.

  • Now go to Connection and enter port 57431 in the incoming TCP field. The port should be the same as your entered as the target port field when you configured the server tunnel in your I2P router.
  • Now go to proxy settings and
  • activate use proxy for comunication with Tracker
  • activate have SOCKS proxy
  • enter localhost as host address
  • enter an unused port which azureus should use to communicate with the I2P network plugin (which serves as proxy) e.g. 15223
  • leave user and pass blank
  • (check) activate Proxying for source communication
  • uncheck (deactivate) imform tracker ..
  • select SOCKS Version V4a (do not use V4, this will not work)
  • check (activate) use the same Proxy setting for Tracker and Source communication.
  • Now go to Plugins/I2P Network Plugin and
Configuration of the I2P Network plugin
  • Check "enable" to activate the plugin
  • enter the path to the directory where you have installed the i2p router to e.g. /usr/local/i2prouter
  • if you don't do this correctly then you get
  • I2P install location not defind, plugin initialisation failed
  • Enter the Port you which the I2p Network plugin to listen on In Network relay port. This port must mach the port you entered as the port for tracker communication.

The rest can remain unchanged.

Configure the UPnP functionality if you which so that the i2p network plugin opens the i2p router ports for you.

  • Now restart Azureus

When lucky then you get: "i2p router connection succeeded" messge
Attantion: This only means that your i2p plugin works. Make sure that Azreus does not accept connections from outsinde i2p and that azureus does not attemt to connect to networks outside the 12p. this might compromise you ananymity since in this case you're in danger transmit your ip and your hasch to the same server.

Now go to tracker.postman.i2p

Troubleshooting:
If Azureus freezes after you opened a terrent then you dident copy the destination hash of your server tunnel to Azureus correctly. Check that .i2p is appended to the end of the hash.
If your NAT status light remains yellow this most likely means that you haven't configured the incomming connections properly. Then you have to check if you configured the server tunnel correctly. Check furthermore if the target port of the Azureus server tunnel of the i2prouter and the TCP port Azureus listens on do match each other. More over the i2prouter needs to be configured to accept incoming TCP connections.
Links:
Azureus I2p Plugin

Labels: , , , ,

Do you want to read on <<click

Monday, May 21, 2007 parmanent link to this post

MythTV: StartRecorder() -- timed out waiting for recorder to start


This problem occured after installation of MythTV under OpenSuse 10.2 using the PCTV analog USB video grabber. Here I write how I solved this issue.


This problem turned out to result from a driver problem for the analogeus USB TV grabber which comes with OpenSuse 10.2. This dirver is outdated. I guess the MythTV can't communicate with the driver. The v4l2 driver for the PCTV USB 150e/55e PAL/SECAM for Linux is the em28xx. The current version fixes this problem.

To install the current driver you need to install the kernel source and kernel headings and the mercurial package which will download the drvier source for you.
In addition its a good idea to a clean reinstall of the media library. I used the following commands which probably can do the trick for you too however don't do the "rm" stuff unless you know that the vf4l driver source compiles without problems:
# rm -rf  /lib/modules/`uname -r`/kernel/drivers/media
# hg clone http://mcentral.de/hg/~mrec/v4l-dvb-kernel
# cd v4l-dvb-kernel
# make
# make ./install

In fact I use the experimentel tree of the driver which also woks fine for me.(http://mcentral.de/hg/~mrec/v4l-dvb-experimental)

The experimental driver works for me with MythTV, Freevo, TVtime, mplayer, and kdetv so it can't get much better, I guess.
releated posts

Labels: , , ,

Do you want to read on <<click

Sunday, May 20, 2007 parmanent link to this post

PCTV analog USB2: "open /dev/vbi: Device or resource busy issue" solved

VBI means Vertical Blank interval of a TV signal in the US terminology. This is the interval between frames where no picture is displayed but information like teletext can be broadcasted. I guess the VBI device in linux is the interface to read out such data from the TV signal provided that you TV grabber can extract you the VBI data from the video signal. Here I write why many people report that the VBI device of the PCTV analog USB is always busy though no application is using it.

the 150e/55e has an em2820 on board which does not support teletext ( raw VBI capture, sliced VBI capture)!!!

Although the em28xx driver supports em2820 based tv grabbers quite well it initializes an vbi device although it probably shouldn't. This is likely to the reason for the erreor you get when starting scnatv:

#scantv

vbi: open failed [/dev/vbi]

open /dev/vbi: Device or resource busy

#dmesg

em28xx #0: this driver can be opened only once

This issue has been fixed in the new version of the em28xx driver. If you update the em28xx driver it wont initialize a vbi device any more. However, after update you are likely to get anoher error message after starting scantv:

open /dev/vbi: no such device or directory
obviously scantv refuses to work without a vbi device which is probably a bug?



But as a workaround you could now start kdetv or xaw tv and scan the channels. This will work and you can enter the addtitional imformation for the channels manually.











Technorati Tags: ,



Powered by ScribeFire.

Labels: , , ,

Do you want to read on <<click

Saturday, May 19, 2007 parmanent link to this post

Howto solve PCTV analog USB 2 (150e/55e) tuner issue: can't scan UHF

For me the em28xx detected tuner #37 which is probably wrong cause tuning UHF channels din't work. Here I explain how to solve this problem.

My tuner reads LG tape something so I use #47 for the tuner= insmod option instead. Now I can tune in UHF channels.

For Suse you have to edit /etc/modprobe.d/tv and enter the module options for the em28xx. Look for options and change tuner=37 to tuner=47. Now UHF works fine for me. Heres how my /etc/modprobe.d/tv looks like.

alias char-major-81 videodev
options em28xx card=8 disable_ir=0 tuner=47
alias char-major-81-0 off
alias char-major-81-1 em28xx
alias char-major-81-2 off
alias char-major-81-3 off
wiki discussing the em28xx UHF tuning issue for other cards

In addition I use card=8. Here is a list of valid choices for the card= insmod option:

em28xx #0:     card=0 -&gt; Generic EM2800 video grabber
em28xx #0: card=1 Generic EM2820 video grabber
em28xx #0: card=2 Generic EM2821 video grabber
em28xx #0: card=3 Generic EM2870 video grabber
em28xx #0: card=4 Generic EM2881 video grabber
em28xx #0: card=5 Generic EM2860 video grabber
em28xx #0: card=6 Generic EM2861 video grabber
em28xx #0: card=7 Terratec Cinergy 250 USB
em28xx #0: card=8 Pinnacle PCTV USB 2 (LG PAL TAPC)
em28xx #0: card=9 Hauppauge WinTV USB 2
em28xx #0: card=10 MSI VOX USB 2.0
em28xx #0: card=11 Terratec Cinergy 200 USB
em28xx #0: card=12 Leadtek Winfast USB II
em28xx #0: card=13 Kworld USB2800
em28xx #0: card=14 Pinnacle Dazzle DVC 90
em28xx #0: card=15 Hauppauge WinTV HVR 900
em28xx #0: card=16 Terratec Hybrid XS
em28xx #0: card=17 Terratec Hybrid XS Secam
em28xx #0: card=18 Kworld PVR TV 2800 RF
em28xx #0: card=19 Terratec Prodigy XS
em28xx #0: card=20 Videology 20K14XUSB USB2.0
em28xx #0: card=21 Usbgear VD204v9
em28xx #0: card=22 Terratec Cinergy T XS
em28xx #0: card=23 Pinnacle PCTV DVB-T
em28xx #0: card=24 DNT DA2 Hybrid
em28xx #0: card=25 Pinnacle Hybrid Pro
em28xx #0: card=26 Hercules Smart TV USB 2.0
em28xx #0: card=27 Compro, VideoMate U3
em28xx #0: card=28 KWorld DVB-T 310U
em28xx #0: card=29 SIIG AVTuner-PVR/Prolink PlayTV USB 2.0
em28xx #0: card=30 Terratec Cinergy T XS (MT2060)
em28xx #0: card=31 MSI DigiVox A/D
em28xx #0: card=32 D-Link DUB-T210 TV Tuner
em28xx #0: card=33 Gadmei UTV310
em28xx #0: card=34 Kworld 355 U DVB-T
em28xx #0: card=35 Supercomp USB 2.0 TV
em28xx #0: card=36 Hauppauge WinTV HVR Rev. 1.2
em28xx #0: card=37 Gadmei UTV330
em28xx #0: card=38 V-Gear PocketTV
em28xx #0: card=39 Kworld 350 U DVB-T
em28xx #0: card=40 Terratec Hybrid XS (em2882)
em28xx #0: card=41 Pinnacle Dazzle DVC 100
em28xx #0: card=42 Generic EM2750 video grabber
em28xx #0: card=43 Yakumo MovieMixer
em28xx #0: card=44 Huaqi DLCW-130
em28xx #0: card=45 Generic EM2883 video grabber
em28xx #0: card=46 Hauppauge WinTV HVR 950
em28xx #0: card=47 Pinnacle PCTV HD Pro
em28xx #0: card=48 Pinnacle Hybrid Pro (2)
em28xx #0: card=49 Hauppauge WinTV USB 2 (R2)
em28xx #0: card=50 NetGMBH Cam
em28xx #0: card=51 Leadtek Winfast USB II Deluxe
em28xx #0: card=52 MSI DigiVox A/D II
em28xx #0: card=53 Typhoon DVD Maker
em28xx #0: card=54 Pinnacle PCTV USB 2 (Philips FM1216ME)
Here is a list for valid options for the insmod tuner= option. I use tuner=47

tuner=0 - Temic PAL (4002 FH5)
tuner=1 - Philips PAL_I (FI1246 and compatibles)
tuner=2 - Philips NTSC (FI1236,FM1236 and compatibles)
tuner=3 - Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
tuner=4 - NoTuner
tuner=5 - Philips PAL_BG (FI1216 and compatibles)
tuner=6 - Temic NTSC (4032 FY5)
tuner=7 - Temic PAL_I (4062 FY5)
tuner=8 - Temic NTSC (4036 FY5)
tuner=9 - Alps HSBH1
tuner=10 - Alps TSBE1
tuner=11 - Alps TSBB5
tuner=12 - Alps TSBE5
tuner=13 - Alps TSBC5
tuner=14 - Temic PAL_BG (4006FH5)
tuner=15 - Alps TSCH6
tuner=16 - Temic PAL_DK (4016 FY5)
tuner=17 - Philips NTSC_M (MK2)
tuner=18 - Temic PAL_I (4066 FY5)
tuner=19 - Temic PAL* auto (4006 FN5)
tuner=20 - Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
tuner=21 - Temic NTSC (4039 FR5)
tuner=22 - Temic PAL/SECAM multi (4046 FM5)
tuner=23 - Philips PAL_DK (FI1256 and compatibles)
tuner=24 - Philips PAL/SECAM multi (FQ1216ME)
tuner=25 - LG PAL_I+FM (TAPC-I001D)
tuner=26 - LG PAL_I (TAPC-I701D)
tuner=27 - LG NTSC+FM (TPI8NSR01F)
tuner=28 - LG PAL_BG+FM (TPI8PSB01D)
tuner=29 - LG PAL_BG (TPI8PSB11D)
tuner=30 - Temic PAL* auto + FM (4009 FN5)
tuner=31 - SHARP NTSC_JP (2U5JF5540)
tuner=32 - Samsung PAL TCPM9091PD27
tuner=33 - MT20xx universal
tuner=34 - Temic PAL_BG (4106 FH5)
tuner=35 - Temic PAL_DK/SECAM_L (4012 FY5)
tuner=36 - Temic NTSC (4136 FY5)
tuner=37 - LG PAL (newer TAPC series)
tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3)
tuner=39 - LG NTSC (newer TAPC series)
tuner=40 - HITACHI V7-J180AT
tuner=41 - Philips PAL_MK (FI1216 MK)
tuner=42 - Philips 1236D ATSC/NTSC dual in
tuner=43 - Philips NTSC MK3 (FM1236MK3 or FM1236/F)
tuner=44 - Philips 4 in 1 (ATI TV Wonder Pro/Conexant)
tuner=45 - Microtune 4049 FM5
tuner=46 - Panasonic VP27s/ENGE4324D
tuner=47 - LG NTSC (TAPE series)
tuner=48 - Tenna TNF 8831 BGFF)
tuner=49 - Microtune 4042 FI5 ATSC/NTSC dual in
tuner=50 - TCL 2002N
tuner=51 - Philips PAL/SECAM_D (FM 1256 I-H3)
tuner=52 - Thomson DTT 7610 (ATSC/NTSC)
tuner=53 - Philips FQ1286
tuner=54 - tda8290+75
tuner=55 - TCL 2002MB
tuner=56 - Philips PAL/SECAM multi (FQ1216AME MK4)
tuner=57 - Philips FQ1236A MK4
tuner=58 - Ymec TVision TVF-8531MF/8831MF/8731MF
tuner=59 - Ymec TVision TVF-5533MF
tuner=60 - Thomson DTT 761X (ATSC/NTSC)
tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF
tuner=62 - Philips TEA5767HN FM Radio
tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner
tuner=64 - LG TDVS-H06xF
tuner=65 - Ymec TVF66T5-B/DFF
tuner=66 - LG TALN series
tuner=67 - Philips TD1316 Hybrid Tuner
tuner=68 - Philips TUV1236D ATSC/NTSC dual in
tuner=69 - Tena TNF 5335 and similar models
tuner=70 - Samsung TCPN 2121P30A
tuner=71 - Xceive xc3028
tuner=72 - Thomson FE6600
tuner=73 - Samsung TCPG 6121P30A
tuner=75 - Philips TEA5761 FM Radio
the original list can be found here:

em28xx tuner insmod option list: I use no 47 for LG TAPE series
Related Posts can be found here


Labels: , , , ,

Do you want to read on <<click

Thursday, May 17, 2007 parmanent link to this post

Solved: nForce4 CK804 (Intel8x0) ALSA audiodriver uses only on two speakers for stereo playback when 5.1 6 channel speakers are connected

I have a 5.1 surround speaker set connected to my K8N ultra SLI mainboard with a CK804 sound on board. When playing MP3 I realized that Linux used only the front speaker for stereo playback, which is pretty annoying since the front speakers are not full range an desperately need the woofer to run for a nice sound. Here I write how I solved this issue.



It turned out that this issue is not a driver issue, however. This is due to a, in my opinion, odd behavior of the ALSA drivers. ALSA feeds the channel from the source to the corresponding speaker. Since you have only to two channels in stereo sound alsa sends only sound to the front (left and right) speaker. Although this behavior is very logical its verry confusing for a easyly confused noob like me and it took me quite a while to fix this problem.

First I had to make sure that the hardware is set up properly. Therefore I used a little helper applet that comes with the ALSA package:

# speaker-test -c 6 -r 48000


Now I heard sound (noise) on all speakers. If you hear something then the driver and ALSA should work.

Getting a driver update from nvidia is not necessary since they only distribute only sata and lan drivers for their nForce chip set. They included their driver sources for their on board sound to the ALSA project so it should be fine to use their driver. The CK804 is supported as as intel8x0. Anyway, here are the sites for the nvidia downloads:

http://www.nvidia.com/object/linux_nforce_1.21.html
http://http.download.nvidia.com/XFree86/nforce/1.0-0310/ReleaseNotes.html

But I did an ALSA driver update. However, this update is optional I guess.

---snip---

To do this you need to install autoconf, kernel-source, gnu make, kernel-headers with yast if not done yet.

To compile and install the latest drivers from source, first download the CVS
(Remark: devfs is depreciated in Suse 10.2 since it uses udev so we don't need to execute ./snddevices script here)

# rsync -avz --delete rsync://alsa.alsa-project.org/hg your_directory
# ./cvscompile --with-cards=intel8x0 --with-sequencer=yes
# make install
# modprobe snd-intel8x0;modprobe snd-pcm-oss;modprobe snd-mixer-oss;modprobe snd-seq-oss
---snip----

The most important step is to edit the .asoundrc. The .asoundrc is a configuration file which is read in by default and lives in your home directory.

# vi /home/xxx/.asoundrc
vi is an editor but you can use whichever you you prfer to perorm this task. xxx denotes the name of your home directory. Then add the the following code to your .asoundrc :

pcm.ch51dup {
type route
slave.pcm surround51
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}


This will duplicate stereo channels to the sourround speakers but you have to use ch51dup as device for output of stereo files. In Amarok I use the configuration shown in the screenshot:

I used the following links as source:


Technorati Tags: , , , , , ,

Labels: , , , , , , ,

Do you want to read on <<click

Tuesday, May 15, 2007 parmanent link to this post

Installing MythTV on OpenSuse Linux 10.2 64 Bit w/ USB 2.0

Myth TV is a Media Center for Linux software. It fetches an electronic programm Guide for you, schedules recordings, seraches your favorite soaps in the electronic programm guide (EPG) and records them for you so you nerver miss a thing. In addition you can load a lot of modules for DVD CD Phosto Mp3 playback and stuff. Pretty neat.

I use MythTV 0.2 and kernel 2.6.18.8-0.3-default SMP with openSUSE patches. The em28xx driver needs to be updated though. Don't try MythTV 0.19 that won't work with the PCTV usb2. probably none of the em28xx devices will work with versions prior to 0.2.

Mythbackend is the server application of MythTV. it controles the TV grabber starts stop the recording and stores media data and stores and the Electronic Program Guide (EPG). All this data is stored in the MySQL database. The forntend is the client application. Its a remotecontrol for the backend. The backend will start stop recordings, swich channels on request of the frontend and stream the movie data to the frontend which will display it to you. The frontend also queries the MySQL datbase for EPG data, I guess. Here I write how I installed MythTV for OpenSuse 10.2

A precompiled *.rpm is provided by Packman

The Packman MythTV rpm v0.2 won't work with SuseLinux 10.2 with PCTV analog USB2 out of the box since the em28xx (driver for the 150e/55e) of OpenSuse 10.2 is outdated. You have to compile you own em28xx V4l2 from sources

follow the MythTV installation instructions for OpenSuse outlined here:

OpenSuse MythTV wiki

or here:

Installing MythTV


Some additional Notes:

Enter as root
# rcmysql start
(issue # chkconfig --level 35 mysql on
when mysql wount start at boot though enabled in the runleveleditor of Yast2 )
then initialize the database:
(Without mysql running mythtv-setup says it cant connect to the mysql server)

# mysql -u root < /usr/share/doc/packages/mythtv/database/mc.sql
List of packqges and dependencys is not complete in the Howto. You have to install xml-grabbers package!!!! this package contains the XML grabbers you need for the EPG channel list!!!! without you get tv_grab_de_tvtoday no such file or directory (or whichever the name of you grabber is)
you'll need to Alt + tab to the console and answer the questions of the grabber. It will ask you which Channels it should fetch for you. only check those channels you'll really need e.g which are available in your Cable netl.
You have to create directory where you want to save your digitally recorded tv programmes and make it world readable/writable before you start the mythtv-setup. you need to specifiy that directory during mythtv-setup. e.g.
# mkdir /home/video
# chmod a+rwx /home/video


start the setup from a console so you can see error messages on the console output!!!!
# mythtv-setup


The grabber is a pice of software which rips the Programm Guide from some website and outputs it in XML (extendable markup language, a flexible file format that mythtv can read)
during setup Mythtv will invoke the grabber
tv_grab_de_tvtoday --configure


This will only configure the grabber. Here you select wich Channels you want to grab from the electronic programm guide from the internet. Configuration will be saved to file
~/.xmltv/tv_grab_de_tvtoday.conf
here you can edit the file in case you made mistakes,
use as root
# rcmythtvbackend start

to start the mythtv backend
After the end of mythtv-setup you can do a
# mythfilldatabase --manual

to enter the frequency channel information for the respective station.
The
--manual
directive triggers an interactive mode where you can provide some information. MythTV needs to know to which channel it has to set the tuner of you tv Grabber (ur PCTV analog USB) if you want to watch a certen Broadcasting station. I will ask you on which channel it can find a Broadcasting station. The unique identifieer of the EPG data is the XMLTV.ID Thus MythTV needs to which XMLTV.ID is found on which channel. In additiont you can enter a lot of other informative stuff like long name and short name of the broadcasting station.
do the mythfilldatabase only for one day with the
--manual
directive else you have to go through all channel by for each day and grabbing takes forever (may be hours +).

use
# mythfilldatabase --update
to grab the following days instead. Once the channels are defined thy will be imported by mythfilldatabase automatically.

Mythfilldatabase takes forever. For me if was faster to run the grabber first for 1 dayThen improt EPG from *.xml file using:
# tv_grab_de_tvtoday --list-channels --output channels.xml
# mythfilldatabase --manual --preset --file 1 -1 channels.xml

have a channels list ready to assaign each station a channel from the channel freequncy list.
you can find this out by using mplayer
start mplayer from the console
mplayer -tv driver=v4l2:device=/dev/video0:amode=1:input=0:norm=PAL:adevice=/dev/dsp1:immediatemode=0:audiorate=48000:fps=30   tv://

and swich channels with h and k. this will require theat the PCTV USB is /dev/video0 and the audio device of the PCTV usb is /dev/dsp1. In the console (STD OUT) mplayer will print the current channel and you can see at the same time what si goin on.
Kdetv can also do a channal scan and you have to add the names manually. the em2820 of the PCTV USB2 150e/55e does not support Teletext/vbi. So dont bother.
then grab the rest
# tv_grab_de_tvtoday  --slow --output EPG.xml
and import
# mythfilldatabase -file 1 -1 EPG.xml --update
the 1 denotes the input source. If its not the first input source you want to grab then adjust this number accordingly -1 is ths offset which imports everything up to 7 day in advance from now on.
When lucky you can now start frontend to watch tv and do recordings and stuff.
to debug start frontend and backend from a console. 
the em28xx and V4l2 drivers which come with OpenSUSE 10.2 are outdated. They don't work for PCTV USB 2 PCTV analog USB2 150e/55e and MythTV
if you start the backend and start live TV you'll get a black screen and get a :

StartRecorder() -- timed out waiting for recorder to start


on the console you started the backend from.

Compile the recent stable version of em28xx

see here: em2880 wiki about mythtv

and here

repository ot the em28xx

you dont need to add any fimware to the source for analog devices like the 150e/55e. Firmware is only needed for digital devices.

To download the sources of the em28xx you will need a special programm which mnages sources. This is called mercurial (check if package is installed). It manages so called mercurial sources.

This is a package wich manages sources of large decentralized projects. It will download the sources you'll need and und update your sources automatically
enter:
You need to install kernel sources and kernel headlins before you can compile the em28xx driver
# hg clone http://mcentral.de/hg/~mrec/v4l-dvb-kernel
# cd v4l-dvb-kernel
# make
# make ./install

now reboot

after reboot MythTV should work.

Note. Kdetv also works only after driver update;)
link that download from v4linux domain is outdated ... can show up on old wiki or forum entries

some useful links:

forum
troubleshooting

Technorati Tags: , , , , ,

Labels: , , , , ,

Do you want to read on <<click