From e720c9380af22fb1eddfde3a6397f393a52cb586 Mon Sep 17 00:00:00 2001 From: dvdli Date: Wed, 15 Dec 2021 21:09:22 +0800 Subject: match the varaibles' type for 64-bit compatibility Since the variables are snd_pcm_uframes_t and snd_pcm_uframes_t is unsigned long, using unsigned int causes problem when running on a 64-bit binary. Also fix the branch name of googletest. --- WORKSPACE | 2 +- include/tinyalsa/pcm.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 02b57bf..133cfc5 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -3,5 +3,5 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") git_repository( name = "googletest", remote = "https://github.com/google/googletest", - branch = "master", + branch = "main", ) diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h index 5c11e2a..9fca92d 100644 --- a/include/tinyalsa/pcm.h +++ b/include/tinyalsa/pcm.h @@ -217,16 +217,16 @@ struct pcm_config { * silence_size : 0 */ /** The minimum number of frames required to start the PCM */ - unsigned int start_threshold; + unsigned long start_threshold; /** The minimum number of frames required to stop the PCM */ - unsigned int stop_threshold; + unsigned long stop_threshold; /** The minimum number of frames to silence the PCM */ - unsigned int silence_threshold; + unsigned long silence_threshold; /** The number of frames to overwrite the playback buffer when the playback underrun is greater * than the silence threshold */ - unsigned int silence_size; + unsigned long silence_size; - unsigned int avail_min; + unsigned long avail_min; }; /** Enumeration of a PCM's hardware parameters. -- cgit v1.2.3-70-g09d2 From 25096d382c46416c1546a26a8bd80ed1c62bcd08 Mon Sep 17 00:00:00 2001 From: dvdli Date: Wed, 15 Dec 2021 21:21:29 +0800 Subject: add ioctl to read IEC958 data --- src/mixer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mixer.c b/src/mixer.c index b4d96fd..afbc015 100644 --- a/src/mixer.c +++ b/src/mixer.c @@ -1047,6 +1047,9 @@ int mixer_ctl_get_array(const struct mixer_ctl *ctl, void *array, size_t count) } case SNDRV_CTL_ELEM_TYPE_IEC958: + ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); + if (ret < 0) + return ret; size = sizeof(ev.value.iec958); source = &ev.value.iec958; break; -- cgit v1.2.3-70-g09d2