From a printk in the soc driver:
SNDRV_CTL_IOCTL_ELEM_READ is 0xc2c85512
Is that correct?
Right, it means that the struct is aligned differently on between user- and kernel-spaces.
Could check the offset of each field, such as
printk("id = %d\n", offsetof(struct snd_ctl_elem_value, id)); printk("value = %d\n", offsetof(struct snd_ctl_elem_value, value)); printk("tstamp = %d\n", offsetof(struct snd_ctl_elem_value, tstamp)); printk("reserved = %d\n", offsetof(struct snd_ctl_elem_value, reserved));
for both kernel and user-spaces? I guess either it's a difference of pointer alignment or time_spec definition.
The output from printk("0x%x\n", SNDRV_CTL_IOCTL_ELEM_READ); printk("id = %d\n", offsetof(struct snd_ctl_elem_value, id)); printk("value = %d\n", offsetof(struct snd_ctl_elem_value, value)); printk("tstamp = %d\n", offsetof(struct snd_ctl_elem_value, tstamp)); printk("reserved = %d\n", offsetof(struct snd_ctl_elem_value, reserved));
in the kernel driver is
0xc2c85512 id = 0 value = 72 tstamp = 584 reserved = 592
and in the pcm test program the ouput of printk("0x%x\n", SNDRV_CTL_IOCTL_ELEM_READ); is
0xc2c45512
What is the difference? Which version of alsa is used/expected in the kernel?