Blog

Sound mixing with the ALSA Dmix plugin instead of a soundserver

10.09.2005 at 10:34

Im quite sure you have already tried to play 2 or more sounds simultaneously, you probably got a message saying that /dev/dsp is busy that's because only one process can open the sound device at a time.

Of course there are different solutions to work around this problem. One possibility is to use a soundserver like aRtsd, EsoundD or jackd. Applications will no longer talk directly to the sound device, instead they will send their data to the soundserver which will then mixe several audio streams for playback by a single audio device.

However for my purpose a soundserver is overkill, there is another way to achieve the same thing with dmix which is a alsa plugin. I honestly don't know why they call it plugin because at least in my alsa it was already integrated and i just had to create a ~/.asoundrc configuration file to work with my sound chip (snd_intel8x0).

pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192
        rate 44100
    }

    bindings {
        0 0
        1 1
     }
}

pcm.dsp0 {
    type plug
    slave.pcm "dmixer"
}

pcm.!default {
    type plug
    slave.pcm "dmixer"
}

pcm.default {
    type plug
    slave.pcm "dmixer"
}

ctl.mixer0 {
    type hw
    card 0
}

The downside of this method is that you have to configure each sound application to use the alsa:dmix plugin. In xmms this can be done in the Preference window by choosing the "ALSA output plugin [libALSA.so]" and configuring it to use "plug:dmix" as audio device. For vlc you have to install an additionally package.

apt-get install vlc-plugin-alsa

Afterwards you can change your ~/.vlc/vlcrc to use the plugin.

[alsa] # ALSA audio output

# ALSA Device Name (string)
alsadev=plug:dmix

The correct settings for other applications can be found with google. This howto could also be of interest.

read more comments

Bootsplash on Debian Sid

05.09.2005 at 20:45

First of all i do normally not so much care about eye candy stuff, but recently my girlfriend told me that she found it quite boring to see the bootlog scrolling over the screen. And because i have never set up a bootsplash before i gave it a try.

Patching the kernel

First of all we need to patch our kernel, the patches can be found on bootsplash.org or bootsplash.de. They can be applied as usual.

cd /usr/src/linux;
patch -Np1 -i bootsplash.diff

Configuring the kernel

Afterwards we can configure our kernel with make menuconfig. The following options should be compiled in.

Code maturity level options  --->
 [*] Prompt for development and/or incomplete code/drivers
Processor type and features  --->
 [*] MTRR (Memory Type Range Register) support
Device Drivers  --->
 Block devices  --->
  <*> Loopback device support
  <*> RAM disk support
  (4096) Default RAM disk size
  [*]   Initial RAM disk (initrd) support
 Graphics support  --->
  [*] Support for frame buffer devices
  [*]   VESA VGA graphics support
  Console display driver support  --->
   [*]   Video mode selection support
   <*> Framebuffer Console support
   Bootsplash configuration  --->
    [*] Bootup splash screen

Userspace modifications

Next we have to set up some userspace tools, to accomplish this we add 2 temporary lines to our sources.list

cat >> /etc/apt/sources.list << "EOF"
 deb http://debian.bootsplash.de unstable main
 deb-src http://debian.bootsplash.de unstable main
EOF

Now we are ready to install a the needed packages.

apt-get install  bootsplash sysv-rc-bootsplash

Normally debconf should ask you a few questions and create a initrd.splash. However if this doesn't happen you can do it manually.

splash -s -f /etc/bootsplash/themes/default/config/bootsplash-1024x768.cfg > /boot/initrd.splash

Adjusting the bootloader

The last step is to adjust our bootloader configuration. Here are the relevant entries from my /boot/grub/menu.lst

title Debian GNU/Linux Sid / 2.6.13 splash
root(hd0,0)
kernel /linux-2.6.13-splash vga=791 splash=silent
initrd /initrd.splash

Enjoy your bootsplash.

read more comments

Storing aumix settings on restart

04.09.2005 at 11:48

I recently had the problem that the sound settings were not saved on reboot and therefore every time i needed sound i first had to adjust the volume with aumix. Over time this becomes annoying and so i investigated a few minutes to get rid of the problem.

It turns out that we have just to change one variable at the top of /etc/init.d/aumix and everything works as expected.

HANDLEALSA="yes"

For those wo haven't come in touch with sound in GNU/Linux i recommend reading this article which covers ALSA/OSS and sound daemons.

read more comments

Artwiz fonts in combination with fluxbox

28.08.2005 at 00:59

As you probably already know i am working with fluxbox and i wanted to use those pretty artwiz fonts. The installation is easy just follow the README file.

Do the following (example for gentoo):

    cd your_font_dir
    tar xvjf artwiz-aleczapka-<LANG>-<RELEASE>.tar.bz2
    cd artwiz-aleczapka-<LANG>-<RELEASE>
    fc-cache -fv ./

    Add this path to your /etc/X11/XF86Config config
    FontPath "your_font_dir/artwiz-aleczapka-<LANG>-<RELEASE>"

    and fontconfig config file (eg. /etc/fonts/local.conf)
    <dir>your_font_dir/artwiz-aleczapka-<LANG>-<RELEASE>:unscaled</dir>

    restart X

Your installation may vary depending on your distro.

But it seemed that fluxbox doesn't like them. The fonts were working in other applications such as terminals or torsmo but fluxbox yust ignored them and displayed an ugly default font. So first of all i made sure that i took a valid font, this can be done with xfontsel or xlsfonts.

xlsfonts | grep -i "artwiz"

I then selected one and pasted it into my fluxbox style file.

*.font: -artwiz-anorexia.de-medium-r-normal--11-110-75-75-p-90-iso8859-1

But the fonts didn't work until i switched off AntiAlias in the fluxbox configuration menu or by modifying ~/.fluxbox/init.

session.screen0.antialias:      false

Thanks to tenner from #fluxbox for pointing this out.

read more comments

Detecting unused Debian packages with deborphan and debfoster

27.08.2005 at 22:17

The Debian package management (apt & dpkg) is great, but under certain circumstances it keeps unused packages on the system.

For example if you install package A which requires B, B is normally automatically installed. However if you afterwards remove A, then B will be kept on the system although it could be removed because no other packages requires it.

With deborphan you can find all these packages which have no other packages depending on their installation. Another useful tool for almost the same purpose is debfoster which will ask you which of the installed packages you want to keep.

You can use the output of deborphan to remove the packages with apt.

deborphan | xargs apt-get -s -y remove

Hope the two tools help you to keep a clean Debian install.

read more comments

<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 >>