# Playing from &kde; I/O Slaves

## What are &kde; I/O Slaves

&kde; has a great way to access all kinds of data through a system known as I/O Slaves. They are little programs that let you represent many different sources of data as URL like addresses, and open them in &kde; programs like &konqueror; and &kplayer;. For example you can access a network host over SSH with a URL like `fish:/host/path/`, or a zip file with `zip:/home/cooldude/my.zip`.

## How &kplayer; uses them

Many of the &kde; I/O Slaves can return video and audio files and streams, for example `fish:`, `sftp:`, `webdav:`, `tar:`, `zip:`, `audiocd:` and so on. &kplayer; will play them just like any other type of file. By default it will pass the data directly to &mplayer; through a named pipe. If that does not work for any reason, you can tell &kplayer; to use a temporary file for playing from &kde; I/O Slaves on the Advanced page either globally in &kplayer; Settings or in individual File Properties. &kplayer; will then download the entire file into a temporary directory before playing it, which will consume some disk space temporarily, but will allow seeking and length detection.

Note that with the `audiocd` slave you will probably have to play the `.wav` files from the By Track directory, since &mplayer; currently fails to play `.cda` files. Or you can use a `cdda:` URLs instead.

## HTTP, FTP and Samba

The best way to play URLs that &mplayer; supports is by passing them on to &mplayer; directly. However, there will be cases where you need to use &kplayer; support for playing from &kde; I/O Slaves for those types of URLs.

For example, the &mplayer; folks managed to release &mplayer; 1.0-pre4 with FTP support and handling of encodable characters in URLs both broken all the way down. So if you use that version, you will need to enable the use of I/O Slave for FTP on the Advanced page in &kplayer; Settings, and if you need to play an HTTP URL with a space in it for example, you will need to turn on the HTTP I/O Slave on the Advanced page either for that individual URL in its File Properties, or globally for all HTTP URLs in &kplayer; Settings.

Also, Samba support is still listed as experimental in &mplayer;, so if it is not compiled into your &mplayer; or it is broken, go to the Advanced page in &kplayer; Settings and turn on the use of &kde; I/O Slaves for SMB URLs.

## Cache size

When playing directly from a &kde; I/O Slave, the Cache setting is important. It should not be too small so &mplayer; can detect the encoding type without discarding data, but on the other hand with large values it will take longer to fill the cache, especially with low bitrate streams like online radio stations.

&kplayer; uses one megabyte of cache by default, but in many cases you can go much lower than that, for example for most audio files 64 kilobytes is enough. The cache size can be set on the Advanced page either globally in &kplayer; Settings or in individual File Properties. Keep in mind that the global setting will also affect files played directly by &mplayer;, and changing it can cause unwanted side effects. For example, cache size lower than one megabyte has been found to cause AVI files take a few seconds to start playing.

## Playlists

When using a &kde; I/O Slave to play a playlist file, only the playlist file itself will be retrieved from the I/O Slave. All the URLs it contains will be played by &mplayer; directly. You have to give &kplayer; the URL contained in the playlist if you want it to be played through an I/O Slave.