mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:35:42 +01:00
Merged pcm2 branch.
This commit is contained in:
parent
228bf51025
commit
b77ca419f6
4 changed files with 535 additions and 512 deletions
|
@ -242,7 +242,7 @@ static char *mixer_help_text =
|
||||||
" F1 show Help screen\n"
|
" F1 show Help screen\n"
|
||||||
" F2 show /proc info screen\n"
|
" F2 show /proc info screen\n"
|
||||||
" Return return to main screen\n"
|
" Return return to main screen\n"
|
||||||
" Space toggle Record facility\n"
|
" Space toggle Capture facility\n"
|
||||||
" Tab toggle ExactMode\n"
|
" Tab toggle ExactMode\n"
|
||||||
" m M mute both channels\n"
|
" m M mute both channels\n"
|
||||||
" < > mute left/right channel\n"
|
" < > mute left/right channel\n"
|
||||||
|
@ -1575,10 +1575,12 @@ mixer_iteration (void)
|
||||||
case KEY_NPAGE:
|
case KEY_NPAGE:
|
||||||
mixer_set_delta(-5);
|
mixer_set_delta(-5);
|
||||||
break;
|
break;
|
||||||
|
#if 0
|
||||||
case KEY_BEG:
|
case KEY_BEG:
|
||||||
case KEY_HOME:
|
case KEY_HOME:
|
||||||
mixer_set_delta(100);
|
mixer_set_delta(100);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case KEY_LL:
|
case KEY_LL:
|
||||||
case KEY_END:
|
case KEY_END:
|
||||||
mixer_set_delta(-100);
|
mixer_set_delta(-100);
|
||||||
|
|
|
@ -340,8 +340,8 @@ static const char *speaker_position(int position)
|
||||||
static char str[32];
|
static char str[32];
|
||||||
|
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case SND_MIXER_VOICE_UNUSED:
|
case SND_MIXER_VOICE_UNKNOWN:
|
||||||
return "Unused";
|
return "Unknown";
|
||||||
case SND_MIXER_VOICE_MONO:
|
case SND_MIXER_VOICE_MONO:
|
||||||
return "Mono";
|
return "Mono";
|
||||||
case SND_MIXER_VOICE_LEFT:
|
case SND_MIXER_VOICE_LEFT:
|
||||||
|
@ -495,6 +495,7 @@ int show_element_info(void *handle, snd_mixer_eid_t *eid, const char *space)
|
||||||
error("Mixer %i/%i info error: %s", card, device, snd_strerror(err));
|
error("Mixer %i/%i info error: %s", card, device, snd_strerror(err));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
printf("%sInput/output voices: %i/%i\n", space, info.input_voices, info.output_voices);
|
||||||
switch (info.eid.type) {
|
switch (info.eid.type) {
|
||||||
case SND_MIXER_ETYPE_INPUT:
|
case SND_MIXER_ETYPE_INPUT:
|
||||||
case SND_MIXER_ETYPE_OUTPUT:
|
case SND_MIXER_ETYPE_OUTPUT:
|
||||||
|
@ -503,17 +504,10 @@ int show_element_info(void *handle, snd_mixer_eid_t *eid, const char *space)
|
||||||
info.data.io.attrib & SND_MIXER_EIO_DIGITAL ? " digital" : "");
|
info.data.io.attrib & SND_MIXER_EIO_DIGITAL ? " digital" : "");
|
||||||
}
|
}
|
||||||
for (idx = 0; idx < info.data.io.voices; idx++) {
|
for (idx = 0; idx < info.data.io.voices; idx++) {
|
||||||
if (!info.data.io.pvoices[idx].vindex) {
|
|
||||||
printf("%sVoice %i: %s\n",
|
printf("%sVoice %i: %s\n",
|
||||||
space,
|
space,
|
||||||
idx,
|
idx,
|
||||||
speaker_position(info.data.io.pvoices[idx].voice));
|
speaker_position(info.data.io.pvoices[idx].position));
|
||||||
} else {
|
|
||||||
printf("%sVoice %i: %i\n",
|
|
||||||
space,
|
|
||||||
idx,
|
|
||||||
info.data.io.pvoices[idx].voice);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SND_MIXER_ETYPE_CAPTURE1:
|
case SND_MIXER_ETYPE_CAPTURE1:
|
||||||
|
@ -554,14 +548,6 @@ int show_element_info(void *handle, snd_mixer_eid_t *eid, const char *space)
|
||||||
default:
|
default:
|
||||||
printf("unknown %i\n", info.data.switch3.type);
|
printf("unknown %i\n", info.data.switch3.type);
|
||||||
}
|
}
|
||||||
for (idx = 0; idx < info.data.switch3.voices; idx++) {
|
|
||||||
snd_mixer_voice_t voice = info.data.switch3.pvoices[idx];
|
|
||||||
if (voice.vindex) {
|
|
||||||
printf("%sVoice %i: %i\n", space, idx, voice.voice);
|
|
||||||
} else {
|
|
||||||
printf("%sSpeaker %i: %s\n", space, idx, speaker_position(voice.voice));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SND_MIXER_ETYPE_VOLUME1:
|
case SND_MIXER_ETYPE_VOLUME1:
|
||||||
for (idx = 0; idx < info.data.volume1.range; idx++) {
|
for (idx = 0; idx < info.data.volume1.range; idx++) {
|
||||||
|
@ -698,28 +684,17 @@ int show_element_contents(void *handle, snd_mixer_eid_t *eid, const char *space)
|
||||||
printf("%sSwitch is %s\n", space, element.data.switch2.sw ? "ON" : "OFF");
|
printf("%sSwitch is %s\n", space, element.data.switch2.sw ? "ON" : "OFF");
|
||||||
break;
|
break;
|
||||||
case SND_MIXER_ETYPE_SWITCH3:
|
case SND_MIXER_ETYPE_SWITCH3:
|
||||||
if (element.data.switch3.rsw != info.data.switch3.voices * info.data.switch3.voices) {
|
if (element.data.switch3.rsw != info.input_voices * info.output_voices) {
|
||||||
error("Switch3 !!!\n");
|
error("Switch3 !!!\n");
|
||||||
goto __end;
|
goto __end;
|
||||||
}
|
}
|
||||||
for (idx = 0; idx < element.data.switch3.rsw; idx++) {
|
for (idx = 0; idx < element.data.switch3.rsw; idx++) {
|
||||||
snd_mixer_voice_t input, output;
|
|
||||||
int val = snd_mixer_get_bit(element.data.switch3.prsw, idx);
|
int val = snd_mixer_get_bit(element.data.switch3.prsw, idx);
|
||||||
printf("%sInput <", space);
|
printf("%sInput <%i> Output <%i>: Switch is %s\n",
|
||||||
input = info.data.switch3.pvoices[idx / info.data.switch3.voices];
|
space,
|
||||||
output = info.data.switch3.pvoices[idx % info.data.switch3.voices];
|
idx / info.input_voices,
|
||||||
if (input.vindex) {
|
idx % info.output_voices,
|
||||||
printf("voice %i", input.voice);
|
val ? "ON" : "OFF");
|
||||||
} else {
|
|
||||||
printf(speaker_position(input.voice));
|
|
||||||
}
|
|
||||||
printf("> Output <");
|
|
||||||
if (output.vindex) {
|
|
||||||
printf("voice %i", output.voice);
|
|
||||||
} else {
|
|
||||||
printf(speaker_position(output.voice));
|
|
||||||
}
|
|
||||||
printf(">: Switch is %s\n", val ? "ON" : "OFF");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SND_MIXER_ETYPE_VOLUME1:
|
case SND_MIXER_ETYPE_VOLUME1:
|
||||||
|
|
974
aplay/aplay.c
974
aplay/aplay.c
File diff suppressed because it is too large
Load diff
|
@ -10,7 +10,7 @@ AC_PROG_INSTALL
|
||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
AC_PROG_YACC
|
AC_PROG_YACC
|
||||||
AM_PROG_LEX
|
AM_PROG_LEX
|
||||||
AM_PATH_ALSA(0.5.5)
|
AM_PATH_ALSA(0.6.0)
|
||||||
|
|
||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
|
|
Loading…
Reference in a new issue