mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-20 01:40:08 -05:00
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:
parent
6ec2464f39
commit
cc8b73436a
1 changed files with 12 additions and 4 deletions
|
|
@ -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;
|
snd_pcm_hw_t *hw = pcm->private_data;
|
||||||
int fd = hw->fd, err;
|
int fd = hw->fd, err;
|
||||||
if (ioctl(fd, SNDRV_PCM_IOCTL_STATUS, status) < 0) {
|
if (SNDRV_PROTOCOL_VERSION(2, 0, 13) > hw->version) {
|
||||||
err = -errno;
|
if (ioctl(fd, SNDRV_PCM_IOCTL_STATUS, status) < 0) {
|
||||||
SYSMSG("SNDRV_PCM_IOCTL_STATUS failed (%i)", err);
|
err = -errno;
|
||||||
return err;
|
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) {
|
if (SNDRV_PROTOCOL_VERSION(2, 0, 5) > hw->version) {
|
||||||
status->tstamp.tv_nsec *= 1000L;
|
status->tstamp.tv_nsec *= 1000L;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue