The KDE Multimedia Architecture

The KDE Multimedia Architecture

The KDE Multimedia Architecture Jeff Tranter [email protected] Abstract While much of the discussion focuses on Linux, keep in mind that KDE runs on several other operating systems, in some cases with a reduced level func- This paper and presentation will give an overview of tionality in the case of multimedia. It should also the new multimedia architecture introduced in KDE be noted that aRts itself is portable and can be 2.0. The emphasis will be on aRts, the Analog Real- built and used without KDE. Time Synthesizer that provides the foundation for multimedia on KDE. The presentation will describe All of the aRts libraries (which is the majority of the overall architecture of aRts, give details of the the code) are released under the GNU Lesser Gen- key aRts components such as structures, streams, eral Public License. This allows the libraries to be interfaces, instruments, and the sound server. It used for non-free or non-open source applications will briefly cover the aRts application programming if desired. Some of the programs, like the sound interface, and discuss the current state of multime- server, are released under the GNU General Public dia in KDE and some of the future plans. License. 1 Introduction 2 Overview and History This paper presents an overview of the multimedia KDE is the K Desktop Environment, a free, open architecture provided by KDE, with an emphasis on source graphical desktop for Linux and several other aRts, the Analog Real-Time Synthesizer. Unix-compatible operating systems. I first give some background on the history of aRts KDE version 1 had very limited multimedia sup- and multimedia on KDE. I then go over the KDE port. For KDE 2 it was recognized that multimedia multimedia architecture and key concepts. I will had become important on the desktop and a more give an example of the code for an aRts effects mod- powerful infrastructure was needed. The develop- ule, and show how it can be used from artsbuilder, ers took a look at what already existed, and came the interactive sound development tool for aRts. across the aRts project being developed by Stefan Westerfeld. I'll briefly review each of the KDE multimedia ap- plication programming interfaces (APIs), showing a Since 1997 Stefan had been working on a a real-time, few coding examples along the way. I'll also discuss modular system for sound synthesis. It had evolved strategies for porting existing multimedia applica- to include graphical elements built using KDE and tions to aRts. ran primarily on Linux. The project at this stage was quite complete, with a CORBA-based protocol, Finally, I'll review the current status of multime- dozens of audio effects modules, a graphical module dia on KDE, outline the plans for the future, and editing tool, C and C++ APIs, documentation, util- provide some references to more information. ities, and a mailing list and web site with a small group of developers. The material being presented assumes familiarity with C++ and the basic concepts behind digital au- Impressed by aRts, the KDE team decided to use dio. A few of the examples assume some knowledge it as the basis for the multimedia architecture for of developing for KDE as well. KDE 2.0. With this decision the pace of aRts de- aRts Foreign Apps directly using the artsdsp utility. aRts Native Apps C API KDE Extensions The sound server API is the main interface into the aRts services. It is built on top of other layers such as the streaming and flow system and MCOP Sound Server API transport. ArtsFlow flow/streaming KMedia2 At the lowest level are the kernel drivers for the sound hardware, which on Linux can be the OSS/- MCOP transport/object model/C+ binding Free, OSS/4Front (commercial), or ALSA drivers. Sound Drivers (OSS/Free, ALSA, etc.) In the next section we will describe many of the con- cepts and capabilities of the system in more detail. Figure 1: aRts Block Diagram velopment accelerated. Significant new effort took 4 aRts in Detail place, most notably the replacement of the CORBA code with an entirely new subsystem, MCOP, opti- mized for multimedia. The KDE applications were Before looking at the APIs we need to review the adapted to use the new sound system, and the sound major concepts in aRts, starting with the design server was integrated into the control center. Ver- goals. sion 0.4 of aRts was included in the KDE 2.0 re- lease. Work continues on aRts, improving performance 4.1 aRts Philosophy and Goals and adding new functionality. It should be noted that even though aRts is now a core component of KDE, it can be used without KDE, and is also be- aRts (note the capitalization) stands for Analog ing used for applications that go beyond traditional Real-Time Synthesizer, but its architecture can be multimedia. The project has also attracted some applied to any streaming media, not just sound. interest from the GNOME team, opening up the The system was designed to meet a number of goals: possibility that it may someday become the stan- dard multimedia architecture for both of the major desktop environments. 4.1.1 Modularity It is built on small building blocks called modules. 3 aRts Architecture One can dynamically build up complex audio pro- cessing tools by connecting these modules together. Typical modules include sound waveform genera- Figure 1 is a high level block diagram showing the tors, filters, audio effects, mixers, and playback of structure of aRts. At the the top of the diagram digital audio in different file formats. are the multimedia applications. Those written to use aRts directly (\Native Apps") make use of the sound server API and optionally the lower level APIs such as KMedia2 and artsflow. Applications 4.1.2 Portability not specifically written for aRts (\Foreign Apps") can still use the system using KDE extensions such as knotify and kaudioplayer. Applications writ- The core aRts code is not tied to any GUI toolkit. ten in C can use the C API (aRts and KDE are It is written in C++ and runs on multiple operating written in C++). As we will see later, there are systems. The programming interfaces are defined in also facilities to run existing non-aRts applications a language-independent way using IDL. 4.1.3 High Performance ority so that clicks or dropouts can generally be avoided. It also has parameters that can be ad- justed to balance the tradeoff between CPU usage, Components of aRts communicate using a response time, and probability of dropouts. lightweight protocol called MCOP (Multimedia COmmunication Protocol). It provides network The sound server will also suspend itself if idle for transparency, low latency, and authentication. a configurable period of time or from a command. Since it frees up the sound device when suspended, this is one way to run legacy applications (but gen- 4.1.4 Rich Functionality erally only as a last resort; we'll discuss this later). The system provides high-level multimedia capabil- ities, simplifying the development of applications. 4.3 Modules and Ports As new capabilities are added, such as support for new file formats, applications can automatically take advantage of these features. Modules in aRts are small self-contained compo- nents that do one thing. Their interfaces are de- fined in IDL. Modules have input and output ports 4.2 Sound Server through which multimedia streams can pass. Like C++ classes, they can have attributes and can im- plement methods. Typical multimedia applications that use sound di- rectly open and access the hardware devices such aRts comes with several dozen predefined mod- as /dev/dsp to record and play back audio. Only ules for performing functions such as mixing and one application can open this device at a time, how- arithmetic functions, delays, effects (tremolo, re- ever. This causes a problem in a desktop environ- verb, echo), filters, waveform synthesis, and MIDI. ment where multiple applications may want to use It is straightforward to develop new modules. We the sound resources concurrently. For example, the will look at an example of a module later. user may have associated sounds with window man- ager events, a mail client may play a sound to notify of new mail, and the user may want to listen to an 4.4 Structures MP3 file. The solution to this is to use a centralized sound server which accepts requests from multiple applications, mixes the audio together, and sends it Modules can be connected together dynamically to to the sound hardware. In aRts, the sound server build up structures. The artsbuilder application is artsd, and one and only only copy of artsd is lets you graphically build up structures, save them normally executing when a user is running KDE. as data files, and send them to the sound server to be executed. A typical structure could implement Using a central sound server also makes it easier an effect such as reverb by using modules for delay, to support network transparency, where the sound filtering, and mixing of audio streams. A screen shot server can be on a different host from where the ap- of artsbuilder is shown in Figure 4. plication is running. This means, for example, that if you redirect the X11 display for an application, the sound can also be routed to the machine where the display, mouse, and keyboard reside. 4.5 Busses The sound server has a number of options which can be adjusted (either from the command line or the Busses allow one to dynamically connect modules KDE sound server control panel) but typically as a and structures using named connections.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    13 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us