/kernel_reloaded/

Author:

Valent Turkovic

Novi članci

Categories

Flickr Goodness

tips&tricks Archive

May 20, 2008 @ 12:40

Madwifi wireless for Asus Eee PC on Fedora 9 HowTo

fedora 9 wireless on eee pc
 
Im this tutorial I will show you how to download patched driver and compile it yourself, but first I would like to explain why wireless drivers aren’t working on Eee PC running Fedora 9.
 

Asus Eee PC uses Atheros wireless chip AR5007. Atheros as a company doesn’t support linux and doesn’t make linux drivers available, there are linux drivers but they are made by madwifi project crew. Atheros company doesn’t make any effort in making their wireless chips work on linux; they hide specifications of their wireless chips and don’t make them available to linux developers. It is amassing that a developers around madwifi project actually succeed in making these drivers considering all the obstacles. Madwifi drivers still needs Atheros binary HAL (Hardware Abstraction Layer).
 

This HAL is not binary firmware but a piece of code that needs to run in the Linux kernel. It consists of header files for which no permisison to modify is granted, and pre-compiled object files. The vendor’s position is that the Linux community simply needs to accept this sourceless HAL, since in principle the Atheros chip could be tuned to any frequency, and thus produce RF interference with systems operating in those frequencies. This binary HAL is unacceptable to the Linux kernel developers, and the madwifi driver in this state will never become part of the official kernel.
 

Some OpenBSD developers, facing the same issue, reverse-engineered the binary HAL and have produced an open source driver (ath5k), which has now been picked up by the madwifi team as the future direction. At the same time the madwifi driver has been labeled ‘legacy’ to reinforce this point.
 

So we have two drivers that support Atheros chip based wireless cards; madwifi and ath5k, but neither of them currently supports the chip that Asus choose for Eee PC - AR5007. That is now true, you say, my Eee PC runing Xandros linux has a working wireless! If you weren’t aware Xandros uses NDISwrapper to load windows drivers (to learn more look at NDISwrapper article on Wikipedia). So Xandors is using windows and not linux wireless drivers.
UPDATE: I checked with lsmod and Xandros also uses madwifi (ath_pci) driver. They have also custom patched the driver to work.
 

athk5 driver is under heavy development and it is now known when it will support AR5007. Madwifi has a patch that adds support for AR5007, but unfortunately this patch cannot be committed to madwifi, since it breaks the ABI for all non-i386 HAL binaries.
 

In order to get your wireless working on Eee PC with madwifi you need to patch the driver manually so here is step by step walktrough:
Update: Im this tutorial I will show you how to download patched driver and compile it yourself.
 
Update 2: If you don’t wan’t to compile the driver manually then you need to configure Livna repository and then just issue yum command to install the driver.
As root do this:
rpm -i http://rpm.livna.org/livna-release-9.rpm
yum --enablerepo=livna-testing install kmod-madwifi
 

If you still want to do it manually and perrhaps learn how to do it then you need to install all necessary packages; as root do:
yum install make binutils gcc glibc-devel glibc-headers libgomp patch kernel-headers kernel-devel wget
 

Then blacklist the ath5k module; edit your blacklist file (as root) in \etc\modprobe.d\blacklists (I have to reverse slashes because mod_security on this blog that prevents writing \etc\ with regular slashes) and add the line with “blacklist ath5k”
echo "blacklist ath5k" >> \etc\modprobe.d\blacklist (reverse the slashes)
 

You should also edit your \etc\modprobe.conf to look like this:
## Start Atheros Stuff
alias wifi0 ath_pci
alias ath0 ath_pci
options ath_pci autocreate=sta
## End Atheros Stuff

 

Download patched madwifi driver:
wget http://snapshots.madwifi.org/special/madwifi-nr-r3366+ar5007.tar.gz
 

Extract madwifi source code and compile it:
tar xvf madwifi-ng-r2756-20071018.tar.gz
cd madwifi-nr-r3366+ar5007
make
su
make install

 

That is it, after reboot you have a working wireless under Fedora 9.
 

Links:

Filed under english, fedora, linux, tips&tricks, wireless · 12 Comments »

February 28, 2008 @ 14:14

Howto compile uvcvideo linux webcam module for Fedora

webcam

 

If you have followed my previous webcam howto guide and found out that you need uvcvideo module for your webcam just follow this howto.

First install subversion, if you don’t already have it installed, so you can get the latest code from uvcvideo project svn repository. As root just start yum in console or if you like gui application managers like pirut just use them. Here is how you can install it with yum:

