History

ALSA: pcm: Add an ioctl to specify the supported protocol version

We have an ioctl to inform the PCM protocol version the running kernel supports, but there is no way to know which protocol version the user-space can understand. This lack of information caused headaches in the past when we tried to extend the ABI. For example, because we couldn't guarantee the validity of the reserved bytes, we had to introduce a new ioctl SNDRV_PCM_IOCTL_STATUS_EXT for assigning a few new fields in the formerly reserved bits. If we could know that it's a new alsa-lib, we could assume the availability of the new fields, thus we could have reused the existing SNDRV_PCM_IOCTL_STATUS. In order to improve the ABI extensibility, this patch adds a new ioctl for user-space to inform its supporting protocol version to the kernel. By reporting the supported protocol from user-space, the kernel can judge which feature should be provided and which not. With the addition of the new ioctl, the PCM protocol version is bumped to 2.0.14, too. User-space checks the kernel protocol version via SNDRV_PCM_INFO_PVERSION, then it sets the supported version back via SNDRV_PCM_INFO_USER_PVERSION.

Takashi Iwai committed 9 years ago

Commit 4b671f51 parent 532a7784 files · +11 −1Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/sound/asound.h+2−1
@@ -152,7 +152,7 @@ struct snd_hwdep_dsp_image { · 151 unmodified lines
152 * *152 * *
153 *****************************************************************************/153 *****************************************************************************/
154 154
155#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 13)155#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 14)
156 156
157typedef unsigned long snd_pcm_uframes_t;157typedef unsigned long snd_pcm_uframes_t;
158typedef signed long snd_pcm_sframes_t;158typedef signed long snd_pcm_sframes_t;
@@ -564,6 +564,7 @@ enum { · 405 unmodified lines
564#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)564#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
565#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)565#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
566#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)566#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
567#define SNDRV_PCM_IOCTL_USER_PVERSION _IOW('A', 0x04, int)
567#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)568#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
568#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)569#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
569#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)570#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t