Linux – find the Linux driver for headphones in the kernel tree

audiodriverslinux-kernel

I have headphones with three buttons on it which allow me to control my music player. I want to write a driver to make it control my music player on my pc (Ubuntu Linux).

So I think I should write a special program for my device. I have some basic knowledge about kernel programming and Linux device drivers. Who can tell me where I can find the default driver for headphones, or some ideas and suggestion are also appreciated.

Best Answer

If you don't have a USB headset your headset is typically handled by your normal audio driver, e.g. if you plug your headset in the driver will typically mute the speakers and use the headset output instead. Audio drivers nowadays are typically Alsa drivers and can be found in the sound directory of the Linux kernel.

If you have a USB headset it will be a dedicated soundcard and you would need to modify the driver for your specific USB headset.

To determine the specific driver for your soundcard use

lshw -v

and have a look at the Kernel driver in use: snd_hda_intel line or use lsmod to list your modules and determine your audio driver.

Related Question