yum install subversion

now you need to get the source code for uvcvideo webcam module:

svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk linux-uvc

and when the download is complete you can compile the code:

cd linux-uvc
make

Now you need to become root and install the module in correct place:

su
make install INSTALL_MOD_DIR=extra/uvc

Then you will get an error saying:

depmod -ae `uname -r`
/bin/sh: depmod: command not found

because you don’t have /sbin directory in your path so only thing you still need is this:

/sbin/depmod -ae `uname -r`

now you can load your module with command:

/sbin/modprobe uvcvideo

and run cheese to test your webcam.

 

links:

 

ps. I choose images for my blog by going to http://images.google.com and seraching for the most obvious keyword in the article, for this article it the word was webcam. As you can see this keyword provided some interesting search results :)

Filed under english, fedora, linux, tips&tricks · 2 Comments »

February 13, 2008 @ 13:44

Fedora webcam howto

If you have a webcam that needs some module (driver) that it is not in Fedora kernel then you usually need to compile it manually. Fedora doesn’t include any modules that aren’t in upstream kernel. Livna repository has some modules for some webcams. But if you have a webcam like mine that uses uvcvideo module which isn’t in livna repo then only solution is to compile it manually.

First step in getting your webcam working is to check if maybe it is working but you don’t know it is :)

Install application called cheese with your favorite gui of cli tool. I use yum so here is how I do it:

su -
yum install cheese

If you webcam works that is it, if it doesn’t work then you need to find out which webcam module you need to install or compile.

Start tool called v4l2-tool, if you don’t have it install it. When you start it you will see this:

webcam_01.png

Click on the last tab labeled “suggest driver”:

webcam_02.png

Then click on “lsusb output” button:

webcam_04.png

Now you need to recognize which of all listed usb devices is your webcam. I had only two lines and I recognized microdia as manufacturer of my webcam so I used manufacturer and model ID from that line in my cast that is - 0c45:62c0.

Now you need to enter that info back in main window in “vendor ID” and “product ID” boxes and press suggest driver button:

webcam_05.png

How you should get the module name and link where to get more info for installing your webcam in Fedora.

Filed under english, fedora, linux, tips&tricks · 5 Comments »

July 12, 2007 @ 12:15

howto install latest tomboy in fedora core 6

If you have Fedora Core 6 you are using Tomboy 0.4.1 because that is the latest version that Gnome 2.16 comes with. To me this is a nonsense and I didn’t see any libraries that prevent tomboy to be updated to a newer version.

I tried compiling tomboy 0.6.3 (latest stable version) and 0.7.1 (latest unstable version) from source. I added missing dependencies that ./configure complained about (yum -y install libgnomeprint22-devel libgnomeprintui22-devel gtk-sharp-2.0-devel) but I still got some missing dependencies I couldn’t resolve (gnome-sharp-2.0 and gconf-sharp-2.0).

After posting to fedora-devel mailing list I got a great suggestion - to install it from development repository.

That worked out great! And as I suspected there are no other dependencies, it is a clean update.

Just issue this command, and you are off:
yum update tomboy --enablerepo=development

Filed under english, linux, tips&tricks · 1 Comment »

June 9, 2007 @ 18:12

Firefox session

If you wan’t to backup your firefox session ie. your open tabs just backup this file:
~/.mozilla/firefox/XXXX.default/sessionstore.js

I didn’t have Firefox 2.0 crash on me and I didn’t loose any surfing sessions - so this is only for prevention or you can use it so save your surfing sessions in different files… or send your friends your surfing session.

Filed under english, linux, tips&tricks · No Comments »

June 8, 2007 @ 20:59

network monitoring

Best linux tools I found for doing linux network monitoring are ntop (web server on port 3000) and iptraf for console monitoring.

iptraf -u -d ra0

link:

Filed under english, linux, tips&tricks · 1 Comment »

May 4, 2007 @ 12:33

igranje s Fedora 7 test 4 “reposima”

Ako se želite malo poigrati s Fedora 7-icom onda će vas zanimati i dodatni repozitoriji.

Za bi dodali livna repo trebate napraviti datoteku /etc/yum.repos.d/livna.repo i u njoj treba pisati:

[livna]
name=Livna - Development
baseurl=http://rpm.livna.org/fedora/development/$basearch/
enabled=1
gpgcheck=0

Pogledajte koji sve paketi postoje u livna repozitoriju:
http://rpm.livna.org/fedora/development/i386/

