[alsa-devel] Hardware-specific IOCTLs

Ivan Bublikov ivanbublikov at yahoo.com
Fri Jan 13 17:22:38 CET 2012

Message body
Hello All,
My question is about how to allocate a new hardware-specific IOCTL code. For example, the HDA driver consists of common HDA code and vendor-specific codes for various HDA codecs. As an HDA codec vendor, I want to be able to control some functionality in my codec, that is not present in codecs from other vendors. For this, I want to implement a special IOCTL in my vendor-specific code. I understand that I can register an IOCTL handler using snd_ctl_register_ioctl. My difficulty is how to define a code for my IOCTL and avoid a conflict with the common code in the future.
Looking at header files, I see  common "ALSA" audio IOCTLs starting with letter 'A', and "HWDEP" IOCTLs starting with letter 'H'. Some of H-IOCTLs are defined in asound.h, starting at offset 0, and some in hda_hwdep.h and sb16_csp.h starting at offset 0x10. My guess is that the latter start at 0x10 to give some expansion room for H-IOCTLs in asound.h...?
I think I need some offset range in H-IOCTLs or a new IOCTL family with another letter, officially reserved for such codec-specific IOCTLs. Any suggestions?
Best regards,

More information about the Alsa-devel mailing list