From: Jaroslav Kysela Date: Thu, 21 Dec 2000 21:53:07 +0000 (+0000) Subject: S/PDIF related changes.. X-Git-Tag: v1.0.3~283 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=84f294a3b998219e118ceb54d314102bf2ba6fe7;p=alsa-utils.git S/PDIF related changes.. --- diff --git a/alsactl/alsactl.c b/alsactl/alsactl.c index 2e437e0..c63759c 100644 --- a/alsactl/alsactl.c +++ b/alsactl/alsactl.c @@ -309,22 +309,30 @@ static int get_control(snd_ctl_t *handle, snd_control_id_t *id, snd_config_t *to } } - if (info.type == SND_CONTROL_TYPE_BYTES) { - char buf[info.values_count * 2 + 1]; - char *p = buf; - char *hex = "0123456789abcdef"; - for (idx = 0; idx < info.values_count; idx++) { - int v = ctl.value.bytes.data[idx]; - *p++ = hex[v >> 4]; - *p++ = hex[v & 0x0f]; - } - *p = '\0'; - err = snd_config_string_add(control, "value", buf); - if (err < 0) { - error("snd_config_string_add: %s", snd_strerror(err)); - return err; + switch (info.type) { + case SND_CONTROL_TYPE_BYTES: + { + char buf[info.values_count * 2 + 1]; + char *p = buf; + char *hex = "0123456789abcdef"; + for (idx = 0; idx < info.values_count; idx++) { + int v = ctl.value.bytes.data[idx]; + *p++ = hex[v >> 4]; + *p++ = hex[v & 0x0f]; + } + *p = '\0'; + err = snd_config_string_add(control, "value", buf); + if (err < 0) { + error("snd_config_string_add: %s", snd_strerror(err)); + return err; + } + return 0; } + case SND_CONTROL_TYPE_IEC958: + error("An IEC958 control ignored"); return 0; + default: + break; } if (info.values_count == 1) { @@ -823,7 +831,7 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control) error("bad control.%d.value.%d content", numid, idx); return -EINVAL; } - ctl.value.integer.value[idx] = val; + ctl.value.bytes.data[idx] = val; break; default: break; diff --git a/aplay/aplay.c b/aplay/aplay.c index 35e5ee0..fe9b1af 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -86,7 +86,6 @@ static int verbose = 0; static int buffer_pos = 0; static size_t bits_per_sample, bits_per_frame; static size_t buffer_bytes; -int digital = SND_PCM_DIG_NONE; static int count; static int vocmajor, vocminor; @@ -404,10 +403,10 @@ int main(int argc, char *argv[]) interleaved = 0; break; case 'C': - digital = SND_PCM_DIG_AES_IEC958C; + // digital = SND_PCM_DIG_AES_IEC958C; break; case 'P': - digital = SND_PCM_DIG_AES_IEC958P; + // digital = SND_PCM_DIG_AES_IEC958P; break; default: fprintf(stderr, "Try `%s --help' for more information.\n", command); @@ -421,6 +420,9 @@ int main(int argc, char *argv[]) return 1; } +#if 1 +#warning "The S/PDIF code needs to be recoded.." +#else if (digital != SND_PCM_DIG_NONE) { snd_pcm_dig_params_t dig; memset(&dig, 0, sizeof(dig)); @@ -443,6 +445,7 @@ int main(int argc, char *argv[]) return 1; } } +#endif if (nonblock) { err = snd_pcm_nonblock(handle, 1);