Da bi atrpms repo proradio na Fedora 7 test 4 napravite slijedeću datoteku:
/etc/yum.repos.d/atrpms.repo

te u njemu treba biti:

[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/f7-i386/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
enabled=0
gpgcheck=1

Ako želite nešto instalirati iz tog repozitorija to ide lagano s ovom naredbom:

yum --enablerepo=atrpms install lame

Filed under linux, tips&tricks · 1 Comment »

May 3, 2007 @ 9:57

Grub splash image

Jedan brzo potezni tip:

How to convert Wallpaper to Splash Image for GRUB menu:

convert -resize 640×480 -colors 14 wallpaper.png splashimage.xpm && gzip splashimage.xpm

Filed under tips&tricks · No Comments »

April 24, 2007 @ 15:29

Video on my K750 via ffmpeg on linux

       
video on k750

I love the SonyEricsson K750 phone, it is a great device. From the first time I played video demo file on K750 in a shop I knew I’m gonna buy it because the video looked really good, despite the small screen. Now I have K750 over a year and I figured out it is time that I play around with watching video on it. My excuse for not doing it before was the amount of storage memory (64Mb), but 1GB sony memory stick card fixed that.

First thing I had to find out is what kind of video does it play. It can play two file formats (or file containers to be more precise) and they are .3gp and .mp4

Both containers can contain H.263 or Mpeg4 for video and AMR or AAC for audio.
For low-end and low-bandwidth use H.263 and AMR but if you want high quality then use Mpeg4 and AAC combination because it produces better quality video.

So I will use Mpeg4 as video codec and AAC for audio codec and 3gp as a file container.

Video resolution has to be 176×144. K750 has a screen resolution of  220×176 pixels but it doesn’t support video larger than 176×144 :(

Framerate can be up to 30 fps but it consumes a lot of the file size and quality for video podcast isn’t noticeably better so I use 15 fps.

Setting bitrate was a bit difficult because ffmpeg man page isn’t updated with the changes made in the parameters. So if you want 200kbits video bitrate by the ffmpeg help page you need to set the parameter “-b 200″ but they changed it without updating the help or man page so now you need to set it to “-b 200k” - for me this is a bug.

Combined audio and video bitrate should be below 264kbps or the finished video will stutter during playback.

For video podcasts I set audio to 32000 Hz, mono, 32 kb/s - you can set lower or higher audio quality but remember the maximum combined bitrate should be below 264kbps. If you are conversing something more audio intensive than speech, like music videos, than use audio bitrate of 64 kb/s.

Now for the part you are all waiting for. For converting diggnation to my K750 I used this command:

ffmpeg -i diggnation--0093--2007-04-11--large.xvid.avi -vcodec mpeg4 -s 176x144 -r 15 -b 200k -acodec aac -ac 1 -ar 32000 -ab 32 -f 3gp diggnation--0093--2007-04-11.3gp

UPDATE (for newer ffmpeg):
Last year (2007) ffmpeg has renamed codecs - so that all codec names that use external library are renamed to libfoo.
On Fedora (and other distros) if you have installed newer ffmpeg from Livna or RPMFusion repositories the command is a little different. Instead of “-acodec aac” you need to use “-acodec libfaac”. So on Fedor it should be like this:

ffmpeg -i diggnation--0093--2007-04-11--large.xvid.avi -vcodec mpeg4 -s 176x144 -r 15 -b 200k -acodec libfaac -ac 1 -ar 32000 -ab 32 -f 3gp diggnation--0093--2007-04-11.3gp

I found out that variable bitrate works better and produces smaller file and higher quality file!
ffmpeg -i diggnation--0093--2007-04-11--large.xvid.avi -vcodec mpeg4 -s 176x144 -r 15 -qscale 4 -acodec aac -ac 1 -ar 32000 -ab 32 -f 3gp diggnation--0093--2007-04-11.3gp

UPDATE (for newer ffmpeg):
ffmpeg -i diggnation--0093--2007-04-11--large.xvid.avi -vcodec mpeg4 -s 176x144 -r 15 -qscale 4 -acodec libfaac -ac 1 -ar 32000 -ab 32 -f 3gp diggnation--0093--2007-04-11.3gp

I used here “-qscale 4″ instead “-b 200k” for video bitrate. With this parameter you define the quality you want and not the rigid video bitrate. This is better for dynamic content - so when the video is dynamic more bitrate is given to maintain the quality but when video is less dynamic then it uses significantly less bandwidth and produces smaller files.
You need to be careful because using VBR method combined bitrate can over 264kbit/s because you are giving the encoder the option to give rise to the bitrate when it calculates it is necessary and that can cause a bit of video playback stuttering. If this happens a lot during video playback then lower the quality and bitrate by setting qscale to a higher number.

If you are using windows please try reading Converting vids for K750 using NERO recode.

Parameters for you to tweak are these:

-i # this it the name of the input file
-vcodec # set this to mpeg4 or h263, depending which codec you want to use
-s # this is the video size. don’t change it - has to be 176×144
-r # video frame rate - experiment with this in the sane range of 10-30 fps
-b # set video bitrate (in bits/s) - use the range from 100k to 200k
-acodec # set “aac” older ffmpeg or “libfaac” for newer ffmpeg as the audio codec
-ac # set number of audio channels; 1 for mono, 2 for stereo
-ar # set audio sampling rate (in Hz)
-ab # set audio bitrate (in kbit/s)
-f # choose file container; 3gp or mp4
-qscale # use fixed video quantizer scale (VBR)

Filed under english, fedora, linux, tips&tricks · 2 Comments »

February 16, 2007 @ 14:14

Video kodeci, konverzije i ribarsko prigovaranje

       
open source gift guide

Ako imate potrebu raditi bilo kakve konverzije iz jednog video formata u drugi ffmpeg je za to vjerojatno najbolji alat. ffmpeg koristi razne pomoćne datoteke kako bi podržao razne formate, pa ćete, ovisno o distribuciji koju koristite, imati više ili manje podržanih formata. Moj omiljen kodek je xvid te ga preferiram.

Na Fedora Core 6 distribuciji je potrebno instalirati ffmpeg iz livna ili atrpms repozitorija i stvar je riješena. Za Ubuntu je potrebno samo omogućiti multiverse apt-get repozitorij i instalirati ffmpeg. Ovo će većinu zadovoljiti, ali ne i mene jer ffmpeg iz multiverse repozitorija ne podržava xvid i još neke kodeke.

Da biste vidjeli koje kodeke podržava vaša instalirana verzija ffmpeg-a samo ga pokrenite naredbom:

ffmpeg -formats

Ako vas zanima podržava li xvid (ili bilo koji drugi format) onda ovako:

ffmpeg -formats|grep xvid

Zanimljiv tekst na ovu temu je i How to convert YouTube videos to DivX or XviD.

Ako želite na Ubuntu popraviti ffmpeg tako da ima podršku za sve moguće kodeke onda je ovo zanimljiv tekst: Fixing ffmpeg on Ubuntu Edgy.

A sada malo konkretnih naredbi za video konverziju.

Youtube (flv datoreka) u xvid avi datoteku:

ffmpeg -i youtube.flv -s 320×240 -r 15.00 -b 300 -f avi -vcodec xvid -acodec mp3 -ab 96 youtube.avi

Ako nemate ffmpeg ili želite probati s drugim alatom evo ista stvar, ali s mencoder alatom.

mencoder input.flv -ofps 15 -vf scale=300:-2 -oac lavc -ovc lavc -lavcopts codec=msmpeg4v2:acodec=mp3:abitrate=64 -o output.avi

Ako nemate punu verziju ffmpeg paketa i ne želite se zezati ili vam xvid i ostali kodeci nisu potrebni onda jednostavno napravite konverziju u mpeg:

ffmpeg -i youtube.flv -ab 56 -ar 22050 -b 500 -s 320×240 youtube.mpg

Za konverziju MPEG2 datoteke u XVID:

ffmpeg -i filmic.mpg -qscale 4 -deinterlace -s 640×480 -vcodec xvid -acodec mp3 -ar 44000 -ab 128 filmic.avi

dodavanje prve sekunde iz video datoteke kao preview slike:

ffmpeg -i filmic.avi -f mjpeg -t 0.001 filmic.jpg

Filed under linux, tips&tricks · No Comments »

    Recent Comments

    • Christoph: Hopefully I have fixed the bug (as well as some others). See: https://bugzilla.redhat.com...
    • Christoph: +1 for parcellite. Smaller, slicker and works cross-desktops. And it’s maintained ;)
    • Jean-François Martin: There is Parcellite (http://parcellite.sourceforge .net) which have the same function.
    • Peter: elisa isn in F-10 as there are two elisa-plugins-[good|bad] package reviews that need to be done before it can...
    • MarkHu: Hey, this works great. Thanks for the tip! A couple of caveats for others who want to try it: My experience...

    Archives


    ·

    Meta

    Visit my Mugshot page