4

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.

2

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.

  • Controls on a USB headset usually work through HID, not the USB audio device. – Ignacio Vazquez-Abrams Jun 6 '12 at 4:31
0

Hardware controls on a wired audio output are handled by the sound card if at all, and it is that driver which you would need to look at.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.