pcm: add support for new STATUS_EXT ioctl

use STATUS_EXT ioctl if PCM protocol is > 2.0.12
All audio timestamp configuration will be ignored with an
older protocol.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Pierre-Louis Bossart 2015-07-01 15:40:56 -05:00 committed by Takashi Iwai
parent 6ec2464f39
commit cc8b73436a

View file

@ -510,11 +510,19 @@ static int snd_pcm_hw_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
{
snd_pcm_hw_t *hw = pcm->private_data;
int fd = hw->fd, err;
if (SNDRV_PROTOCOL_VERSION(2, 0, 13) > hw->version) {
if (ioctl(fd, SNDRV_PCM_IOCTL_STATUS, status) < 0) {
err = -errno;
SYSMSG("SNDRV_PCM_IOCTL_STATUS failed (%i)", err);
return err;
}
} else {
if (ioctl(fd, SNDRV_PCM_IOCTL_STATUS_EXT, status) < 0) {
err = -errno;
SYSMSG("SNDRV_PCM_IOCTL_STATUS_EXT failed (%i)", err);
return err;
}
}
if (SNDRV_PROTOCOL_VERSION(2, 0, 5) > hw->version) {
status->tstamp.tv_nsec *= 1000L;
status->trigger_tstamp.tv_nsec *= 1000L;