Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:maw
alsa
alsa-lib-fix-input-source-as-capture.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File alsa-lib-fix-input-source-as-capture.diff of Package alsa
tree fc6b0b3b0c20 parent 652611f58008 author tiwai 1188391711 -7200 committer tiwai 1188391711 -7200 revision 2318 Handle "Input Source" as a capture element Some drivers use "Input Source" as the capture source mixer element because mixer abstraction layer can't handle multiple "Capture Source" elements. This patch adds a hack to handle Input Source as a capture route, and let mixer apps know that it's a capture stuff, at least. diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c --- a/src/mixer/simple_none.c +++ b/src/mixer/simple_none.c @@ -918,6 +918,19 @@ static int base_len(const char *name, se } p++; } + + /* Special case - handle "Input Source" as a capture route. + * Note that it's *NO* capture source. A capture source is split over + * sub-elements, and multiple capture-sources will result in an error. + * That's why some drivers use "Input Source" as a workaround. + * Hence, this is a workaround for a workaround to get the things + * straight back again. Sigh. + */ + if (!strcmp(name, "Input Source")) { + *type = CTL_CAPTURE_ROUTE; + return strlen(name); + } + return 0; } @@ -1629,7 +1642,12 @@ static int simple_add1(snd_mixer_class_t { unsigned int n; if (ctype == SND_CTL_ELEM_TYPE_ENUMERATED) { - type = CTL_GLOBAL_ENUM; + if (type == CTL_PLAYBACK_ROUTE) + type = CTL_PLAYBACK_ENUM; + else if (type == CTL_CAPTURE_ROUTE) + type = CTL_CAPTURE_ENUM; + else + type = CTL_GLOBAL_ENUM; break; } if (ctype != SND_CTL_ELEM_TYPE_BOOLEAN) @@ -1644,7 +1662,12 @@ static int simple_add1(snd_mixer_class_t case CTL_PLAYBACK_SWITCH: case CTL_CAPTURE_SWITCH: if (ctype == SND_CTL_ELEM_TYPE_ENUMERATED) { - type = CTL_GLOBAL_ENUM; + if (type == CTL_PLAYBACK_SWITCH) + type = CTL_PLAYBACK_ENUM; + else if (type == CTL_CAPTURE_SWITCH) + type = CTL_CAPTURE_ENUM; + else + type = CTL_GLOBAL_ENUM; break; } if (ctype != SND_CTL_ELEM_TYPE_BOOLEAN) @@ -1654,7 +1677,12 @@ static int simple_add1(snd_mixer_class_t case CTL_PLAYBACK_VOLUME: case CTL_CAPTURE_VOLUME: if (ctype == SND_CTL_ELEM_TYPE_ENUMERATED) { - type = CTL_GLOBAL_ENUM; + if (type == CTL_PLAYBACK_VOLUME) + type = CTL_PLAYBACK_ENUM; + else if (type == CTL_CAPTURE_VOLUME) + type = CTL_CAPTURE_ENUM; + else + type = CTL_GLOBAL_ENUM; break; } if (ctype != SND_CTL_ELEM_TYPE_INTEGER)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor