https://wiki.archlinux.org/api.php?action=feedcontributions&user=HackBug&feedformat=atomArchWiki - User contributions [en]2024-03-29T05:29:59ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=AMD_Catalyst&diff=227201AMD Catalyst2012-10-06T17:39:45Z<p>HackBug: Fixed broken link</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[es:ATI Catalyst]]<br />
[[fr:ATI#Catalyst]]<br />
[[it:ATI Catalyst]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of ATI's proprietary Linux "Catalyst" video card driver.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|ATI}}<br />
{{Article summary wiki|Intel}}<br />
{{Article summary wiki|NVIDIA}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|cchtml.com - Unofficial Wiki for the ATI Linux Driver|http://wiki.cchtml.com/index.php/Main_Page}}<br />
{{Article summary link|Unofficial ATI Linux Driver Bugzilla|http://ati.cchtml.com/query.cgi}}<br />
{{Article summary end}}<br />
<br />
Owners of '''ATI/AMD''' video cards have a choice between ATI's proprietary driver ({{AUR|catalyst}}) and the [[ATI|open source driver]] ({{Pkg|xf86-video-ati}}). This article covers the proprietary driver.<br />
<br />
ATI's Linux driver package ''fglrx'' ('''F'''ire'''GL''' and '''R'''adeon '''X''') is now known as ''Catalyst'' to fall in line with the naming scheme of the Windows driver. Only the package name has changed, while the kernel module retains its original ''fglrx.ko'' filename. Therefore, any mention of fglrx below is specifically in reference to the ''kernel module'', '''not the package'''.<br />
<br />
<strike>Catalyst was once a precompiled package offered by Arch in the [extra] repository, but as of March 2009, official Arch support [http://www.archlinux.org/news/ati-catalyst-support-dropped/ has been dropped] because of dissatisfaction with the quality and speed of development</strike>. In October 2012, it seems like the packages are being offered again. Currently, packages are available in the [community] repository, but it's unknown what will happen when an Xorg upgrade will break the driver. Also, a legacy driver for Radeon HD 2xxx 3xxx 4xxx is not available yet. For more information, see [http://bbs.archlinux.org/viewtopic.php?pid=1166052#p1166052/ this] this forum post and onwards.<br />
<br />
Compared to the open source driver, Catalyst performs worse in 2D graphics, but has a better support for 3D rendering. Supported devices are [http://en.wikipedia.org/wiki/Radeon ATI/AMD Radeon] video cards with chipset R600 and newer (as of Catalyst 9.4). See [http://en.wikipedia.org/wiki/Comparison_of_AMD_graphics_processing_units this table], or the Xorg [http://www.x.org/wiki/RadeonFeature#Decoder_ring_for_engineering_vs_marketing_names "Decoder ring",] to translate ''model'' names (X1900, HD4850) to/from ''chip'' names (R580, RV770 respectively).<br />
<br />
== Installation ==<br />
<br />
There are four ways of installing Catalyst on your system. One way is to use the official [community] repository, but this does not contain all the packages just yet. (At this time of writing, October 04, there's no xvba-video and lib32 driver yet. Also, a legacy driver is still missing). Another one is to use Vi0L0's (Arch's unofficial Catalyst maintainer) repository. This repository does contain all the necessary packages. The third method you can use is the AUR; PKGBUILDs offered here are also made by Vi0L0 and are the same he uses to built packages for his repository. Lastly, you can install the driver directly from AMD.<br />
<br />
Before choosing the method you prefer, you will have to see which driver you need. Since Catalyst 12.4, AMD has separated its development for Radeon HD 5xxx and Radeon HD 2xxx, 3xxx and 4xxx cards. For Radeon HD 2xxx, 3xxx and 4xxx cards, there's the '''legacy''' Catalyst driver, for Radeon HD 5xxx there is the regular Catalyst. Regardless of the driver you need, you will also need the Catalyst utilities.<br />
<br />
{{Note|After the instructions for every method of installing, you will find general instructions '''everyone''' has to perform, regardless of the method you used.}}<br />
<br />
=== Installing the driver ===<br />
==== Installing from the official repository ====<br />
This is the most simple and straightforward way, as it requires no unofficial repositories and because this package uses [[Dynamic Kernel Module Support|DKMS]] to automatically rebuilt the kernel modules when the kernel is upgraded. If this repository holds the packages you need, I suggest you take this one. To install Catalyst, you can use [[Pacman|pacman]]:<br />
<br />
# pacman -S catalyst-dkms catalyst-utils<br />
<br />
{{Note|If pacman asks you about removing '''libgl''' - you may safely say "Y"}}<br />
<br />
If you are on 64 bit and also need 32 bit OpenGL support, install lib32-catalyst-utils. Note that you will have to enable the [multilib] repository first.<br />
<br />
# pacman -S lib32-catalyst-utils<br />
<br />
Later on, a legacy driver will also be offered here.<br />
<br />
==== Installing from the unofficial repository ====<br />
If you need packages that currently aren't hosted by the official repository and don't fancy building the packages from the [[Arch User Repository|AUR]], this is the way to go. The repository is maintained by our unofficial Catalyst maintainer, Vi0L0. All packages are signed and I consider them safe to use. As you will see later on in this article, Vi0L0 is also responsible for many other packages that will help you get your system working with your ATI graphic cards. <br />
<br />
Vi0L0 has two different Catalyst repositories, each having different drivers:<br />
*[catalyst-hd234k]; for the legacy Catalyst driver needed by Radeon HD 2xxx, 3xxx and 4xxx cards.<br />
*[catalyst]; for the regular Catalyst driver needed by Radeon HD 5xxx and up.<br />
<br />
To enable one of these, you will have to edit {{ic|/etc/pacman.conf}} and add the repository of choice's information '''above all other repositories in {{ic|/etc/pacman.conf}}:<br />
<br />
# nano /etc/pacman.conf<br />
<br />
For [catalyst-hd234k], you have to add the following:<br />
<br />
[catalyst-hd234k]<br />
<nowiki>Server = http://catalyst.apocalypsus.net/repo/catalyst-hd234k/$arch</nowiki><br />
<br />
For [catalyst], it's this:<br />
<br />
[catalyst]<br />
<nowiki>Server = http://catalyst.apocalypsus.net/repo/catalyst/$arch</nowiki><br />
<br />
Once you have added this, update pacman's database and install the packages:<br />
<br />
# pacman -Syu<br />
# pacman -S catalyst catalyst-utils<br />
<br />
{{Note|If pacman asks you about removing '''libgl''' - you may safely say "Y"}}<br />
<br />
If you are on 64 bit and need 32 bit OpenGL support, install lib32-catalyst-utils. Note that you will have to enable the [multilib] repository first:<br />
<br />
# pacman -S lib32-catalyst-utils<br />
<br />
Both repositories also contain other packages, that can ''replace'' the Catalyst package and provide fglrx modules for ''multiple'' kernels that are installed on your system:<br />
<br />
* Catalyst-generator; this package is able to generate fglrx modules packed into pacman compliant packages - most secure and KISS-compatible package in this side-note, although it has to be operated manually.<br />
* Catalyst-hook; A hook for [[mkinitcpio|mkinitcpio]] which will automatically update fglrx modules with every kernel's update. '''This is basically the same as catalyst-dkms from [community]'''.<br />
* Catalyst-daemon; this delivers an automatic update of the fglrx module with every kernel update, done by an init script. '''This is the same as Catalyst-hook and also catalyst-dkms from [community]. Also, systemd users have no use for this package, as systemd has no init script support'''.<br />
<br />
You will find more details about those packages in [[#Tools| Tools section]].<br />
Lastly, both repositories also contain the '''xvba-video''' package, which enables video acceleration described [[#Video_acceleration]] and the '''AMDOverdriveCtrl''' package, which is a GUI to control over- and underclocking. See [[#GPU/Mem frequency, Temperature, Fan speed, Overclocking utilities]]<br />
<br />
==== Installing from the AUR ====<br />
The last way to install Catalyst is from the [[Arch User Repository|AUR]]. If you want to built the packages specifically for your computer, this is your way to go. Note that this is also the most tedious way to install Catalyst; it requires the most work and also requires manual updates upon every kernel update.<br />
<br />
{{Warning|If you install the Catalyst package from the AUR, you will have to rebuild Catalyst every time the kernel is updated. Otherwise X '''will''' fail to start.}}<br />
<br />
All packages mentioned above in Vi0L0's unofficial repository are also available on the [[Arch User Repository|AUR]]:<br />
* {{AUR|Catalyst}};<br />
* {{AUR|Catalyst-utils}};<br />
* {{AUR|Lib32-catalyst-utils}};<br />
* {{AUR|Catalyst-generator}};<br />
* {{AUR|Catalyst-hook}};<br />
* {{AUR|Catalyst-daemon}}.<br />
<br />
The AUR also holds some packages that are '''not''' found in any of the repositories. These packages contain the so-called ''Catalyst-total'' packages and the beta versions:<br />
* {{AUR|Catalyst-total-hd234k}};<br />
* {{AUR|Catalyst-total}};<br />
* {{AUR|Catalyst-test}};<br />
* {{AUR|Lib32-catalyst-test}};<br />
* {{AUR|Catalyst-total-pxp}};<br />
<br />
The ''Catalyst-total'' packages are made to make the lives of AUR users easier. It builds the driver, the kernel utilities and the 32 bit kernel utilities. It also builds the Catalyst-hook package, which is explained above.<br />
<br />
''Catalyst-total-pxp'' builds Catalyst with experimental powerXpress support.<br />
<br />
For more information on building from the AUR, read [[#Installing_from_AUR| Installing from AUR]].<br />
<br />
==== Installing directly from AMD ====<br />
{{Warning|Using the installer from ati.com/amd.com is '''not''' recommended! It may cause file conflicts and X failures and you will miss Arch-specific fixes. You '''must''' be familiar with booting to the command-line if you wish to attempt this.}}<br />
<br />
{{Note|If you have attempted a manual install from the official installer and cannot recover your desktop:<br />
# /usr/share/ati/fglrx-uninstall.sh<br />
}}<br />
<br />
1.) Download the installer from AMD or elsewhere (whereas *-* will be the version): {{ic|ati-driver-installer-*-*-x86.x86_64.run}}<br />
<br />
2.) Make sure it's executable: {{ic|# chmod +x ati-driver*}}<br />
<br />
3.) Ensure you're using a basic video driver like vesa and remove conflicting drivers (i.e. {{ic|xf86-video-ati}}) with pacman.<br />
<br />
4.) Symlink {{ic|/usr/src/linux}} to {{ic|<nowiki>/usr/src/{kernelsource}</nowiki>}}. 64-bit users also symlink{{ic|/usr/lib64}} to {{ic|/usr/lib}}.<br />
<br />
5.) Be sure to have your build environment setup: {{ic|# pacman -Syu base-devel linux-headers}}<br />
<br />
6.) Now run {{ic|# ./ati-driver-installer-*-*-x86.86_64.run}} (Files will extract to a temporary folder and scripts will run...)<br />
<br />
Assuming nothing went horribly wrong...<br />
<br />
7.) Check {{ic|/usr/share/ati/fglrx-install.log}} for issues. There should also be a {{ic|/lib/modules/fglrx/make.{ker_version}.log}}.<br />
<br />
{{Note|If you modify the make scripts, save to a different filename. Otherwise uninstall will not complete successfully.}}<br />
<br />
=== Configuring the driver ===<br />
After you have installed the driver via your chosen method, you will have to configure X to work with Catalyst. Also, you will have to make sure the module gets loaded at boot. Also, one should disable [[KMS|kernel mode setting]].<br />
<br />
==== Configuring X ====<br />
To configure X, you will have to create an xorg.conf file. Catalyst provides its own {{ic|aticonfig}} tool to create and/or modify this file.<br />
It also can configure virtually every aspect of the card for it also accesses the {{ic|/etc/ati/amdpcsdb}} file. For a complete list of {{ic|aticonfig}} options, run:<br />
<br />
# aticonfig --help | less<br />
<br />
{{Warning|Use the --output option before committing to /etc/X11 as an xorg.conf file will override anything in /etc/X11/xorg.conf.d}}<br />
<br />
{{Note|If you want to adhere to the new xorg.conf.d: Append your {{ic|aticonfig}} string with ''--output'' so that you can adapt the Device section to {{ic|/etc/X11/xorg.conf.d/20-radeon.conf}}. The drawback of this is that many {{ic|aticonfig}} options rely on an xorg.conf, and thus will be unavailable.}}<br />
<br />
Now, to configure Catalyst. If you have only one monitor, run this:<br />
<br />
# aticonfig --initial<br />
<br />
However, if you have two monitors and want to use both of them, you can run the command stated below. Note that this will generate a dual head configuration with the second screen located above the first screen.<br />
<br />
# aticonfig --initial=dual-head --screen-layout=above<br />
<br />
{{Note|See [[#Double Screen (Dual Head / Dual Screen / Xinerama)]] for more information on setting up dual monitors.}}<br />
<br />
You can compare the generated file to one of the [[Xorg#Sample_xorg.conf_Files|Sample Xorg.conf]] examples listed on the Xorg page.<br />
<br />
Although the current Xorg versions auto-detect most options when started, you may want to specify some in case the defaults change between versions.<br />
<br />
Here is an example (with notes) '''for reference'''. Entries with '#' should be required, add entries with '##' as needed:<br />
<br />
{{bc|1=<br />
Section "ServerLayout"<br />
Identifier "Arch"<br />
Screen 0 "Screen0" 0 0 # 0's are necessary.<br />
EndSection<br />
Section "Module"<br />
Load ...<br />
...<br />
EndSection<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
...<br />
EndSection<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "fglrx" # Essential.<br />
BusID "PCI:1:0:0" # Recommended if autodetect fails.<br />
Option "OpenGLOverlay" "0" ##<br />
Option "XAANoOffscreenPixmaps" "false" ##<br />
EndSection<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24 # Should not change from '24'<br />
Modes "1280x1024" "2048x1536" ## 1st value=default resolution, 2nd=maximum.<br />
Virtual 1664 1200 ## (x+64, y) to workaround potential OGL rect. artifacts/<br />
EndSubSection ## fixed in Catalyst 9.8<br />
EndSection<br />
Section "DRI"<br />
Mode 0666 # May help enable direct rendering.<br />
EndSection<br />
}}<br />
<br />
{{Note|With '''every''' Catalyst update you should remove '''amdpcsdb''' file in this way: kill X, remove {{ic|/etc/ati/amdpcsdb}}, start X and then run {{ic|amdcccle}} - otherwise the version of Catalyst may display wrongly in amdcccle.}}<br />
<br />
''If you need more information on Catalyst, visit [http://bbs.archlinux.org/viewtopic.php?id=57084 this thread].''<br />
<br />
==== Loading the module at boot ====<br />
How you should handle this depends on the init system you're using; either SysVinit or systemd. In either case, you have to blacklist ''radeon'' in {{ic|/etc/modprobe.d/modprobe.conf}}. For more information, see [[Modprobe|blacklisting in this article]]. '''Users of the [community] package do not have to do this, it's automatically done for them when installing the package'''.<br />
<br />
{{Note|The systemd method is recommended, as Arch is slowly switching over to this and the rc.conf method is actually deprecated.}}<br />
<br />
===== The systemd method =====<br />
* Disable the {{ic|radeon}} module from auto-loading. If it occurs in any file under {{ic|/etc/modules-load.d/}}, remove the file (or, if the file contains multiple modules, just remove the radeon one).<br />
* Either add {{ic|fglrx}} on a new line of an existing module file located under {{ic|/etc/modules-load.d/}}, or create a new file and add {{ic|fglrx}}.<br />
<br />
===== Arch initscripts =====<br />
Edit {{ic|/etc/rc.conf}} by:<br />
* Removing {{ic|radeon}} from the MODULES array.<br />
* Adding {{ic|fglrx}} to MODULES.<br />
<br />
{{Note|If you are using an AGP card instead of PCI Express add the ''agp'' module as well.}}<br />
<br />
==== Disable kernel mode setting ====<br />
<br />
Disabling kernel mode setting is important, as the driver doesn't take advantage of [[KMS]] yet. If you do not deactivate KMS, your system might freeze when trying to switch to a tty or even when shutting down via your DE.<br />
<br />
For [[GRUB Legacy|GRUB Legacy]], edit {{ic|menu.lst}} by adding {{ic|nomodeset}} to the kernel parameters. For example:<br />
<br />
kernel /boot/vmlinuz-linux root=/dev/sda1 ro '''nomodeset'''<br />
<br />
For [[GRUB2|GRUB 2]], edit {{ic|/etc/default/grub}} and add ''nomodeset'' to the kernel parameter options, e.g.<br />
<br />
GRUB_CMDLINE_LINUX="nomodeset"<br />
<br />
Then run, as root;<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
For [[Syslinux|Syslinux]], edit {{ic|/boot/syslinux/syslinux.cfg}} and add ''nomodeset'' to the {{ic|APPEND}} line, e.g.:<br />
<br />
APPEND root=/dev/sda2 ro ''nomodeset''<br />
<br />
==== Checking operation ====<br />
<br />
Assuming that a reboot to your login was successful, you can check if fglrx is running properly with the following commands:<br />
<br />
$ lsmod | grep fglrx<br />
$ fglrxinfo<br />
<br />
If you get output, it works. Finally, run X with {{ic|startx}} or by using GDM/KDM and verify that direct rendering is enabled by running the following command in a terminal:<br />
<br />
$ glxinfo | grep direct<br />
<br />
If it says "direct rendering: yes" then you're good to go! If the glxinfo command is not found, you might need to install the {{Pkg|mesa-demos}} package.<br />
<br />
{{Warning|In recent versions of Xorg, the paths of libs are changed. So, sometimes {{ic|libGL.so}} cannot be correctly loaded even if it's installed. Check this if your GL is not working. Please read "Troubleshooting" section for details.}}<br />
<br />
If you have trouble, see [[#Troubleshooting]].<br />
<br />
=== Custom Kernels ===<br />
<br />
To install catalyst for a custom kernel, you'll need to build your own {{ic|catalyst-$kernel}} package.<br />
<br />
If you are at all uncomfortable or inexperienced with making packages, read up the [[ABS]] wiki page first so things go smoothly.<br />
<br />
# Obtain the {{ic|PKGBUILD}} and {{ic|catalyst.install}} files from [[AUR|Catalyst]].<br />
# Editing the PKGBUILD. Two changes need to be made here:<br />
## Change {{ic|1=pkgname=catalyst}} to {{ic|1=pkgname=catalyst-$kernel_name}}, where $kernel_name is whatever you want (e.g. custom, mm, themostawesomekernelever).<br />
## Change the dependency of {{ic|linux}} to {{ic|$kernel_name}}.<br />
# Build your package and install; run {{ic|makepkg -i}} or {{ic|makepkg}} followed by {{ic|pacman -U pkgname.pkg.tar.gz}}<br />
<br />
{{Note|If you run multiple kernels, you have to install the Catalyst-utils packages for all kernels. They won't conflict with one another.}}<br />
<br />
{{Note|Catalyst-generator is able to build catalyst-{kernver} packages for you so you do not actually need to perform all those steps manually. For more information, see [[#Tools| Tools section]].}}<br />
<br />
== Xorg repositories ==<br />
Catalyst is notorious for its slow update process. As such, it is common that a new Xorg version is pushed down from upstream that will break compatibility for Catalyst. This means that Catalyst users either have to hold the Xorg packages from updating, or use a backported repository that only contains the Xorg packages that should be hold back. Vi0L0 has stepped in to fulfil this task and provides several backported repositories. <br />
<br />
If you want to use pacman to hold back packages from updating, see [[pacman|skip package from being upgraded]]. Packages you should hold back, are:<br />
*xorg-server-*<br />
*xorg-input-*<br />
*xorg-video-*<br />
<br />
If you want to use the backported repositories, you have to edit {{ic|/etc/pacman.conf}} and add the information of the repository '''above all other repositories''', even above your Catalyst repository, should you use one.<br />
<br />
===[xorg112]===<br />
The current version of Catalyst doesn't support xorg-server 1.13 at the moment.<br />
<br />
[xorg112]<br />
<nowiki>Server = http://catalyst.apocalypsus.net/repo/xorg112/$arch</nowiki><br />
<br />
===[xorg111]===<br />
Catalyst < 12.6 doesn't support xorg-server 1.12.<br />
<br />
[xorg111]<br />
<nowiki>Server = http://catalyst.apocalypsus.net/repo/xorg111/$arch</nowiki><br />
<br />
===[xorg110]===<br />
Catalyst < 11.11 doesn't support xorg-server 1.11.<br />
<br />
[xorg110]<br />
<nowiki>Server = http://catalyst.apocalypsus.net/repo/xorg110/$arch</nowiki><br />
<br />
===[xorg19]===<br />
<br />
Catalyst <= 11.3 doesn't support xorg-server >= 1.10.<br />
<br />
[xorg19]<br />
<nowiki>Server = http://catalyst.apocalypsus.net/repo/xorg19/$arch</nowiki><br />
<br />
===[xorg18]===<br />
<br />
Catalyst < 10.10 doesn't support xorg-server >= 1.9<br />
<br />
[xorg18]<br />
<nowiki>Server = http://catalyst.apocalypsus.net/repo/xorg18/$arch</nowiki><br />
<br />
== Tools ==<br />
<br />
=== Catalyst-hook ===<br />
[https://aur.archlinux.org/packages.php?ID=40834 Catalyst-hook] is a hook for [[mkinitcpio|mkinitcpio]] that will automatically update fglrx modules with every kernel update. '''This is basically the same as catalyst-dkms from [community].''' Before updating the fglrx modules, it will first try to update the {{Pkg|linux-headers}}.<br />
<br />
The hook will call the ''catalyst_build_module'' command to update fglrx module for the version of your new kernel. Additionally, it can call the ''catalyst_build_module remove'' command to remove the now old and unneeded flgrx module(s).<br />
<br />
{{Note|If you are using this functionality it's '''important''' to look at the installation process of the linux kernel (or any other kernel) package. Catalyst-hook will tell you is everything all right.}}<br />
<br />
{{Note|If your '''custom kernel''' is using some '''non-standard mkinitcpio configuration file''' (ie. linux-zen is using /etc/mkinitcpio-zen.conf) you'll have to manually add '''fglrx''' to HOOKS array in your non-standard configuration file so it can be auto-recompiled with a kernel update.}}<br />
<br />
{{Note|If you '''aren't using the stock linux kernel''' at all and still want to use auto-recompilation, you should remove linux-headers from the {{ic|SyncFirst}} list of {{ic|/etc/pacman.conf}} after running 'catalyst_build_module auto'.}}<br />
<br />
=== Catalyst-generator ===<br />
<br />
[https://aur.archlinux.org/packages.php?ID=34773 Catalyst-generator] is a package that is able to build and install the fglrx module packed into pacman compliant catalyst-${kernver} packages. The difference from Catalyst-hook is that you will have to trigger this command manually, whereas Catalyst-hook will do this automatically at boot when a new kernel got installed.<br />
<br />
It creates catalyst-${kernver} packages using [[makepkg]] and installs them with [[pacman]]. ''${kernver}'' is the kernel version for which each package was built (e.g. catalyst-2.6.35-ARCH package was built for 2.6.35-ARCH kernel).<br />
<br />
To build and install catalyst-${kernver} package for a currently booted kernel as an unprivileged user (non-root; safer way), use {{ic|catalyst_build_module}}. You will be asked for your root password to proceed to package installation.<br />
<br />
A short summary on how to use this package:<br />
<br />
# As root: {{ic|catalyst_build_module remove}}. This will remove all unused {{ic|catalyst-{kernver} }} packages.<br />
# As unprivileged user: {{ic|catalyst_build_module ${kernver}}}, where ${kernver} is the version of the kernel to which you just updated. For example: {{ic|catalyst_build_module 2.6.36-ARCH}}. You can also build catalyst-${kernver} for all installed kernels by using {{ic|catalyst_build_module all}}.<br />
# If you want to remove {{ic|catalyst-generator}}, it's best to run this as root before removing catalyst-generator: {{ic|catalyst_build_module remove_all}}. '''This will remove all catalyst-{kernver} packages from the system.'''<br />
<br />
Catalyst-generator isn't able to remove all those catalyst-{kernver} packages automatically while being removed because there can not be more than one instance of pacman running. If you forget to run {{ic|catalyst_build_module remove_all}} before using {{ic|pacman -R catalyst-generator}} catalyst-generator will tell you which catalyst-{kernver} packages you will have to remove manually after removing catalyst-generator itself.<br />
<br />
{{Note|If you see those warnings:<br />
<br />
'''WARNING:''' Package contains reference to $srcdir<br />
<br />
'''WARNING:''' '.pkg' is not a valid archive extension.<br />
<br />
while building catalyst-{kernver} package, do not be concerned, it's normal.}}<br />
<br />
=== Catalyst-daemon ===<br />
{{Warning| systemd users have no use for this, as systemd is not compatible with regular initscript daemons.}}<br />
<br />
[https://aur.archlinux.org/packages.php?ID=40832 Catalyst-daemon] is, as its name suggests, a daemon that will run upon every boot to check if the kernel was updated. If it was, it will rebuild the fglrx module - if it wasn't, it will load the previously built fglrx module. This whole operation takes only 20ms on a 2.4 GHz CPU.<br />
<br />
The automatic re-compilation functionality of Catalyst-daemon is done by an init script called ''autofglrx''. Autofglrx's check function is comparing the built time of the just booted kernel (provided by {{ic|uname -v}}) with the built time of a kernel for which the previously used fglrx module was built. It is able to do such a comparison because it adds {{ic|uname -v}} information to the fglrx module description whilst compiling it. <br />
<br />
Whilst rebuilding, autofglrx will call the ''catalyst_build_module'' to build a module and ''catalyst_build_module remove'' to remove the old, unneeded fglrx module. It doesn't remain in the system's memory after being run.<br />
<br />
{{Note|After installing autofglrx, you have to add {{ic|autofglrx}} to the beginning of the {{ic|DAEMONS}} array {{ic|/etc/rc.conf}}. Be sure to place it before your DM (if you run that from here) and do '''not''' run it in the background (e.g. do not at a @ symbol in front of it).}}<br />
<br />
{{Note|If you are using '''your own compilation flags''' and get problems with the daemon - please add those flags into /usr/bin/catalyst_build_module file.}}<br />
<br />
== Features ==<br />
<br />
=== Tear Free Rendering ===<br />
<br />
Presented in '''Catalyst 11.1''', the ''Tear Free Desktop'' feature reduces tearing in 2D, 3D and video applications. This likely adds triple-buffering and v-sync. Do note that it requires additional GPU processing.<br />
<br />
To enable 'Tear Free Desktop' run {{ic|amdcccle}} and go to: {{ic|Display Options}} → {{ic|Tear Free}}.<br />
<br />
Or as root run:<br />
<br />
# aticonfig --set-pcs-u32=DDX,EnableTearFreeDesktop,1<br />
<br />
To disable, again use {{ic|amdcccle}} or run as root:<br />
<br />
# aticonfig --del-pcs-key=DDX,EnableTearFreeDesktop<br />
<br />
=== Video acceleration ===<br />
<br />
'''[http://en.wikipedia.org/wiki/Video_Acceleration_API Video Acceleration API] (VA API)''' is an open source software library (libVA) and API specification which provides GPU acceleration for video processing on Linux/UNIX based operating systems. The process works by enabling hardware accelerated video decode at various entry-points (VLD, IDCT, Motion Compensation, deblocking) for common encoding standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/WMV3).<br />
<br />
VA-API gained a proprietary backend (in November 2009) called {{AUR|xvba-video}}, that allows VA-API programmed applications to take advantage of AMD Radeons UVD2 chipsets via the [http://en.wikipedia.org/wiki/XvBA XvBA (X-Video Bitstream Acceleration API designed by AMD)] library.<br />
<br />
XvBA support and xvba-video is still under development, however it is '''working very well in most cases'''. Build the {{AUR|xvba-video}} package from AUR or soon, install it from [community] and install {{Pkg|mplayer-vaapi}} and {{Pkg|libva}}. Then just set your video player to use vaapi:gl as video output:<br />
<br />
$ mplayer -vo vaapi:gl movie.avi<br />
<br />
These options can be added to your mplayer configuration file, see [[MPlayer]].<br />
<br />
For '''smplayer''':<br />
<br />
Options → Preferences → General → Video (tab) → Output driver: User Defined : vaapi:gl<br />
Options → Preferences → General → Video (tab) → Double buffering '''on'''<br />
Options → Preferences → Advanced → Options for MPlayer → Options: -vo vaapi<br />
Options → Preferences → General → General → Screenshots → Turn screenshots '''off'''<br />
Options → Preferences → Performance → Threads for decoding (Set your CPU(s) '''number''')<br />
<br />
{{Note|If Tear Free Desktop is enabled it's better to use:<br />
Options -> Preferences -> General -> Video (tab) -> Output driver: vaapi<br />
If Video Output '''vaapi:gl''' isn't working - please check:<br />
'''vaapi''', '''vaapi:gl2''' or simply '''xv(0 - AMD Radeon [https://en.wikipedia.org/wiki/Avivo AVIVO Video])'''.<br />
}}<br />
<br />
For '''VLC''':<br />
<br />
Tools → Preferences → Input & Codecs → Use GPU acceleration<br />
<br />
It might help to enable v-sync in '''amdcccle''':<br />
<br />
3D → More Settings → Wait for vertical refresh = Always On<br />
<br />
{{Note|If you are using '''Compiz/KWin''', the only way to '''avoid video flickering''' is to watch videos in '''full-screen''' and only when '''Unredirect Fullscreen is off'''.<br />
<br />
In '''compiz''' you need to set '''Redirected Direct Rendering''' in General Options of ccsm. If it is still flickering, try to disable this option in CCSM. It's off by default in '''KWin''', but if you see flickering try to turn "Suspend desktop effects for fullscreen windows" on or off in System Settings → Desktop Effects → Advanced.}}<br />
<br />
=== GPU/Mem frequency, Temperature, Fan speed, Overclocking utilities ===<br />
<br />
You can get the GPU/Mem clocks with: {{ic|$ aticonfig --od-getclocks}}.<br />
<br />
You can get the fan speed with: {{ic|$ aticonfig --pplib-cmd "get fanspeed 0"}}<br />
<br />
You can get the temperature with: {{ic|$ aticonfig --odgt}}<br />
<br />
To set the fanspeed with: {{ic|$ aticonfig --pplib-cmd "set fanspeed 0 50"}} Query Index: 50, Speed in percent<br />
<br />
To overclock and/or underclock it's easier to use a GUI, like '''ATi Overclocking Utility''', which is very simple and requires qt to work.<br />
<br />
The i686 version is available [http://kde-apps.org/content/show.php/ATI+Overclocking+Utility+X32?content=107458 here], while the x86_64 is available [http://kde-apps.org/content/show.php/ATI+Overclocking+Utility+X64?content=107457 here]. Just download it and run.<br />
<br />
An other, more complex utility to perform such operations is '''AMDOverdriveCtrl'''. Its homepage is [http://sourceforge.net/projects/amdovdrvctrl here] and you can build an Arch package from [https://aur.archlinux.org/packages.php?ID=45298 AUR] or from Vi0L0's unofficial repositories.<br />
<br />
=== Double Screen (Dual Head / Dual Screen / Xinerama) ===<br />
<br />
==== Introduction ====<br />
<br />
{{Warning| you should know that there isn't one specific solution because each setup differs and needs its own configuration. That's why you will have to adapt the steps below to your own needs. It is possible that you have to try more than once. '''Therefore, you should save your working {{ic|/etc/X11/xorg.conf}} before you start modifying and you must be able to recover from a command-line environment.'''}}<br />
<br />
* In this chapter, we will describe the installation of two different-sized screens on only one graphics card with two different output ports (DVI + HDMI) using a "BIG Desktop" configuration.<br />
<br />
* The Xinerama solution has some inconveniences, especially because it is not compatible with XrandR. For that very reason, you should not use this solution, because XrandR is a must for our later configuration.<br />
<br />
* The Dual Head solution would allow you to have 2 different sessions (one for each screen). It could be what you want, but you will not be able to move windows from one screen to another. If you have only one screen, you will have to define the mouse inside your Xorg session for each of the two sessions inside the Server Layout section.<br />
<br />
[http://support.amd.com/us/kbarticles/Pages/1105-HowCanIConfigureMultip.aspx ATI Documentation]<br />
<br />
==== ATI Catalyst Control Center ====<br />
<br />
The GUI tool shipped by ATI is very useful and we will try to use it as much as we can. To launch it, open a terminal and use the following command:<br />
<br />
$ {kdesu/gksu} amdcccle<br />
<br />
{{Warning|Do '''not''' use sudo directly with a GUI. Sudo gives you admin rights with user account information. Instead, use ''gksu'' (GNOME) or ''kdesu'' (KDE).}}<br />
<br />
==== Installation ====<br />
<br />
Before we start, make sure that your hardware is plugged in correctly, that power is on and that you know your hardware characteristics (screen dimensions, sizes, refreshment rates, etc.) Normally, both screens are recognized during boot time but not necessarily identified properly, especially if you are not using any Xorg base configuration file ({{ic|/etc/X11/xorg.conf}}) but relying on the hot-plugging feature.<br />
<br />
The first step is to make sure that you screens will be recognized by your DE and by X. For this, you need to generate a basic Xorg configuration file for your two screens:<br />
<br />
# aticonfig --initial --desktop-setup=horizontal --overlay-on=1<br />
<br />
or<br />
<br />
# aticonfig --initial=dual-head --screen-layout=left<br />
<br />
{{Note|{{ic|overlay}} is important because it allows you to have 1 pixel (or more) shared between the 2 screens.}}<br />
{{Tip|For the other possible and available options, do not hesitate to type {{ic|aticonfig --help}} inside a terminal to display all available command lines.}}<br />
<br />
Now you should have a basic Xorg configuration file that you can edit to add your screen resolutions. It is important to use the precise resolution, especially if you have screens of different sizes. These resolutions have to be added in the "Screen" section:<br />
<br />
SubSection "Display"<br />
Depth 24<br />
Modes "X-resolution screen 1xY-resolution screen 1" "Xresolution screen 2xY-resolution screen 2"<br />
EndSubSection<br />
<br />
From now on, instead of editing the {{ic|xorg.conf}} file manually, let us use the ATI GUI tool. Restart X to be sure that your two screens are properly supported and that the resolutions are properly recognized (Screens must be independent, not mirrored).<br />
<br />
==== Configuration ====<br />
<br />
Now you will only have to launch the ATI control center with root privileges, go to the display menu and choose how you would like to set your configuration (small arrow of the drop down menu). A last restart of X and you should be done!<br />
<br />
Before you restart X, do not hesitate to verify your new {{ic|xorg.conf}} file. At this stage, inside the "Display" sub-section of the "Screen" section, you should see a "Virtual" command line, of which the resolution should be the sum of both screens. The "Server Layout" section says all the rest.<br />
<br />
== Troubleshooting ==<br />
<br />
If you can still boot to command-line, then the problem probably lies in {{ic|/etc/X11/xorg.conf}}<br />
<br />
You can parse the whole {{ic|/var/log/Xorg.0.log}} or, for clues:<br />
<br />
$ grep '(EE)' /var/log/Xorg.0.log<br />
$ grep '(WW)' /var/log/Xorg.0.log<br />
<br />
If you are at lost of what to do, you can always post a message in the see [http://www.bbs.archlinux.org/viewtopic.php?pid=1166052#p1166052/ support thread on the forums]. When you do so, please do provide the information you get from both commands mentioned above.<br />
<br />
=== Problems with video colours ===<br />
<br />
You may still use {{ic|vaapi:gl}} to avoid video flickering, but without video acceleration:<br />
<br />
* Run '''mplayer''' without {{ic|-vo vaapi}} switch.<br />
<br />
* Run '''smplayer''' remove {{ic|-vo vaapi}} from Options → Preferences → Advanced → Options for MPlayer → Options: -vo vaapi<br />
<br />
Plus for '''smplayer''' you may now safely turn screenshots on.<br />
<br />
=== KWin and composite ===<br />
<br />
You may use XRender if the rendering with OpenGL is slow. However, XRender might also be slower than OpenGL depending on your card.<br />
XRender also solves artifact issues in some cases.<br />
<br />
=== Black screen with complete lockups and/or hangs after reboot or startx ===<br />
<br />
Ensure you have added the '''nomodeset''' option to the kernel options line in your bootloader (see [[#Disable kernel mode setting]]).<br />
<br />
==== Faulty ACPI hardware calls ====<br />
It is possible that fglrx doesn't cooperate well with the system's ACPI hardware calls, so it auto-disables itself and there is no screen output.<br />
<br />
If so, try to run this:<br />
<br />
$ aticonfig --acpi-services=off<br />
<br />
=== KDM disappears after logout ===<br />
<br />
If you are running Catalyst proprietary driver and you get a console (tty1) instead of the expected KDM greeting when you log out, you must instruct KDM to restart the X server after each logout:<br />
<br />
$ sudo nano /usr/share/config/kdm/kdmrc<br />
<br />
Uncomment the following line under the section titled {{ic|[X-:*-Core]}}:<br />
<br />
TerminateServer=True<br />
<br />
KDM should now appear when you log out of KDE.<br />
<br />
=== Direct Rendering does not work ===<br />
<br />
This problem may occur when using the proprietary '''Catalyst''' driver.<br />
<br />
{{Warning|This error would also appear if you have not '''rebooted''' your system after the installation or upgrade of catalyst. The system needs to load the fglrx.ko module in order to make the driver work.}}<br />
<br />
If you have problem with direct rendering, run:<br />
<br />
$ LIBGL_DEBUG=verbose glxinfo > /dev/null<br />
<br />
at the command prompt. At the very start of the output, it'll usually give you a nice error message saying why you do not have direct rendering.<br />
<br />
Common errors and their solutions, are:<br />
<br />
libGL error: XF86DRIQueryDirectRenderingCapable returned false<br />
<br />
* Ensure that you are loading the correct agp modules for your AGP chipset before you load the fglrx kernel module. To determine which agp modules you'll need, run {{ic|hwdetect --show-agp}}, then ensure that all modules listed from that command are in the {{ic|1=MODULES=}} array in rc.conf, '''before''' fglrx if using SysVinit, otherwise open your {{ic|fglrx.conf}} file in {{ic|/etc/modules-load.d}} and add the agp module on a line '''before''' the fglrx line.<br />
<br />
libGL error: failed to open DRM: Operation not permitted<br />
libGL error: reverting to (slow) indirect rendering<br />
<br />
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri//fglrx_dri.so<br />
libGL error: dlopen /usr/lib/xorg/modules/dri//fglrx_dri.so failed<br />
(/usr/lib/xorg/modules/dri//fglrx_dri.so: cannot open shared object file: No such file or directory)<br />
libGL error: unable to find driver: fglrx_dri.so<br />
<br />
* Something has not been installed correctly. If the paths in the error message are {{ic|/usr/X11R6/lib/modules/dri/fglrx_dri.so}}, then ensure you've logged completely out of your system, then back in. If you're using a graphical login manager (gdm, kdm, xdm), ensure that {{ic|/etc/profile}} is sourced every time you log in. This is usually accomplished by adding {{ic|source /etc/profile}} into {{ic|~/.xsession}} or {{ic|~/.xinitrc}}, but this may vary between login managers.<br />
<br />
* If the paths above in your error message ''are'' {{ic|/usr/lib/xorg/modules/dri/fglrx_dri.so}}, then something has not been correctly installed. Try reinstalling the {{ic|catalyst}} package.<br />
<br />
Errors such as:<br />
<br />
fglrx: libGL version undetermined - OpenGL module is using glapi fallback<br />
<br />
could be caused by having multiple versions of {{ic|libGL.so}} on your system. Run:<br />
<br />
$ sudo updatedb<br />
$ locate libGL.so<br />
<br />
This should return the following output:<br />
<br />
$ locate libGL.so<br />
/usr/lib/libGL.so<br />
/usr/lib/libGL.so.1<br />
/usr/lib/libGL.so.1.2<br />
<br />
These are the only three libGL.so files you should have on your system. If you have any more (e.g. {{ic|/usr/X11R6/lib/libGL.so.1.2}}), then remove them. This should fix your problem.<br />
<br />
You might not get any error to indicate that this is a problem. If you are using X11R7, make sure you do '''not''' have these files on your system:<br />
<br />
/usr/X11R6/lib/libGL.so.1.2<br />
/usr/X11R6/lib/libGL.so.1<br />
<br />
=== Hibernate/Sleep Issues ===<br />
<br />
==== Video fails to resume from suspend2ram ====<br />
<br />
ATI's proprietary Catalyst driver cannot resume from suspend if the framebuffer is enabled. To disable the framebuffer, add '''vga=0''' to your kernel options in for example, Grub Legacy's {{ic|/boot/grub/menu.lst}}:<br />
<br />
kernel /vmlinuz-linux root=/dev/sda3 resume=/dev/sda2 ro quiet '''vga=0'''<br />
<br />
To see where you need to add this with other bootloaders, see [[#Disable kernel mode setting]].<br />
<br />
=== System Freezes/Hard locks ===<br />
<br />
* The {{ic|radeonfb}} framebuffer drivers have been known in the past to cause problems of this nature. If your kernel has radeonfb support compiled in, you may want to try a different kernel and see if this helps.<br />
<br />
* If you experience system freezes when exiting your DE (shut down, suspend, switching to tty etc.) you probably forgot to deactivate KMS. (See [[#Disable kernel mode setting]])<br />
<br />
=== Hardware Conflicts ===<br />
<br />
Radeon cards used in conjunction with some versions of the nForce3 chipset (e.g. nForce 3 250Gb) won't have 3D acceleration. Currently the cause of this issue is unknown, but some sources indicate that it may be possible to get acceleration with this combination of hardware by booting Windows with the drivers from nVIDIA and then rebooting the system. This can be verified by issuing in a root console the following command:<br />
<br />
$ dmesg | grep agp<br />
<br />
If you get something similar to this (using an nForce3-based system):<br />
<br />
agpgart: Detected AGP bridge 0<br />
agpgart: Setting up Nforce3 AGP.<br />
agpgart: aperture base > 4G<br />
<br />
and also if issuing this command...<br />
<br />
$ tail -n 100 /var/log/Xorg.0.log | grep agp<br />
<br />
...gets something similar to:<br />
<br />
(EE) fglrx(0): [agp] unable to acquire AGP, error "xf86_ENODEV"<br />
<br />
Then you have this bug.<br />
<br />
Some sources indicate that in some situations, downgrading the motherboard BIOS may help, but this cannot be verified in all cases. Also, '''a bad BIOS downgrade can render your hardware useless, so beware.'''<br />
<br />
See [http://bugzilla.kernel.org/show_bug.cgi?id=6350/ this bugreport] for more information and a potential fix.<br />
<br />
=== Temporary hangs when playing video ===<br />
<br />
This problem may occur when using the proprietary Catalyst.<br />
<br />
If you experience temporary hangs lasting from a few seconds to several minutes occuring randomly during playback with mplayer, check /var/log/messages.log for output like:<br />
<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<f8bc628c>] ? ip_firegl_ioctl+0x1c/0x30 [fglrx]<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<c0197038>] ? vfs_ioctl+0x78/0x90<br />
Nov 28 18:31:56 pandemonium [<c01970b7>] ? do_vfs_ioctl+0x67/0x2f0<br />
Nov 28 18:31:56 pandemonium [<c01973a6>] ? sys_ioctl+0x66/0x70<br />
Nov 28 18:31:56 pandemonium [<c0103ef3>] ? sysenter_do_call+0x12/0x33<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium =======================<br />
<br />
Adding the nopat kernel option to your kernel options in your bootloader and rebooting fixed the problem at least for me. To see how to do this for different bootloaders, see [[#Disable kernel mode setting]].<br />
<br />
=== "aticonfig: No supported adaptaters detected" ===<br />
<br />
If when running<br />
<br />
# sudo aticonfig --initial<br />
<br />
you get:<br />
<br />
aticonfig: No supported adaptaters detected<br />
<br />
But you do have an AMD GPU (or APU), it may still be possible to get Catalyst working by manually setting the device in your your {{ic|etc/X11/xorg.conf}} file.<br />
<br />
You can do so by setting the device section of {{ic|/etc/X11/xorg.conf}} to:<br />
<br />
Section "Device"<br />
Identifier "ATI radeon '''****'''"<br />
Driver "fglrx"<br />
EndSection<br />
<br />
Where ''****'' should be replaced with your device's marketing number (e.g. 6870 for the HD 6870 and 6310 for the E-350 APU).<br />
<br />
Xorg will start and it is possible to use {{ic|amdcccle}} instead of {{ic|aticonfig}}. There will be an "AMD Unsupported hardware" watermark.<br />
<br />
You can remove this watermark using the following script:<br />
<br />
#!/bin/sh<br />
DRIVER=/usr/lib/xorg/modules/drivers/fglrx_drv.so<br />
for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do<br />
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER<br />
done<br />
<br />
and rebooting.<br />
<br />
=== WebGL support in Chromium ===<br />
<br />
Google has blacklisted Linux's Catalyst driver from supporting webGL in their Chromium/Chrome browsers.<br />
<br />
You can turn webGL on by editing {{ic|/usr/share/applications/chromium.desktop}} file and adding {{ic|--ignore-gpu-blacklist}} flag into the '''Exec''' line so it looks like this:<br />
<br />
Exec=chromium %U --ignore-gpu-blacklist<br />
<br />
You can also run chromium from console with the same {{ic|--ignore-gpu-blacklist}} flag:<br />
<br />
$ chromium --ignore-gpu-blacklist<br />
<br />
{{Warning|Catalyst does not support the GL_ARB_robustness extension, so it is possible that a malicious site could use WebGL to perform a DoS attack on your graphic card. For more info, read [http://www.h-online.com/security/news/item/WebGL-as-a-security-problem-1240567.html/ this].}}<br />
<br />
=== Laggs/freezes when watching flash videos via Adobe's flashplugin ===<br />
<br />
Edit {{ic|/etc/adobe/mms.cfg}} and make it look like this:<br />
<br />
#EnableLinuxHWVideoDecode=1<br />
OverrideGPUValidation=true<br />
<br />
=== Laggs/slow windows movement in GNOME3 ===<br />
<br />
You can try this solution out, it's working for many people.<br />
<br />
Add this line into {{ic|~/.profile}} or into {{ic|/etc/profile}}:<br />
<br />
export CLUTTER_VBLANK=none<br />
<br />
Restart X server or reboot your system.<br />
<br />
=== Not using fullscreen in the 1920x1080 resolution ===<br />
<br />
The ATI has scaling by default add this to your xorg.conf<br />
<br />
Option "DPMS" "true"<br />
<br />
On the Monitor section, as full example would look like this<br />
<br />
Section "Monitor"<br />
Identifier "0-DFP5"<br />
Option "VendorName" "ATI Proprietary Driver"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
Option "DPMS" "true"<br />
Option "PreferredMode" "1920x1080"<br />
Option "TargetRefresh" "60"<br />
Option "Position" "0 0"<br />
Option "Rotate" "normal"<br />
Option "Disable" "false"<br />
EndSection</div>HackBughttps://wiki.archlinux.org/index.php?title=RTorrent&diff=213351RTorrent2012-07-17T10:23:10Z<p>HackBug: /* Manage completed files */</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[[es:RTorrent]]<br />
[[ru:RTorrent]]<br />
[[zh-CN:RTorrent]]<br />
{{DISPLAYTITLE:rTorrent}}<br />
[http://libtorrent.rakshasa.no/ rTorrent] is a quick and efficient BitTorrent client that uses the libtorrent library. It is written in C++ and uses the [[Wikipedia:ncurses|ncurses]] programming library, which means it uses a text user interface. When combined with [[GNU Screen]] and [[Secure Shell]], it becomes a convenient remote [[Wikipedia:BitTorrent (protocol)#Operation|BitTorrent client]].<br />
<br />
== Installation ==<br />
[[pacman|Install]] the {{Pkg|rtorrent}} package that is available in the [[Official Repositories|official repositories]].<br />
<br />
Alternatively, install {{AUR|rtorrent-svn}} or {{AUR|rtorrent-extended}} from the [[Arch User Repository|AUR]].<br />
<br />
== Configuration ==<br />
{{note|See the rTorrent wiki article on this subject for more information: [http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks Common Tasks in rTorrent for Dummies]}}<br />
<br />
Before running rTorrent, find the example configuration file {{ic|/usr/share/doc/rtorrent/rtorrent.rc}} and copy it to {{ic|~/.rtorrent.rc}}:<br />
<br />
$ cp /usr/share/doc/rtorrent/rtorrent.rc ~/.rtorrent.rc<br />
<br />
=== Performance ===<br />
{{note|See the rTorrent wiki article on this subject for more information: [http://libtorrent.rakshasa.no/wiki/RTorrentPerformanceTuning Performance Tuning]}}<br />
<br />
The values for the following options are dependent on the system's hardware and Internet connection speed. To find the optimal values read: [http://torrentfreak.com/optimize-your-BitTorrent-download-speed Optimize Your BitTorrent Download Speed]<br />
{{bc|<nowiki><br />
min_peers = 40<br />
max_peers = 52<br />
<br />
min_peers_seed = 10<br />
max_peers_seed = 52<br />
<br />
max_uploads = 8<br />
<br />
download_rate = 200<br />
upload_rate = 28<br />
</nowiki>}}<br />
<br />
The {{ic|check_hash}} option executes a hash check when a torrent download is complete or rTorrent is started. When starting, it checks for errors in your completed files. <br />
check_hash = yes<br />
<br />
=== Create and manage files ===<br />
The {{ic|directory}} option will determine where your torrent data will be saved. Be sure to enter the absolute path, as rTorrent may not follow relative paths:<br />
directory = /home/[user]/torrents/<br />
<br />
The {{ic|session}} option allows rTorrent to save the progess of your torrents. It is recommended to create a directory called {{ic|.session}} (e.g. {{ic|$ mkdir ~/.session}}).<br />
session = /home/[user]/.session/<br />
<br />
The {{ic|schedule}} option has rTorrent watch a particular directory for new torrent files. Saving a torrent file to this directory will automatically start the download. Remember to create the directory that will be watched (e.g. {{ic|$ mkdir ~/watch}}). Also, be careful when using this option as rTorrent will move the torrent file to your session folder and rename it to its hash value.<br />
schedule = watch_directory,5,5,load_start=/home/[user]/watch/*.torrent<br />
schedule = untied_directory,5,5,stop_untied=<br />
schedule = tied_directory,5,5,start_tied=<br />
<br />
The following {{ic|schedule}} option is intended to stop rTorrent from downloading data when disk space is low.<br />
schedule = low_diskspace,5,60,close_low_diskspace=100M<br />
<br />
=== Port configuration ===<br />
The {{ic|port_range}} option sets which port(s) to use for listening. It is recommended to use a port that is higher than 49152 (see: [[Wikipedia:List of TCP and UDP port numbers|List of port numbers]]). Although, rTorrent allows a range of ports, a single port is recommended.<br />
port_range = 49164-49164<br />
<br />
Additionally, make sure port forwarding is enabled for the proper port(s) (see: [http://portforward.com/english/routers/port_forwarding/routerindex.htm Port Forward Guides]).<br />
<br />
=== Additional settings ===<br />
The {{ic|encryption}} option enables or disables encryption. It is very important to enable this option, not only for yourself, but also for your peers in the torrent swarm. Some users need to obscure their bandwidth usage from their ISP. And it does not hurt to enable it even if you do not need the added security.<br />
encryption = allow_incoming,try_outgoing,enable_retry<br />
{{Wikipedia|BitTorrent Protocol Encryption}}<br />
<br />
This final {{ic|dht}} option enables [[Wikipedia:Distributed hash table|DHT]] support. DHT is common among public trackers and will allow the client to acquire more peers.<br />
{{bc|<nowiki><br />
dht = auto<br />
dht_port = 6881<br />
peer_exchange = yes<br />
</nowiki>}}<br />
<br />
{{note|See the rTorrent wiki article on this subject for more information: [http://libtorrent.rakshasa.no/wiki/RTorrentUsingDHT Using DHT]}}<br />
<br />
== Key bindings ==<br />
<br />
rTorrent relies exclusively on keyboard shortcuts for user input. A quick reference is available in the table below. A complete guide is available on the rTorrent wiki (see: [http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide rTorrent User Guide]).<br />
<br />
{{note|Striking {{keypress|Ctrl-q}} twice in quick succession will make rTorrent shutdown without waiting to send a stop announce to the connected trackers.}}<br />
<br />
{| class="toccolours" border="1" cellpadding="4" cellspacing="0" style="margin:5px;"<br />
|-<br />
!width="75" |Cmd<br />
!Action<br />
|-<br />
|Ctrl-q<br />
|Quit application<br />
|-<br />
|Ctrl-s<br />
|Start download. Runs hash first unless already done.<br />
|-<br />
|Ctrl-d<br />
|Stop an active download or remove a stopped download<br />
|-<br />
|Ctrl-k<br />
|Stop and close the files of an active download.<br />
|-<br />
|Ctrl-r<br />
|Initiate hash check of torrent. Without starting to download/upload.<br />
|-<br />
|Left<br />
|Returns to the previous screen<br />
|-<br />
|Right<br />
|Goes to the next screen<br />
|-<br />
|Backspace/Return<br />
|Adds the specified *.torrent<br />
|-<br />
|<nowiki>a|s|d</nowiki><br />
|<nowiki>Increase global upload throttle about 1|5|50 KB/s</nowiki><br />
|-<br />
|<nowiki>A|S|D</nowiki><br />
|<nowiki>Increase global download throttle about 1|5|50 KB/s</nowiki><br />
|-<br />
|<nowiki>z|x|c</nowiki><br />
|<nowiki>Decrease global upload throttle about 1|5|50 KB/s</nowiki><br />
|-<br />
|<nowiki>Z|X|C</nowiki><br />
|<nowiki>Decrease global download throttle about 1|5|50 KB/s</nowiki><br />
|}<br />
=== Redundant mapping ===<br />
{{Keypress|Ctrl-s}} is often used for terminal control to stop screen output while {{Keypress|Ctrl-q}} is used to start it. These mappings may interfere with rTorrent. Check to see if these terminal options are bound to a mapping:<br />
{{hc|$ stty -a|<nowiki>...<br />
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;<br />
...<br />
</nowiki>}}<br />
<br />
To remove the mappings, change the terminal characteristics to undefine the aforementioned special characters (i.e. {{ic|stop}} and {{ic|start}}):<br />
# stty stop undef<br />
# stty start undef<br />
<br />
To remove these mappings automatically at startup you may add the two preceding commands to your {{ic|~/.bashrc}} file.<br />
<br />
== Additional Tips ==<br />
<br />
=== Separate session with Screen ===<br />
[[GNU Screen]] is a wrapper that allows separation between the text program and the shell from which it was launched.<br />
<br />
Screen flow-control interferes with the {{Keypress|Ctrl-q}} mapping (see: [[#Redundant mapping|Redundant mapping]]). To disable it add the following to {{ic|~/.screenrc}}:<br />
defflow off<br />
<br />
An alternative is to escape the command and send it directly to rTorrent. In other words, use {{Keypress|Ctrl-a}} {{Keypress|q}} to quit rTorrent within GNU Screen.<br />
<br />
To automatically start rTorrent within Screen, add the following to the {{ic|~/.screenrc}} configuration file:<br />
screen -t rtorrent rtorrent <br />
<br />
==== Run as a daemon ====<br />
{{note|See the rTorrent wiki article on this subject for more information: [http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#StartingrTorrentonSystemStartup Starting rTorrent on System Startup]}}<br />
<br />
Alternatively, GNU Screen and rTorrent can be run together as a [[daemon]] (see also: [https://bbs.archlinux.org/viewtopic.php?id=53395 Arch Linux Forums thread], [https://forums.gentoo.org/viewtopic-t-600362-postdays-0-postorder-asc-start-0.html Gentoo Discussion Forums thread]). <br />
<br />
To use this script with [[tmux]], replace line 9 with {{ic|su - USER -c 'tmux new -s rtorrent -d rtorrent' &> /dev/null}} (see: [https://bbs.archlinux.org/viewtopic.php?id=126718 rTorrent daemon with tmux]).<br />
<br />
With root permissions create the following file:<br />
<br />
{{hc|/etc/rc.d/rtorrent|<nowiki><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting rtorrent"<br />
su - USER -c 'screen -d -m -S rtorrent rtorrent' &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon rtorrent<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping rtorrent"<br />
killall -w -s 2 /usr/bin/rtorrent &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon rtorrent<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
exit 0<br />
</nowiki>}}<br />
<br />
Make sure to change USER to the username that will be running rtorrent.<br />
<br />
Make the file executable:<br />
# chmod +x /etc/rc.d/rtorrent<br />
<br />
Creating a {{ic|.rtorrent.rc}} file with relative paths in a user's home directory will break the rc.d script. To run multiple instances of rTorrent with relative paths under different users, replace line 9 in {{ic|/etc/rc.d/rtorrent}} with the following:<br />
su username -c 'cd /home/username && screen -d -m -S rtorrent rtorrent' &> /dev/null<br />
<br />
Alternatively, you can set absolute paths in the configuration file.<br />
<br />
To run the daemon user multiple users create one rc.d script for each user. Then replace line 9 in {{ic|/etc/rc.d/rtorrent}} with the following: <br />
su - username -c 'killall -w -s 2 /usr/bin/rtorrent' &> /dev/null<br />
<br />
To connect to the daemon process on a remote machine use [[Secure Shell|SSH]]:<br />
$ ssh -t rtorrent@192.168.1.10 'screen -r'<br />
<br />
Or if you used [[tmux]] instead of [[screen]]:<br />
$ ssh -t rtorrent@192.168.1.10 'tmux attach -t rtorrent'<br />
<br />
For more information about daemon scripts see: [[Writing rc.d scripts]]<br />
<br />
This script can be found in {{aur|rtorrent-daemon-git}} from AUR.<br />
<br />
Alternate scripts can be found on the [http://www.gentoo-wiki.info/Rtorrent#rtorrent Gentoo Wiki Archives], [http://codesnippets.joyent.com/posts/show/1947 Joyent CodeSnippets] and [http://www.bytetouch.com/blog/linux/how-to-rtorrent-with-screen-on-debian/ ByteTouch].<br />
<br />
=== Pre-allocation ===<br />
The rTorrent package in the community repository lacks pre-allocation. Compiling rTorrent with pre-allocation allows files to be allocated before downloading the torrent. The major benefit is that it limits and avoids fragmentation of the filesystem. However, this introduces a delay during the pre-allocation if the filesystem does not support the fallocate syscall natively.<br />
<br />
Therefore this switch is recommended for xfs, ext4 and btrfs filesystems, which have native fallocate syscall support. They will see no delay during preallocation and no fragmented filesystem. Pre-allocation on others filesystems will cause a delay but will not fragment the files.<br />
<br />
To make pre-allocation available, recompile libtorrent from the [[ABS]] tree with the following new switch:<br />
$ ./configure --prefix=/usr --disable-debug --with-posix-fallocate<br />
<br />
To enable it, add the following to your {{ic|~/rtorrent.rc}}:<br />
{{hc|~/rtorrent.rc|<nowiki><br />
# Preallocate files; reduces defragmentation on filesystems.<br />
system.file_allocate.set = yes<br />
</nowiki>}}<br />
<br />
=== Manage completed files ===<br />
{{note|Currently, this part requires either the svn version of rtorrent/libtorrent or having applied the patch to 0.8.6 that adds 'equal'.}}<br />
<br />
{{note|If you're having trouble with this tip, it's probably easier to follow [http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#Movecompletedtorrentstodifferentdirectorydependingonwatchdirectory this]}}<br />
<br />
It is possible to have rtorrent sort completed torrent data to specific folders based on which 'watch' folder you drop the *.torrent into while continuing to seed. Many examples show how to do this with torrents downloaded by rtorrent. The problem is when you try to drop in 100% done torrent data and then have rtorrent check the data and resume, it will not be sorted.<br />
<br />
As a solution, use the following example in your ~/.rtorrent.rc.<br />
Make sure to change the paths.<br />
<br />
{{bc|1=<br />
# location where new torrent data is placed, and where you should place your<br />
# 'complete' data before you place your *.torrent file into the watch folder<br />
directory = /home/user/torrents/incomplete<br />
<br />
# schedule a timer event named 'watch_directory_1':<br />
# 1) triggers 10 seconds after rtorrent starts<br />
# 2) triggers at 10 second intervals thereafter<br />
# 3) Upon trigger, attempt to load (and start) new *.torrent files found in /home/user/torrents/watch/<br />
# 4) set a variable named 'custom1' with the value "/home/user/torrents/complete"<br />
# NOTE: if you do not want it to automatically start the torrent, change 'load_start' to 'load'<br />
schedule = watch_directory_1,10,10,"load_start=/home/user/torrents/watch/*.torrent,d.set_custom1=/home/user/torrents/complete"<br />
<br />
# insert a method with the alias 'checkdirs1'<br />
# 1) returns true if the current path of the torrent data is not equal to the value of custom1<br />
# 2) otherwise, returns false<br />
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""<br />
<br />
# insert a method with the alias 'movecheck1'<br />
# 1) returns true if all 3 commands return true ('result of checkdirs1' && 'torrent is 100% done', 'custom1 variable is set')<br />
# 2) otherwise, returns false<br />
system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}"<br />
<br />
# insert a method with the alias 'movedir1'<br />
# (a series of commands, separated by ';') <br />
# 1) "set path of torrent to equal the value of custom1";<br />
# 2) "mv -u <current data path> <custom1 path>";<br />
# 3) "clear custom1", "stop the torrent","resume the torrent"<br />
# 4) stop the torrent<br />
# 5) start the torrent (to get the torrent to update the 'base path')<br />
system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1=;d.stop=;d.start="<br />
<br />
# set a key with the name 'move_hashed1' that is triggered by the hash_done event.<br />
# 1) When hashing of a torrent completes, this custom key will be triggered.<br />
# 2) when triggered, execute the 'movecheck1' method and check the return value.<br />
# 3) if the 'movecheck' method returns 'true', execute the 'movedir1' method we inserted above.<br />
# NOTE-0: *Only* data that has had their hash checked manually with ^R [^R = Control r].<br />
# Or on a rtorrent restart[which initiates a hash check]. Will the data move; ~/torrents/incomplete => ~/torrents/complete for example.<br />
# NOTE-1: 'branch' is an 'if' conditional statement: if(movecheck1){movedir1}<br />
system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}"<br />
}}<br />
<br />
You can add additional watch folders and rules should you like to sort your torrents into special folders.<br />
<br />
For example, if you would like the torrents to download in:<br />
/home/user/torrents/incomplete<br />
and then sort the torrent data based on which folder you dropped the *.torrent into:<br />
/home/user/torrents/watch => /home/user/torrents/complete<br />
/home/user/torrents/watch/iso => /home/user/torrents/complete/iso<br />
/home/user/torrents/watch/music => /home/user/torrents/complete/music<br />
<br />
You can have the following in your .rtorrent.rc:<br />
{{bc|1=<br />
directory = /home/user/torrents/incomplete<br />
schedule = watch_directory_1,10,10,"load_start=/home/user/torrents/watch/*.torrent,d.set_custom1=/home/user/torrents/complete"<br />
<br />
schedule = watch_directory_2,10,10,"load_start=/home/user/torrents/watch/iso/*.torrent,d.set_custom1=/home/user/torrents/complete/iso"<br />
<br />
schedule = watch_directory_3,10,10,"load_start=/home/user/torrents/watch/music/*.torrent,d.set_custom1=/home/user/torrents/complete/music"<br />
<br />
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""<br />
system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}"<br />
system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1=;d.stop=;d.start="<br />
system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}"<br />
}}<br />
<br />
Also see [http://code.google.com/p/pyroscope/ pyroscope] especially the rtcontrol examples. There is an AUR package.<br />
<br />
==== Notification with Google Mail ====<br />
<br />
Cell phone providers allow you to "email" your phone:<br />
{{bc|<nowiki><br />
Verizon: 10digitphonenumber@vtext.com<br />
AT&T: 10digitphonenumber@txt.att.net<br />
Former AT&T customers: 10digitphonenumber@mmode.com<br />
Sprint: 10digitphonenumber@messaging.sprintpcs.com<br />
T-Mobile: 10digitphonenumber@tmomail.net<br />
Nextel: 10digitphonenumber@messaging.nextel.com<br />
Cingular: 10digitphonenumber@cingularme.com<br />
Virgin Mobile: 10digitphonenumber@vmobl.com<br />
Alltel: 10digitphonenumber@alltelmessage.com OR<br />
10digitphonenumber@message.alltel.com<br />
CellularOne: 10digitphonenumber@mobile.celloneusa.com<br />
Omnipoint: 10digitphonenumber@omnipointpcs.com<br />
Qwest: 10digitphonenumber@qwestmp.com<br />
Telus: 10digitphonenumber@msg.telus.com<br />
Rogers Wireless: 10digitphonenumber@pcs.rogers.com<br />
Fido: 10digitphonenumber@fido.ca<br />
Bell Mobility: 10digitphonenumber@txt.bell.ca<br />
Koodo Mobile: 10digitphonenumber@msg.koodomobile.com<br />
MTS: 10digitphonenumber@text.mtsmobility.com<br />
President's Choice: 10digitphonenumber@txt.bell.ca<br />
Sasktel: 10digitphonenumber@sms.sasktel.com<br />
Solo: 10digitphonenumber@txt.bell.ca<br />
</nowiki>}}<br />
<br />
*Install Heirloom's mailx program which is provided by the {{Pkg|heirloom-mailx}} package that is found in the [[Official Repositories|official repositories]].<br />
<br />
*Clear the {{ic|/etc/mail.rc}} file and enter:<br />
<br />
{{Note|Older versions of Heirloom's mailx use {{ic|/etc/nail.rc}}.}}<br />
<br />
{{bc|<nowiki><br />
set sendmail="/usr/bin/mailx"<br />
set smtp=smtp.gmail.com:587<br />
set smtp-use-starttls<br />
set ssl-verify=ignore<br />
set ssl-auth=login<br />
set smtp-auth-user=USERNAME@gmail.com<br />
set smtp-auth-password=PASSWORD<br />
</nowiki>}}<br />
<br />
Now to send the text, we must pipe a message to the mailx program.<br />
*Make a Bash script:<br />
{{hc|/path/to/mail.sh|<nowiki><br />
echo "$@: Done" | mailx 5551234567@vtext.com<br />
</nowiki>}}<br />
Where the $@ is a variable holding all the arguments passed to our script.<br />
<br />
*And finally, add the important {{ic|~/.rtorrent.rc}} line:<br />
system.method.set_key = event.download.finished,notify_me,"execute=/path/to/mail.sh,$d.get_name="<br />
<br />
Breaking it down:<br />
<br />
{{ic|notify_me}} is the command id, which may be used by other commands, it can be just about anything you like, so long as it is unique.<br />
<br />
{{ic|1=execute=}} is the rtorrent command, in this case to execute a shell command.<br />
<br />
{{ic|/path/to/mail.sh}} is the name of our script (or whatever command you want to execute) followed by a comma separated list of all the switches/arguments to be passed.<br />
<br />
{{ic|1=$d.get_name=}} 'd' is an alias to whatever download triggered the command, get_name is a function which returns the name of our download, and the '$' tells rTorrent to replace the command with its output before it calls execute.<br />
<br />
The end result? When that torrent, 'All Live Nudibranches', that we started before leaving for work finishes, we will be texted:<br />
All Live Nudibranches: Done<br />
<br />
=== Displaying active torrents ===<br />
The rtorrent doesn't list the active tab properly by default, add this line to your {{ic|.rtorrent.rc}} to show only active torrents<br />
schedule = filter_active,30,30,"view_filter = active,\"or={d.get_up_rate=,d.get_down_rate=}\""<br />
<br />
Then press {{keypress|9}} in your rTorrent client to see the changes in action.<br />
<br />
== Troubleshooting ==<br />
<br />
=== CA certificates ===<br />
To use rTorrent with a tracker that uses HTTPS, do the following as root:<br />
<br />
{{bc|# cd /etc/ssl/certs<br />
<br />
# wget --no-check-certificate https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Global_eBusiness_CA-1.cer<br />
<br />
# mv Equifax_Secure_Global_eBusiness_CA-1.cer Equifax_Secure_Global_eBusiness_CA-1.pem<br />
<br />
# c_rehash<br />
}}<br />
<br />
And from now on run rTorrent with:<br />
$ rtorrent -o http_capath=/etc/ssl/certs<br />
<br />
If you use GNU Screen, update the {{ic|.screenrc}} configuration file to reflect this change:<br />
$ screen -t rtorrent rtorrent -o http_capath=/etc/ssl/certs<br />
<br />
In rTorrent 0.8.9, set {{ic|<nowiki>network.http.ssl_verify_peer.set=0</nowiki>}} to fix the problem.<sup>[https://bbs.archlinux.org/viewtopic.php?pid=981832#p981832]</sup><br />
<br />
For more information see: [https://bbs.archlinux.org/viewtopic.php?pid=331850 rTorrent Error & CA Certificate] and [https://bbs.archlinux.org/viewtopic.php?id=45800 rTorrent Certificates Problem]<br />
<br />
== Web interface ==<br />
There are numerous web interfaces and front ends for rTorrent including:<br />
* [[WTorrent]] is a web interface to rtorrent programmed in php using Smarty templates and XMLRPC for PHP library.<br />
* [http://code.google.com/p/ntorrent/ nTorrent] is a graphical user interface client to rtorrent (a cli torrent client) written in Java.<br />
* [http://projects.cyla.homeip.net/rtwi/ rTWi] is a simple rTorrent web interface written in PHP.<br />
* [[Rtgui]] is a web based front end for rTorrent written in PHP and uses XML-RPC to communicate with the rTorrent client.<br />
* [http://code.google.com/p/rutorrent/ rutorrent] and [http://forums.rutorrent.org/ Forum] - A web-based front-end with an interface very similar to uTorrent which supports many plugins and advanced features (see also: [https://bbs.archlinux.org/viewtopic.php?pid=897577#p897577 Guide for rTorrent + ruTorrent Installation]).<br />
<br />
{{note|rTorrent is currently built using [http://xmlrpc-c.sourceforge.net/ XML-RPC for C/C++], which is required for some web interfaces (e.g. ruTorrent).}}<br />
<br />
=== XMLRPC interface ===<br />
If you want to use rtorrent with some web interfaces (e.g. rutorrent) you need to add the following line to the configuration file:<br />
scgi_port = localhost:5000<br />
<br />
For more information see: [http://libtorrent.rakshasa.no/wiki/RTorrentXMLRPCGuide Using XMLRPC with rtorrent]<br />
<br />
=== Handling magnet links (opt with firefox) ===<br />
If you wish to have magnet links automatically added to your watch folder, here is a script that will do the trick:<br />
<br />
#!/bin/bash<br />
watch_folder=~/.rtorrent/watch<br />
cd $watch_folder <br />
[[ "$1" =~ xt=urn:btih:([^&/]+) ]] || exit;<br />
echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent"<br />
<br />
(adapted from http://blog.gonzih.org/blog/2012/02/17/how-to-use-magnet-links-with-rtorrent/)<br />
<br />
Save it, for instance as rtorrent-magnet, give it execution permission and place it somewhere under your $PATH, <br />
then in firefox:<br />
<br />
-Type about:config into the Location Bar (address bar) and press Enter.<br />
-Right-click -> New -> Boolean -> Name: network.protocol-handler.expose.magnet -> Value -> false<br />
-Next time you click a magnet link you will be asked which application to open it with, select the script we just created and you'll be done<br />
(http://kb.mozillazine.org/Register_protocol)<br />
<br />
== See also ==<br />
* [[Screen Tips]]<br />
* [[Wikipedia:Comparison of BitTorrent clients|Comparison of BitTorrent clients]] on Wikipedia<br />
* [http://community.rutorrent.org/ rTorrent Community Wiki] - A public place for information on rTorrent and any project related to rTorrent, regarding setup, configuration, operations, and development.<br />
* [http://code.google.com/p/pyroscope/ PyroScope] - A collection of command line tools for rTorrent. It provides commands for creating and modifying torrent files, moving data on completion without having multiple watch folders, and mass-controlling download items via rTorrent's XML-RPC interface: searching, start/stop, deleting items with or without their data, etc. It also offers a documented [[Python]] API.<br />
* [http://wiki.theaveragegeek.com/howto/installing_rtorrent_and_hellanzb_on_centos5_64-bit_vps How-to Install rTorrent and Hellanzb on CentOS 5 64-bit VPS]<br />
* [http://code.google.com/p/pyroscope/wiki/DebianInstallFromSource Installation Guide for rTorrent and Pryoscope on Debian] - A collection of tools for the BitTorrent protocol and especially the rTorrent client<br />
* [http://mktorrent.sourceforge.net/ mktorrent] - A command line application used to generate torrent files, which is available as {{Pkg|mktorrent}} in the [[Official Repositories|official repositories]].<br />
<br />
<br />
'''Forum threads'''<br />
* 2009-03-11 - Arch Linux - [https://bbs.archlinux.org/viewtopic.php?id=67304 HOWTO: rTorrent stats in Conky]</div>HackBughttps://wiki.archlinux.org/index.php?title=RTorrent&diff=213350RTorrent2012-07-17T10:22:56Z<p>HackBug: /* Manage completed files */</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[[es:RTorrent]]<br />
[[ru:RTorrent]]<br />
[[zh-CN:RTorrent]]<br />
{{DISPLAYTITLE:rTorrent}}<br />
[http://libtorrent.rakshasa.no/ rTorrent] is a quick and efficient BitTorrent client that uses the libtorrent library. It is written in C++ and uses the [[Wikipedia:ncurses|ncurses]] programming library, which means it uses a text user interface. When combined with [[GNU Screen]] and [[Secure Shell]], it becomes a convenient remote [[Wikipedia:BitTorrent (protocol)#Operation|BitTorrent client]].<br />
<br />
== Installation ==<br />
[[pacman|Install]] the {{Pkg|rtorrent}} package that is available in the [[Official Repositories|official repositories]].<br />
<br />
Alternatively, install {{AUR|rtorrent-svn}} or {{AUR|rtorrent-extended}} from the [[Arch User Repository|AUR]].<br />
<br />
== Configuration ==<br />
{{note|See the rTorrent wiki article on this subject for more information: [http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks Common Tasks in rTorrent for Dummies]}}<br />
<br />
Before running rTorrent, find the example configuration file {{ic|/usr/share/doc/rtorrent/rtorrent.rc}} and copy it to {{ic|~/.rtorrent.rc}}:<br />
<br />
$ cp /usr/share/doc/rtorrent/rtorrent.rc ~/.rtorrent.rc<br />
<br />
=== Performance ===<br />
{{note|See the rTorrent wiki article on this subject for more information: [http://libtorrent.rakshasa.no/wiki/RTorrentPerformanceTuning Performance Tuning]}}<br />
<br />
The values for the following options are dependent on the system's hardware and Internet connection speed. To find the optimal values read: [http://torrentfreak.com/optimize-your-BitTorrent-download-speed Optimize Your BitTorrent Download Speed]<br />
{{bc|<nowiki><br />
min_peers = 40<br />
max_peers = 52<br />
<br />
min_peers_seed = 10<br />
max_peers_seed = 52<br />
<br />
max_uploads = 8<br />
<br />
download_rate = 200<br />
upload_rate = 28<br />
</nowiki>}}<br />
<br />
The {{ic|check_hash}} option executes a hash check when a torrent download is complete or rTorrent is started. When starting, it checks for errors in your completed files. <br />
check_hash = yes<br />
<br />
=== Create and manage files ===<br />
The {{ic|directory}} option will determine where your torrent data will be saved. Be sure to enter the absolute path, as rTorrent may not follow relative paths:<br />
directory = /home/[user]/torrents/<br />
<br />
The {{ic|session}} option allows rTorrent to save the progess of your torrents. It is recommended to create a directory called {{ic|.session}} (e.g. {{ic|$ mkdir ~/.session}}).<br />
session = /home/[user]/.session/<br />
<br />
The {{ic|schedule}} option has rTorrent watch a particular directory for new torrent files. Saving a torrent file to this directory will automatically start the download. Remember to create the directory that will be watched (e.g. {{ic|$ mkdir ~/watch}}). Also, be careful when using this option as rTorrent will move the torrent file to your session folder and rename it to its hash value.<br />
schedule = watch_directory,5,5,load_start=/home/[user]/watch/*.torrent<br />
schedule = untied_directory,5,5,stop_untied=<br />
schedule = tied_directory,5,5,start_tied=<br />
<br />
The following {{ic|schedule}} option is intended to stop rTorrent from downloading data when disk space is low.<br />
schedule = low_diskspace,5,60,close_low_diskspace=100M<br />
<br />
=== Port configuration ===<br />
The {{ic|port_range}} option sets which port(s) to use for listening. It is recommended to use a port that is higher than 49152 (see: [[Wikipedia:List of TCP and UDP port numbers|List of port numbers]]). Although, rTorrent allows a range of ports, a single port is recommended.<br />
port_range = 49164-49164<br />
<br />
Additionally, make sure port forwarding is enabled for the proper port(s) (see: [http://portforward.com/english/routers/port_forwarding/routerindex.htm Port Forward Guides]).<br />
<br />
=== Additional settings ===<br />
The {{ic|encryption}} option enables or disables encryption. It is very important to enable this option, not only for yourself, but also for your peers in the torrent swarm. Some users need to obscure their bandwidth usage from their ISP. And it does not hurt to enable it even if you do not need the added security.<br />
encryption = allow_incoming,try_outgoing,enable_retry<br />
{{Wikipedia|BitTorrent Protocol Encryption}}<br />
<br />
This final {{ic|dht}} option enables [[Wikipedia:Distributed hash table|DHT]] support. DHT is common among public trackers and will allow the client to acquire more peers.<br />
{{bc|<nowiki><br />
dht = auto<br />
dht_port = 6881<br />
peer_exchange = yes<br />
</nowiki>}}<br />
<br />
{{note|See the rTorrent wiki article on this subject for more information: [http://libtorrent.rakshasa.no/wiki/RTorrentUsingDHT Using DHT]}}<br />
<br />
== Key bindings ==<br />
<br />
rTorrent relies exclusively on keyboard shortcuts for user input. A quick reference is available in the table below. A complete guide is available on the rTorrent wiki (see: [http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide rTorrent User Guide]).<br />
<br />
{{note|Striking {{keypress|Ctrl-q}} twice in quick succession will make rTorrent shutdown without waiting to send a stop announce to the connected trackers.}}<br />
<br />
{| class="toccolours" border="1" cellpadding="4" cellspacing="0" style="margin:5px;"<br />
|-<br />
!width="75" |Cmd<br />
!Action<br />
|-<br />
|Ctrl-q<br />
|Quit application<br />
|-<br />
|Ctrl-s<br />
|Start download. Runs hash first unless already done.<br />
|-<br />
|Ctrl-d<br />
|Stop an active download or remove a stopped download<br />
|-<br />
|Ctrl-k<br />
|Stop and close the files of an active download.<br />
|-<br />
|Ctrl-r<br />
|Initiate hash check of torrent. Without starting to download/upload.<br />
|-<br />
|Left<br />
|Returns to the previous screen<br />
|-<br />
|Right<br />
|Goes to the next screen<br />
|-<br />
|Backspace/Return<br />
|Adds the specified *.torrent<br />
|-<br />
|<nowiki>a|s|d</nowiki><br />
|<nowiki>Increase global upload throttle about 1|5|50 KB/s</nowiki><br />
|-<br />
|<nowiki>A|S|D</nowiki><br />
|<nowiki>Increase global download throttle about 1|5|50 KB/s</nowiki><br />
|-<br />
|<nowiki>z|x|c</nowiki><br />
|<nowiki>Decrease global upload throttle about 1|5|50 KB/s</nowiki><br />
|-<br />
|<nowiki>Z|X|C</nowiki><br />
|<nowiki>Decrease global download throttle about 1|5|50 KB/s</nowiki><br />
|}<br />
=== Redundant mapping ===<br />
{{Keypress|Ctrl-s}} is often used for terminal control to stop screen output while {{Keypress|Ctrl-q}} is used to start it. These mappings may interfere with rTorrent. Check to see if these terminal options are bound to a mapping:<br />
{{hc|$ stty -a|<nowiki>...<br />
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;<br />
...<br />
</nowiki>}}<br />
<br />
To remove the mappings, change the terminal characteristics to undefine the aforementioned special characters (i.e. {{ic|stop}} and {{ic|start}}):<br />
# stty stop undef<br />
# stty start undef<br />
<br />
To remove these mappings automatically at startup you may add the two preceding commands to your {{ic|~/.bashrc}} file.<br />
<br />
== Additional Tips ==<br />
<br />
=== Separate session with Screen ===<br />
[[GNU Screen]] is a wrapper that allows separation between the text program and the shell from which it was launched.<br />
<br />
Screen flow-control interferes with the {{Keypress|Ctrl-q}} mapping (see: [[#Redundant mapping|Redundant mapping]]). To disable it add the following to {{ic|~/.screenrc}}:<br />
defflow off<br />
<br />
An alternative is to escape the command and send it directly to rTorrent. In other words, use {{Keypress|Ctrl-a}} {{Keypress|q}} to quit rTorrent within GNU Screen.<br />
<br />
To automatically start rTorrent within Screen, add the following to the {{ic|~/.screenrc}} configuration file:<br />
screen -t rtorrent rtorrent <br />
<br />
==== Run as a daemon ====<br />
{{note|See the rTorrent wiki article on this subject for more information: [http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#StartingrTorrentonSystemStartup Starting rTorrent on System Startup]}}<br />
<br />
Alternatively, GNU Screen and rTorrent can be run together as a [[daemon]] (see also: [https://bbs.archlinux.org/viewtopic.php?id=53395 Arch Linux Forums thread], [https://forums.gentoo.org/viewtopic-t-600362-postdays-0-postorder-asc-start-0.html Gentoo Discussion Forums thread]). <br />
<br />
To use this script with [[tmux]], replace line 9 with {{ic|su - USER -c 'tmux new -s rtorrent -d rtorrent' &> /dev/null}} (see: [https://bbs.archlinux.org/viewtopic.php?id=126718 rTorrent daemon with tmux]).<br />
<br />
With root permissions create the following file:<br />
<br />
{{hc|/etc/rc.d/rtorrent|<nowiki><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting rtorrent"<br />
su - USER -c 'screen -d -m -S rtorrent rtorrent' &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon rtorrent<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping rtorrent"<br />
killall -w -s 2 /usr/bin/rtorrent &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon rtorrent<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
exit 0<br />
</nowiki>}}<br />
<br />
Make sure to change USER to the username that will be running rtorrent.<br />
<br />
Make the file executable:<br />
# chmod +x /etc/rc.d/rtorrent<br />
<br />
Creating a {{ic|.rtorrent.rc}} file with relative paths in a user's home directory will break the rc.d script. To run multiple instances of rTorrent with relative paths under different users, replace line 9 in {{ic|/etc/rc.d/rtorrent}} with the following:<br />
su username -c 'cd /home/username && screen -d -m -S rtorrent rtorrent' &> /dev/null<br />
<br />
Alternatively, you can set absolute paths in the configuration file.<br />
<br />
To run the daemon user multiple users create one rc.d script for each user. Then replace line 9 in {{ic|/etc/rc.d/rtorrent}} with the following: <br />
su - username -c 'killall -w -s 2 /usr/bin/rtorrent' &> /dev/null<br />
<br />
To connect to the daemon process on a remote machine use [[Secure Shell|SSH]]:<br />
$ ssh -t rtorrent@192.168.1.10 'screen -r'<br />
<br />
Or if you used [[tmux]] instead of [[screen]]:<br />
$ ssh -t rtorrent@192.168.1.10 'tmux attach -t rtorrent'<br />
<br />
For more information about daemon scripts see: [[Writing rc.d scripts]]<br />
<br />
This script can be found in {{aur|rtorrent-daemon-git}} from AUR.<br />
<br />
Alternate scripts can be found on the [http://www.gentoo-wiki.info/Rtorrent#rtorrent Gentoo Wiki Archives], [http://codesnippets.joyent.com/posts/show/1947 Joyent CodeSnippets] and [http://www.bytetouch.com/blog/linux/how-to-rtorrent-with-screen-on-debian/ ByteTouch].<br />
<br />
=== Pre-allocation ===<br />
The rTorrent package in the community repository lacks pre-allocation. Compiling rTorrent with pre-allocation allows files to be allocated before downloading the torrent. The major benefit is that it limits and avoids fragmentation of the filesystem. However, this introduces a delay during the pre-allocation if the filesystem does not support the fallocate syscall natively.<br />
<br />
Therefore this switch is recommended for xfs, ext4 and btrfs filesystems, which have native fallocate syscall support. They will see no delay during preallocation and no fragmented filesystem. Pre-allocation on others filesystems will cause a delay but will not fragment the files.<br />
<br />
To make pre-allocation available, recompile libtorrent from the [[ABS]] tree with the following new switch:<br />
$ ./configure --prefix=/usr --disable-debug --with-posix-fallocate<br />
<br />
To enable it, add the following to your {{ic|~/rtorrent.rc}}:<br />
{{hc|~/rtorrent.rc|<nowiki><br />
# Preallocate files; reduces defragmentation on filesystems.<br />
system.file_allocate.set = yes<br />
</nowiki>}}<br />
<br />
=== Manage completed files ===<br />
{{note|Currently, this part requires either the svn version of rtorrent/libtorrent or having applied the patch to 0.8.6 that adds 'equal'.}}<br />
<br />
{{note|If you're having trouble with this tip, it's probably easier to follow [http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#Movecompletedtorrentstodifferentdirectorydependingonwatchdirectory this]}}<br />
<br />
It is possible to have rtorrent sort completed torrent data to specific folders based on which 'watch' folder you drop the *.torrent into while continuing to seed. Many examples show how to do this with torrents downloaded by rtorrent. The problem is when you try to drop in 100% done torrent data and then have rtorrent check the data and resume, It will not be sorted.<br />
<br />
As a solution, use the following example in your ~/.rtorrent.rc.<br />
Make sure to change the paths.<br />
<br />
{{bc|1=<br />
# location where new torrent data is placed, and where you should place your<br />
# 'complete' data before you place your *.torrent file into the watch folder<br />
directory = /home/user/torrents/incomplete<br />
<br />
# schedule a timer event named 'watch_directory_1':<br />
# 1) triggers 10 seconds after rtorrent starts<br />
# 2) triggers at 10 second intervals thereafter<br />
# 3) Upon trigger, attempt to load (and start) new *.torrent files found in /home/user/torrents/watch/<br />
# 4) set a variable named 'custom1' with the value "/home/user/torrents/complete"<br />
# NOTE: if you do not want it to automatically start the torrent, change 'load_start' to 'load'<br />
schedule = watch_directory_1,10,10,"load_start=/home/user/torrents/watch/*.torrent,d.set_custom1=/home/user/torrents/complete"<br />
<br />
# insert a method with the alias 'checkdirs1'<br />
# 1) returns true if the current path of the torrent data is not equal to the value of custom1<br />
# 2) otherwise, returns false<br />
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""<br />
<br />
# insert a method with the alias 'movecheck1'<br />
# 1) returns true if all 3 commands return true ('result of checkdirs1' && 'torrent is 100% done', 'custom1 variable is set')<br />
# 2) otherwise, returns false<br />
system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}"<br />
<br />
# insert a method with the alias 'movedir1'<br />
# (a series of commands, separated by ';') <br />
# 1) "set path of torrent to equal the value of custom1";<br />
# 2) "mv -u <current data path> <custom1 path>";<br />
# 3) "clear custom1", "stop the torrent","resume the torrent"<br />
# 4) stop the torrent<br />
# 5) start the torrent (to get the torrent to update the 'base path')<br />
system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1=;d.stop=;d.start="<br />
<br />
# set a key with the name 'move_hashed1' that is triggered by the hash_done event.<br />
# 1) When hashing of a torrent completes, this custom key will be triggered.<br />
# 2) when triggered, execute the 'movecheck1' method and check the return value.<br />
# 3) if the 'movecheck' method returns 'true', execute the 'movedir1' method we inserted above.<br />
# NOTE-0: *Only* data that has had their hash checked manually with ^R [^R = Control r].<br />
# Or on a rtorrent restart[which initiates a hash check]. Will the data move; ~/torrents/incomplete => ~/torrents/complete for example.<br />
# NOTE-1: 'branch' is an 'if' conditional statement: if(movecheck1){movedir1}<br />
system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}"<br />
}}<br />
<br />
You can add additional watch folders and rules should you like to sort your torrents into special folders.<br />
<br />
For example, if you would like the torrents to download in:<br />
/home/user/torrents/incomplete<br />
and then sort the torrent data based on which folder you dropped the *.torrent into:<br />
/home/user/torrents/watch => /home/user/torrents/complete<br />
/home/user/torrents/watch/iso => /home/user/torrents/complete/iso<br />
/home/user/torrents/watch/music => /home/user/torrents/complete/music<br />
<br />
You can have the following in your .rtorrent.rc:<br />
{{bc|1=<br />
directory = /home/user/torrents/incomplete<br />
schedule = watch_directory_1,10,10,"load_start=/home/user/torrents/watch/*.torrent,d.set_custom1=/home/user/torrents/complete"<br />
<br />
schedule = watch_directory_2,10,10,"load_start=/home/user/torrents/watch/iso/*.torrent,d.set_custom1=/home/user/torrents/complete/iso"<br />
<br />
schedule = watch_directory_3,10,10,"load_start=/home/user/torrents/watch/music/*.torrent,d.set_custom1=/home/user/torrents/complete/music"<br />
<br />
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""<br />
system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}"<br />
system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1=;d.stop=;d.start="<br />
system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}"<br />
}}<br />
<br />
Also see [http://code.google.com/p/pyroscope/ pyroscope] especially the rtcontrol examples. There is an AUR package.<br />
<br />
==== Notification with Google Mail ====<br />
<br />
Cell phone providers allow you to "email" your phone:<br />
{{bc|<nowiki><br />
Verizon: 10digitphonenumber@vtext.com<br />
AT&T: 10digitphonenumber@txt.att.net<br />
Former AT&T customers: 10digitphonenumber@mmode.com<br />
Sprint: 10digitphonenumber@messaging.sprintpcs.com<br />
T-Mobile: 10digitphonenumber@tmomail.net<br />
Nextel: 10digitphonenumber@messaging.nextel.com<br />
Cingular: 10digitphonenumber@cingularme.com<br />
Virgin Mobile: 10digitphonenumber@vmobl.com<br />
Alltel: 10digitphonenumber@alltelmessage.com OR<br />
10digitphonenumber@message.alltel.com<br />
CellularOne: 10digitphonenumber@mobile.celloneusa.com<br />
Omnipoint: 10digitphonenumber@omnipointpcs.com<br />
Qwest: 10digitphonenumber@qwestmp.com<br />
Telus: 10digitphonenumber@msg.telus.com<br />
Rogers Wireless: 10digitphonenumber@pcs.rogers.com<br />
Fido: 10digitphonenumber@fido.ca<br />
Bell Mobility: 10digitphonenumber@txt.bell.ca<br />
Koodo Mobile: 10digitphonenumber@msg.koodomobile.com<br />
MTS: 10digitphonenumber@text.mtsmobility.com<br />
President's Choice: 10digitphonenumber@txt.bell.ca<br />
Sasktel: 10digitphonenumber@sms.sasktel.com<br />
Solo: 10digitphonenumber@txt.bell.ca<br />
</nowiki>}}<br />
<br />
*Install Heirloom's mailx program which is provided by the {{Pkg|heirloom-mailx}} package that is found in the [[Official Repositories|official repositories]].<br />
<br />
*Clear the {{ic|/etc/mail.rc}} file and enter:<br />
<br />
{{Note|Older versions of Heirloom's mailx use {{ic|/etc/nail.rc}}.}}<br />
<br />
{{bc|<nowiki><br />
set sendmail="/usr/bin/mailx"<br />
set smtp=smtp.gmail.com:587<br />
set smtp-use-starttls<br />
set ssl-verify=ignore<br />
set ssl-auth=login<br />
set smtp-auth-user=USERNAME@gmail.com<br />
set smtp-auth-password=PASSWORD<br />
</nowiki>}}<br />
<br />
Now to send the text, we must pipe a message to the mailx program.<br />
*Make a Bash script:<br />
{{hc|/path/to/mail.sh|<nowiki><br />
echo "$@: Done" | mailx 5551234567@vtext.com<br />
</nowiki>}}<br />
Where the $@ is a variable holding all the arguments passed to our script.<br />
<br />
*And finally, add the important {{ic|~/.rtorrent.rc}} line:<br />
system.method.set_key = event.download.finished,notify_me,"execute=/path/to/mail.sh,$d.get_name="<br />
<br />
Breaking it down:<br />
<br />
{{ic|notify_me}} is the command id, which may be used by other commands, it can be just about anything you like, so long as it is unique.<br />
<br />
{{ic|1=execute=}} is the rtorrent command, in this case to execute a shell command.<br />
<br />
{{ic|/path/to/mail.sh}} is the name of our script (or whatever command you want to execute) followed by a comma separated list of all the switches/arguments to be passed.<br />
<br />
{{ic|1=$d.get_name=}} 'd' is an alias to whatever download triggered the command, get_name is a function which returns the name of our download, and the '$' tells rTorrent to replace the command with its output before it calls execute.<br />
<br />
The end result? When that torrent, 'All Live Nudibranches', that we started before leaving for work finishes, we will be texted:<br />
All Live Nudibranches: Done<br />
<br />
=== Displaying active torrents ===<br />
The rtorrent doesn't list the active tab properly by default, add this line to your {{ic|.rtorrent.rc}} to show only active torrents<br />
schedule = filter_active,30,30,"view_filter = active,\"or={d.get_up_rate=,d.get_down_rate=}\""<br />
<br />
Then press {{keypress|9}} in your rTorrent client to see the changes in action.<br />
<br />
== Troubleshooting ==<br />
<br />
=== CA certificates ===<br />
To use rTorrent with a tracker that uses HTTPS, do the following as root:<br />
<br />
{{bc|# cd /etc/ssl/certs<br />
<br />
# wget --no-check-certificate https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Global_eBusiness_CA-1.cer<br />
<br />
# mv Equifax_Secure_Global_eBusiness_CA-1.cer Equifax_Secure_Global_eBusiness_CA-1.pem<br />
<br />
# c_rehash<br />
}}<br />
<br />
And from now on run rTorrent with:<br />
$ rtorrent -o http_capath=/etc/ssl/certs<br />
<br />
If you use GNU Screen, update the {{ic|.screenrc}} configuration file to reflect this change:<br />
$ screen -t rtorrent rtorrent -o http_capath=/etc/ssl/certs<br />
<br />
In rTorrent 0.8.9, set {{ic|<nowiki>network.http.ssl_verify_peer.set=0</nowiki>}} to fix the problem.<sup>[https://bbs.archlinux.org/viewtopic.php?pid=981832#p981832]</sup><br />
<br />
For more information see: [https://bbs.archlinux.org/viewtopic.php?pid=331850 rTorrent Error & CA Certificate] and [https://bbs.archlinux.org/viewtopic.php?id=45800 rTorrent Certificates Problem]<br />
<br />
== Web interface ==<br />
There are numerous web interfaces and front ends for rTorrent including:<br />
* [[WTorrent]] is a web interface to rtorrent programmed in php using Smarty templates and XMLRPC for PHP library.<br />
* [http://code.google.com/p/ntorrent/ nTorrent] is a graphical user interface client to rtorrent (a cli torrent client) written in Java.<br />
* [http://projects.cyla.homeip.net/rtwi/ rTWi] is a simple rTorrent web interface written in PHP.<br />
* [[Rtgui]] is a web based front end for rTorrent written in PHP and uses XML-RPC to communicate with the rTorrent client.<br />
* [http://code.google.com/p/rutorrent/ rutorrent] and [http://forums.rutorrent.org/ Forum] - A web-based front-end with an interface very similar to uTorrent which supports many plugins and advanced features (see also: [https://bbs.archlinux.org/viewtopic.php?pid=897577#p897577 Guide for rTorrent + ruTorrent Installation]).<br />
<br />
{{note|rTorrent is currently built using [http://xmlrpc-c.sourceforge.net/ XML-RPC for C/C++], which is required for some web interfaces (e.g. ruTorrent).}}<br />
<br />
=== XMLRPC interface ===<br />
If you want to use rtorrent with some web interfaces (e.g. rutorrent) you need to add the following line to the configuration file:<br />
scgi_port = localhost:5000<br />
<br />
For more information see: [http://libtorrent.rakshasa.no/wiki/RTorrentXMLRPCGuide Using XMLRPC with rtorrent]<br />
<br />
=== Handling magnet links (opt with firefox) ===<br />
If you wish to have magnet links automatically added to your watch folder, here is a script that will do the trick:<br />
<br />
#!/bin/bash<br />
watch_folder=~/.rtorrent/watch<br />
cd $watch_folder <br />
[[ "$1" =~ xt=urn:btih:([^&/]+) ]] || exit;<br />
echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent"<br />
<br />
(adapted from http://blog.gonzih.org/blog/2012/02/17/how-to-use-magnet-links-with-rtorrent/)<br />
<br />
Save it, for instance as rtorrent-magnet, give it execution permission and place it somewhere under your $PATH, <br />
then in firefox:<br />
<br />
-Type about:config into the Location Bar (address bar) and press Enter.<br />
-Right-click -> New -> Boolean -> Name: network.protocol-handler.expose.magnet -> Value -> false<br />
-Next time you click a magnet link you will be asked which application to open it with, select the script we just created and you'll be done<br />
(http://kb.mozillazine.org/Register_protocol)<br />
<br />
== See also ==<br />
* [[Screen Tips]]<br />
* [[Wikipedia:Comparison of BitTorrent clients|Comparison of BitTorrent clients]] on Wikipedia<br />
* [http://community.rutorrent.org/ rTorrent Community Wiki] - A public place for information on rTorrent and any project related to rTorrent, regarding setup, configuration, operations, and development.<br />
* [http://code.google.com/p/pyroscope/ PyroScope] - A collection of command line tools for rTorrent. It provides commands for creating and modifying torrent files, moving data on completion without having multiple watch folders, and mass-controlling download items via rTorrent's XML-RPC interface: searching, start/stop, deleting items with or without their data, etc. It also offers a documented [[Python]] API.<br />
* [http://wiki.theaveragegeek.com/howto/installing_rtorrent_and_hellanzb_on_centos5_64-bit_vps How-to Install rTorrent and Hellanzb on CentOS 5 64-bit VPS]<br />
* [http://code.google.com/p/pyroscope/wiki/DebianInstallFromSource Installation Guide for rTorrent and Pryoscope on Debian] - A collection of tools for the BitTorrent protocol and especially the rTorrent client<br />
* [http://mktorrent.sourceforge.net/ mktorrent] - A command line application used to generate torrent files, which is available as {{Pkg|mktorrent}} in the [[Official Repositories|official repositories]].<br />
<br />
<br />
'''Forum threads'''<br />
* 2009-03-11 - Arch Linux - [https://bbs.archlinux.org/viewtopic.php?id=67304 HOWTO: rTorrent stats in Conky]</div>HackBughttps://wiki.archlinux.org/index.php?title=Talk:Netcfg&diff=184905Talk:Netcfg2012-02-15T21:42:34Z<p>HackBug: /* Connecting automatically configuration change */ new section</p>
<hr />
<div>== DHCLIENT ==<br />
<br />
DHCLIENT=no<br />
This will tell netcfg to use dhcpcd instead of dhclient<br />
<br />
I is correct? Without setting DHCLIENT, IP="dhcp" in my profile launches dhcpcd. [[User:Mykhal|Mykhal]] 17:28, 22 May 2009 (EDT)<br />
<br />
:This appears to refer to an older revision. See [http://projects.archlinux.org/netcfg.git/commit/?id=75b7abe2727a9ce7e72721a5c79f070d6126b6b3 this commit: "Restore dhcpcd as default dhcp client"]. I've removed the offending line from the article.<br />
<br />
:-- [[User:Pointone|pointone]] 14:51, 24 February 2010 (EST)<br />
<br />
DHCLIENT=yes still works. It generally shouldn't be necessary though.<br />
<br />
[[User:Iphitus|Iphitus]] 20:16, 6 March 2010 (EST)<br />
<br />
== Move to [[netcfg]] ==<br />
<br />
Are there any objections to renaming this article "netcfg"? I think this would be much clearer. -- [[User:Pointone|pointone]] 12:19, 23 February 2010 (EST)<br />
<br />
+1 [[User:Daenyth|Daenyth]] 17:46, 25 February 2010 (EST)<br />
<br />
+1 [[User:Proofrific|Proofrific]] 22:17, 5 March 2010 (EST)<br />
<br />
+1 [[User:Idupree|Idupree]] 18:19, 6 March 2010 (EST)<br />
:If we do this, we should also move [[Network_Profiles_development]] to Netcfg_development; also check [[Network_Profiles_with_3G_card]]; also do we need to be concerned about the "Network Profiles (Some other language)" pages? [[User:Idupree|Idupree]] 18:34, 6 March 2010 (EST)<br />
<br />
+1 [[User:Iphitus|Iphitus]] 20:11, 6 March 2010 (EST) I don't mind.<br />
<br />
== confusing warning message ==<br />
<br />
The page begins<br />
{{Box RED||'''This document refers to netcfg 2.5.x''' &ndash; please upgrade to the latest version of netcfg.}}<br />
which sounds to me like the page itself is outdated and needs to be updated to describe a netcfg 2.6 or so (which doesn't exist actually) -- especially because I remembered an announcement on archlinux.org saying there was a netcfg update (it was to 2.5.2).<br />
<br />
Is it needed? Can it be, say, green instead of "SOMETHING IS WRONG" red? What if it just said the fact, "This document refers to netcfg 2.5.x"? Or add "; using older versions is unsupported."<br />
<br />
[[User:Idupree|Idupree]] 18:24, 6 March 2010 (EST)<br />
<br />
I put it there at the time of release to alert people that it reflected the latest netcfg, v2.5. That was in case people with older versions came to the wiki. Now 2.5 has been in [core] for a little while, I think it's probably safe to just remove it entirely - it's assumed that the wiki should reflect the latest version. <br />
<br />
[[User:Iphitus|Iphitus]] 20:13, 6 March 2010 (EST)<br />
<br />
== ad-hoc mode suggested configuration does not work ==<br />
<br />
The suggested configuration suggested by this wiki page in order to manage ad-hoc mode connection does not work. It fails see [https://bbs.archlinux.org/viewtopic.php?pid=869940 TOPIC (netcfg 2.5 PRE_UP problem)]. I don't know what should be done. Option 1 is to mention that managing ad-hoc mode is not a feature of netcfg. Option 2: ad-hoc mode does not work natively with netcfg but you could use the following workaround, for example for dhcp connection WEP encrypted using ad-hoc mode:<br />
<br />
CONNECTION="ethernet"<br />
DESCRIPTION="wireless connection to android tether"<br />
INTERFACE=wlan0<br />
IP="dhcp"<br />
PRE_UP="iwconfig wlan0 essid AndroidTether mode Ad-Hoc key s:password"<br />
<br />
With such a configuration it would though not be possible to run automatically the network at boot time using net-auto-wireless Deamon.<br />
<br />
[[User:manouchk|manouchk]] 15:30, 24 December 2010 (UTC-3)<br />
<br />
== Time to remove archassistant? ==<br />
<br />
This has not been in development since 2008. I suggest removing it from the page.<br />
[[User:Voidzero|Voidzero]] 10:54, 5 July 2011 (EDT)<br />
<br />
== Connecting automatically configuration change ==<br />
<br />
I spent some time troubleshooting my netcfg on a new machine, only to realize the new place for the "WIRELESS_INTERFACE" variable is /etc/conf.d/netcfg, and not /etc/rc.conf as this article suggests.<br />
<br />
Appears to be so according to this newspost: http://www.archlinux.org/news/netcfg-266-release/<br />
<br />
Would this be safe to change in the article then? Maybe a reference to the old way for older versions, as it is right now rc.conf is wrong for netcfg >= 2.6.6</div>HackBughttps://wiki.archlinux.org/index.php?title=Bitlbee&diff=142713Bitlbee2011-05-25T04:24:36Z<p>HackBug: Removed a redundant sentence</p>
<hr />
<div>{{i18n|Bitlbee}}<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Internet Applications (English)]]<br />
<br />
= About =<br />
<br />
[http://www.bitlbee.org/main.php/news.r.html Bitlbee] is a "console-based IRC to IM chatting gateway, including ICQ/MSN/Jabber". Basically, it allows the user to interact with popular chat networks (ICQ, MSN, Jabber, AIM, YIM) within their IRC client.<br />
<br />
The users' buddies appear as normal IRC users in a channel and conversations use the private message facility of IRC.<br />
<br />
<br />
= Setup =<br />
<br />
First, download and install the package using pacman:<br />
<br />
# pacman -S bitlbee<br />
<br />
Bitlbee can now run as a daemon of its own! Open up {{Filename|/etc/bitlbee/bitlbee.conf}} to browse through the settings. Uncomment the Runmode line and change it to the following.<br />
<br />
RunMode = ForkDaemon<br />
<br />
There is no need to run the bitlbee daemon as root so we should uncomment the following line so it can run as the "bitlbee" user created when the package was installed.<br />
<br />
User = bitlbee<br />
<br />
Now run<br />
<br />
/etc/rc.d/bitlbee start<br />
<br />
to start the Bitlbee server. Note that just starting the server does not log you in to any of your messenger accounts! You must join a channel and issue commands.<br />
<br />
You may also start bitlbee every time Arch Linux boots. To do so, just add the bitlbee entry in the file rc.conf as follows:<br />
<br />
DAEMONS=(... alsa cups '''bitlbee''' ...)<br />
<br />
(The three dots mean other daemons that run during bootup)<br />
<br />
= Configuration =<br />
You are now able to connect to this in an IRC client. To connect, just connect to localhost using your favorite IRC client.<br />
<br />
Hopefully this will connect and you should immediately join a channel called '&bitlbee'. When you join this channel it will tell to type 'Help' if you're new... type 'Help' ;)<br />
<br />
Read through the help offered by Bitlbee to get started. There are some great guides online too:<br />
<br />
http://quark.humbug.org.au/publications/internet/bitlbee.pdf<br />
<br />
http://princessleia.com/bitlbee.php<br />
<br />
= How to connect to Jabber using your Gmail account =<br />
In your control channel, do the following:<br />
account add jabber username@gmail.com mypasswd<br />
<br />
After root responds with "Account successfully added", you can check your accounts with "account list".<br />
<br />
<@user> account list <br />
<@root> 0. JABBER, username@gmail.com (connected) <br />
<@root> End of account list<br />
<br />
Set the server value of your gmail account:<br />
account 0 set server talk.google.com<br />
<br />
After you have added the account, type "account 0 on" and it should log in:<br />
<br />
<@user> account 0 on<br />
<@root> JABBER(username@gmail.com) - Logging in: Connecting <br />
<@root> JABBER(username@gmail.com) - Logging in: Connected <br />
<@root> JABBER(username@gmail.com) - Logging in: Requesting Authentication Method<br />
<@root> JABBER(username@gmail.com) - Logging in: Authenticating <br />
<@root> JABBER(username@gmail.com) - Logged in<br />
<br />
If you get errors like the following:<br />
<br />
<@user> account 0 on <br />
<@root> JABBER(username@gmail.com) - Logging in: Connecting<br />
<@root> JABBER(username@gmail.com) - Logging in: Connected<br />
<@root> JABBER(username@gmail.com) - Logging in: Requesting Authentication Method<br />
<@root> JABBER(username@gmail.com) - Logging in: Authenticating<br />
<@root> JABBER(username@gmail.com) - Login error: Error 403: Unknown error<br />
<@root> JABBER(username@gmail.com) - Signing off...<br />
<br />
Switching the domain from "gmail.com" to "googlemail.com" may help.<br />
This seems to be the case for some European countries, especially Germany where Google doesn't own the trademark for the name ''Gmail'' [http://www.theregister.co.uk/2007/01/31/google_looses_trademark_battle/].<br />
<br />
The easiest way to change your account settings is to simply delete the account you created and add it again.<br />
account 0 del<br />
account add jabber username@googlemail.com mypasswd<br />
or just use the `set` switch for the `account` command<br />
account list # find the id for your gtalk account, in this case I'll use '0'<br />
account 0 set # list all the possible settings for this account<br />
account 0 set username foo@gmail.com # change your username<br />
account 0 set password somethingverysecret # change your passphrase<br />
<br />
----<br />
<br />
Gmail uses ssl/tls (ie the url is '''https'''://mail.google.com/mail/) so you can enable it for some extra security. You'll need to change the connection port too. To do that, you'll need to be disconnected from that account.<br />
<@user> account 0 off<br />
<@root> jabber - Signing off..<br />
<@user> account 0 set ssl true<br />
<@root> ssl = `true'<br />
<@user> account 0 set port 5223<br />
<@root> port = `5223'<br />
Even if you dont do that the stream should change automatically<br />
<@user> account 0 on<br />
<@root> jabber - Logging in: Connecting<br />
<@root> jabber - Logging in: Connected to server, logging in<br />
<@root> jabber - Logging in: Converting stream to TLS<br />
...<br />
<br />
= See Also =<br />
[[Screen Irssi Bitlbee]]</div>HackBug