summaryrefslogtreecommitdiff
path: root/src/pcm/pcm_hw.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2015-07-01 15:40:56 -0500
committerTakashi Iwai <tiwai@suse.de>2015-07-02 17:02:04 +0200
commitcc8b73436a90c35beda64bfa13b2196df20cfd81 (patch)
tree59855f02b6b15d6cccb04d66322659deb822935a /src/pcm/pcm_hw.c
parent6ec2464f397ff401c251057499abea77fd80b60b (diff)
downloadalsa-lib-cc8b73436a90c35beda64bfa13b2196df20cfd81.tar.gz
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>
Diffstat (limited to 'src/pcm/pcm_hw.c')
-rw-r--r--src/pcm/pcm_hw.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index c34b766e..232b1973 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -510,10 +510,18 @@ 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 (ioctl(fd, SNDRV_PCM_IOCTL_STATUS, status) < 0) {
- err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_STATUS failed (%i)", err);
- return 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;