Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have headphones with three buttons on them which allow me to control my music player with my phone. I want to write a driver for my headphones 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.

share|improve this question

2 Answers 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.

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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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