Friday, January 11, 2008

HOWTO: Figure out what's using your soundcard in Linux

It's 2008, and while Linux audio is getting better for desktop users, I still occasionally find myself running into a situation where one application is tying up my soundcard. Sometimes I'll try to run jackd through qjackctl and it'll fail because Firefox has a flash video loaded in it or something like that.

Anyways, to figure out what's using your soundcard on Linux, you can run:

sudo fuser -v /dev/dsp*
sudo fuser -v /dev/snd/*

The first command above will list all the OSS applications using your sound hardware, and the latter will tackle ALSA applications.

For example, if I run those commands with nothing running:

gamegod@home:~/$ sudo fuser -v /dev/dsp*
gamegod@home:~/$ sudo fuser -v /dev/snd/*
/dev/snd/controlC0: gamegod 6236 F.... mixer_applet2

The output above is showing me that GNOME's mixer applet is using the "control" interface on my soundcard. This won't interfere with any applications, so you can always safely keep this running.

As another example, if I run Mixxx (software for DJs) before running those commands, I'll see:

gamegod@home:~/$ sudo fuser -v /dev/dsp*
gamegod@home:~/$ sudo fuser -v /dev/snd/*
/dev/snd/controlC0: gamegod 6236 F.... mixer_applet2
/dev/snd/pcmC0D0p: gamegod 12936 F...m mixxx
/dev/snd/seq: gamegod 12936 F.... mixxx

This time the output above is showing me that Mixxx is using my soundcard's audio first ouput interface (pcmC0D0p corresponds to ALSA's hw:0,0), as well as ALSA's MIDI interface.


David Roberts said...

Very useful - thankyou.

zhengbin said...

Sie können sie bei finden, da es die thomas sabo gute Anlaufstelle für alle Overstock Schmuck Gutscheine thomas sabo shop und Gutscheincodes Overstock Schmuck ist.

wangyuyu said...

All that is beautiful poems and passages of life pandora beads things do not change;we change.sell your VALUE and keep your thoughts.
pandora bracelets think it ove today we have higher buildings and wider highways, pandora charms but shorter temperaments and narrower points of view;
pandora jewellery we spend more,but enjoy less; we have bigger houses,but smaller famillies; pandora uk we have more compromises,but less time; pandora 2010 we have more knowledge,but less judgment;
pandora shop we have more medicines,but less health; pandora sale we have multiplied out possessions,but reduced out values; cheap pandora we talk much,we love only a little,and we hate too much; pandora beads uk we reached the moon and came back,

Editions Brandon said...

Very useful. Today for the first time, I had an application using a sound card which I couldn't detect by lsof, but fuser worked fine.