3

A little while ago I searched for a good driver for my sound card (with surround sound support) and didn't find any. So it seems there is none.

I thought I could try (even though I think nothing useful will be produced) writing my own driver for it.

Now I'm a little bit stuck, because I don't even know where sound drivers run. I could imagine that they run in kernel space and I have to write them as "regular" kernel drivers. But I could also imagine that they are build into ALSA and I have to look at the ALSA API.

Where is a good starting point to search how to start doing this.

5
  • ALSA. They're kernel modules.
    – mikeserv
    Commented Mar 12, 2014 at 17:16
  • What sound card is this?
    – CL.
    Commented Mar 12, 2014 at 17:36
  • It's a Logitech G35 Headset with USB connector. Which has (like i understand it) a built in sound card. The Headset works, but the surround sound doesn't work.
    – Kritzefitz
    Commented Mar 12, 2014 at 17:40
  • 1
    The Logitech G35 hardware is a plain stereo device. Surround sound is downmixed in the Windows driver. If you want to have the same functionality in Linux, you have to add it as an affect to PulseAudio.
    – CL.
    Commented Mar 12, 2014 at 19:23
  • Thanks that helped very much solving my original problem.
    – Kritzefitz
    Commented Mar 12, 2014 at 20:29

2 Answers 2

2

Sound drivers live in the sound directory of the kernel source.

For writing a sound driver, see Linux Device Drivers and Writing an ALSA Driver.

2
  • I think he was asking about the actual binary drivers, not the sources of the drivers. Commented Mar 12, 2014 at 17:43
  • @FaheemMitha: The answer is perfectly fine.
    – Kritzefitz
    Commented Mar 12, 2014 at 17:48
0

All USB headphones should work with basic features (audio out and mic in) with the standard Linux USB audio driver (snd_usb_audio). If your specific headphone is not mentioned as supported, you will lose certain extra features like active noise cancellation, surround sound emulation, etc. Take a look in this wiki, and for surround, this help page. If you have this driver installed, and most probably you do, and you still don't hear anything, keep in mind that your USB headphones would appear as a second sound card, and you may have to play with PulseAudio to stream your audio to them. I think pavucontrol is a good place to start to see if you can avoid complex setup. If you do not use PulseAudio, it is a good day to start - plain ALSA will not play well with complex setups when you have many input and output audio streams.

Writing your own driver is not a trivial task. Apart that you'll need to familiarize with some parts of the kernel source, you should take these two things into account:

1) Companies don't give technical documentation. You'll need to resort to reverse engineering in order to discover how it works internally.

2) For the aforementioned advanced features, you will need to have some good expertize in Digital Signal Processing field.

But if you like experimenting and/or if you are interested in software engineering, it is a very rewarding experience.

PS: yes, they are "regular" device drivers running in kernel-space, but also yes, you'll have to also interface your driver with the ALSA API (which is also in kernel space).

Not the answer you're looking for? Browse other questions tagged .