Multimedia Support in the Linux Kernel
Kernel Preemption
Timers aren't the only items of interest in this section; you can also decide on the degree of preemption you intend for your kernel, but first, consider the topic of preemption in the Linux kernel.
As users' needs have become more sophisticated, their demands on computer hardware have become greater. Multitasking is an ordinary aspect of modern computing, and although multitasking is indeed a lovely thing, it also creates a world of concerns for multimedia production and playback. Without some sort of process control, applications will clash over access to system resources and services, causing audio dropouts, stuttering video, and even complete system lock-ups. Under normal circumstances, most users will be happy with a non-preemptive kernel, but if your applications need priority access to resources and services, the normal kernel scheduler might not suffice. Preemption is a way to guarantee an application's priority status, keeping other processes from interfering with its operations. For example, when I record with Ardour, I need to be absolutely certain that no other process is going to knock Ardour aside. The preemptive kernel saves the day.
Preemption is available in four modes. The first sets no preemption at all and is the default for servers. Voluntary preemption, the second mode, is the default for normal desktop use without timing-critical applications. The third option provides a low-latency system for users who want an optimal system for multimedia performance from applications such as games and audio/video players. The fourth choice, complete preemption, is for users who want a media production platform, either in a studio setting or as a real-time performance system. Your choice of preemption mode depends on your needs, so choose wisely. As you shall see, a preemptive kernel can have its own problems.
Device Drivers
Without the correct drivers, your shiny new cards and USB add-ons won't yield so much as a squawk, so again be sure you've selected the right drivers for your hardware. Although you can build all the available drivers as modules for the kernel to load as needed, if you must be conscientious about space, you can build only the modules you need for your current hardware. For a multimedia system, look closely at kernel support for your graphics hardware, video devices, and sound cards.
Kernel drivers for graphics adapters have code for hardware from various manufacturers. Just find your device and select the proper driver. However, bear in mind that these drivers work closely with the X Window System, and the overall performance of your graphics display(s) will be determined by the optimal combination of X and the kernel driver. Other potentially relevant options include /dev/agpgart support for older machines, a direct rendering management system for certain video chipsets, and support for framebuffer devices.
The default kernel sound system is from the Advanced Linux Sound Architecture project (ALSA). To activate sound support in the kernel, select the CONFIG_SOUND and CONFIG_SND options. Next, choose the driver corresponding to your sound hardware. This step is potentially confusing: Your sound card might not be listed, but its chipset could be supported by the ALSA drivers. For a complete list of supported devices tabulated by sound card, manufacturer, and chipset names, see the ALSA website's SoundCard Matrix.
If your sound hardware is connected to a USB port, you'll need to enable the CONFIG_SND_USB and CONFIG_SND_USB_AUDIO options. PCMCIA cards will require the CONFIG_SND_PCMCIA option, and similar options exist for sound support with PowerPC, Sparc, ARM, and other non-x86 Linux-capable platforms.
The kernel configuration utility lists Open Sound System (OSS) modules as deprecated, but they are still usable. The older OSS system can be employed if ALSA can't be used, but I would advise the use of the OSS/Free package [1] instead of the kernel's OSS modules. OSS/Free is now open source software, and the current package is an exceptionally stable and powerful alternative to ALSA. Also, it is easy to install and can be used within an otherwise ALSA-based system.
Multimedia Devices
The Multimedia Devices section includes essential support for video and radio capture devices. If you work with a webcam, a television card, or a radio tuner, you'll need to activate the video4linux (V4L) driver by selecting the CONFIG_VIDEO_DEV option. Recent kernels include extensive support for a variety of video capture devices, so be sure to scan the list of supported hardware. First select the relevant option(s), and be sure to enable the CONFIG_V4L_USB_DRIVERS option if you plan to use a USB-connected capture or encoding device.
As previously mentioned, the drivers section includes the option to build the driver for the enhanced real-time clock (CONFIG_SND_RTCTIMER). When this option is selected, you will be given the opportunity to declare RTC as the default timer for the ALSA sequencer (a MIDI dataflow manager). Consider this option a necessity. This section also includes an option for building the driver for an IEEE 1394 port, more familiarly known as the Firewire port. Firewire is an excellent data transfer protocol, designed to handle high-capacity streams, but Linux support is relatively new. This option includes a stable and an experimental driver; choose the option that best applies to your hardware.
Disk drive performance should be optimal. The drive type (IDE, SCSI) is not so important as it once was, but if your system includes IDE drives, you should check a few options in the subsection for ATA/ATAPI/MFM/RLL support. In the IDE/ATA/ATAPI Block Devices section, you need to find and accept the options for Generic PCI Bus-master DMA Support and Use PCI DMA By Default When Available. These options enable DMA (direct memory access) for your disks, which is helpful with low-latency disk-intensive work. However, even with these options, you might still need to optimize your disk performance with the hdparm utility. The following command enables 32-bit I/O and turns on DMA support for the IDE hard drive in my JAD 1.0 machine:
hdparm -c 1 -d 1 /dev/hda
For a status report on the indicated device, run the utility without parameters. Incidentally, if you know nothing about hdparm, its manual page is required reading before you use the tool. Some of hdparm's parameters are dangerous, but fortunately, you need only the two flags shown above to improve the performance of your IDE drives.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.