# Basic configuration

As a general rule, the initial &kplayer; settings are chosen for optimal performance and playback, so no additional setup is needed. However, in some cases changing the initial settings can improve &kplayer; performance.

## Video setup

XVideo is the video output &kplayer; uses by default. For many systems this is the optimal choice. Make sure your X Server has XVideo extension enabled. Look in your `/etc/X11/xorg.conf` or `/etc/X11/XF86Config-4` file for a line that reads

`Load "extmod"`

This is the line that loads the XVideo extension, so make sure it is not disabled. Also check `/var/log/Xorg.0.log` or `/var/log/XFree86.0.log` to make sure that XVideo is loaded without error.

If &kplayer; cannot use XVideo for any reason, it will fall back on using X11 video output in the default configuration. X11 output is OK except it forces the use of software scaler, which will consume significantly more processor cycles, and it does not support changing contrast, brightness, hue and saturation, so those controls will not be functional.

Depending on your video card, you may find that a different &mplayer; video output type(s) work better for you. For example you can try VIDIX output if you have a Matrox or ATI card. For Matrox cards there is also XMGA output.

Add a section for your video card

However, some video outputs may not support embedding video into &kplayer; and will open their own window instead. Those video outputs are not recommended.

You can change the video output type on the Video page in &kplayer; Settings, and optionally tell &kplayer; to fall back on other video outputs if the one you choose fails.

## Audio setup

The optimal audio outputs to use with &kplayer; are OSS (the default) and ALSA (recommended when present).

If you see that &kplayer; cannot use the audio output you have chosen, it is usually because another program has locked the audio device. If you find that `/dev/dsp` is locked, the chief suspect usually is &artsd;. Run

``killall` artsd`

and then try playing a file with &kplayer; again. If that works, the permanent solution is to disable &arts; through &kcontrolcenter;. There is an option to tell &artsd; to unlock the device after so many seconds of inactivity, but setting it to 0 seconds or 1 second has not been found to work. If you disable &arts; but not remove it from the system, some programs will still start it, but normally it will then at least not lock the audio device. Another program that may lock the audio device is Mozilla and its derivatives and successors. Just use &konqueror; instead.

ARTS and SDL audio outputs are not recommended since they will cause stability problems, degraded performance and a broken volume control.

You can change the audio output type on the Audio page in &kplayer; Settings, and optionally tell &kplayer; to fall back on other audio outputs if the one you choose fails.

## &mplayer; setup

Depending on how you installed &mplayer; you may have gotten a global `mplayer.conf` file in a directory like `/etc/mplayer`. The local version of that file is `~/.mplayer/config`. Make sure that those files do not have a `gui=yes` option. Remove or comment it out if you find it. If you ever want to use &mplayer;'s own GUI (not recommended), you can get it by running `gmplayer`.

Also make sure there are no other options that may interfere with &kplayer; operation. If you see any, either comment them out or override them in &kplayer; Settings. For example, the recommended cache size is one megabyte, although you can use a different size depending on the type of media you are going to play, as discussed for example in Online Radio and TV micro-HOWTO.

## Smooth playback

A while ago Arpi wrote a Fine-tuning &mplayer; article where you can find more useful tips on optimizing &mplayer;.

One thing you can do to get smoother playback is enable the hardware RTC timer. Run

``echo` 1024 > `/proc/sys/dev/rtc/max-user-freq``

as root, and also make sure `/dev/rtc` is user readable.

Arpi also recommends trying options like `-mc 0.001` and `-autosync 30`. Put them into the Additional command line arguments field on the Advanced page in &kplayer; Settings and see if they make a noticeable difference for you.

The `-vop` &mplayer; option has since been replaced by the `-vf` option, so that section of the article may be somewhat obsolete or the tips may need some adjustment for the current &mplayer;.

## Previews in the Open File dialog

There is some obsolete &kde; based software, like &kaboodle;, that tells &kde; that it wants to be used for previewing media files, even those it does not support, in the standard Open File dialog, which is what &kplayer; uses. This makes browsing directories with media files painfully slow, and unfortunately there is no option to turn off previewing selectively for certain file types. Even if you turn off the Play automatically option, the preview program will still be loaded. The workaround is to either turn off previewing in &kplayer; entirely if you don't need it, or remove the offending program from your system.

## Previewing files in &kmldonkey;

The recent official &mldonkey; GUIs have been badly broken, leaving &kmldonkey; as the most usable, albeit crashy, &mldonkey; frontend. &kmldonkey; supports embedding of &kplayer; for previewing files, but it is recommended that you change your mldonkey_preview script to start the full &kplayer; for previewing partial downloads, since that will give better interface and more options. If &mplayer; cannot play a partial download, probably nothing else will, so just wait for a larger chunk to get downloaded.