"hw",
N_("Analog Mono"),
"analog-mono",
- 1 },
+ 1,
+ "Master", "PCM",
+ "Capture", "Mic" },
{{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
"front",
N_("Analog Stereo"),
"analog-stereo",
- 10 },
+ 10,
+ "Master", "PCM",
+ "Capture", "Mic" },
{{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
"iec958",
N_("Digital Stereo (IEC958)"),
"iec958-stereo",
- 5 },
+ 5,
+ "IEC958", NULL,
+ "IEC958 In", NULL },
{{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
"hdmi",
N_("Digital Stereo (HDMI)"),
"hdmi-stereo",
- 4 },
+ 4,
+ "IEC958", NULL,
+ "IEC958 In", NULL },
{{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }},
"surround40",
N_("Analog Surround 4.0"),
"analog-surround-40",
- 7 },
+ 7,
+ "Master", "PCM",
+ "Capture", "Mic" },
{{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }},
"a52",
N_("Digital Surround 4.0 (IEC958/AC3)"),
"iec958-ac3-surround-40",
- 2 },
+ 2,
+ "Master", "PCM",
+ "Capture", "Mic" },
{{ 5, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
"surround41",
N_("Analog Surround 4.1"),
"analog-surround-41",
- 7 },
+ 7,
+ "Master", "PCM",
+ "Capture", "Mic" },
{{ 5, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
"surround50",
N_("Analog Surround 5.0"),
"analog-surround-50",
- 7 },
+ 7,
+ "Master", "PCM",
+ "Capture", "Mic" },
{{ 6, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
"surround51",
N_("Analog Surround 5.1"),
"analog-surround-51",
- 8 },
+ 8,
+ "Master", "PCM",
+ "Capture", "Mic" },
{{ 6, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
"a52",
N_("Digital Surround 5.1 (IEC958/AC3)"),
"iec958-ac3-surround-51",
- 3 },
+ 3,
+ "IEC958", NULL,
+ "IEC958 In", NULL },
{{ 8, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
"surround71",
N_("Analog Surround 7.1"),
"analog-surround-71",
- 7 },
+ 7,
+ "Master", "PCM",
+ "Capture", "Mic" },
- {{ 0, { 0 }}, NULL, NULL, NULL, 0 }
+ {{ 0, { 0 }}, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL }
};
snd_pcm_t *pa_alsa_open_by_device_id_auto(
snd_pcm_t *pcm,
snd_mixer_t **_m,
snd_mixer_elem_t **_e,
- const char *control_name) {
+ const char *control_name,
+ const pa_alsa_profile_info *profile) {
int err;
snd_mixer_t *m;
case SND_PCM_STREAM_PLAYBACK:
if (control_name)
e = pa_alsa_find_elem(m, control_name, NULL, TRUE);
+ else if (profile)
+ e = pa_alsa_find_elem(m, profile->playback_control_name, profile->playback_control_fallback, TRUE);
else
e = pa_alsa_find_elem(m, "Master", "PCM", TRUE);
break;
case SND_PCM_STREAM_CAPTURE:
if (control_name)
e = pa_alsa_find_elem(m, control_name, NULL, FALSE);
+ else if (profile)
+ e = pa_alsa_find_elem(m, profile->record_control_name, profile->record_control_fallback, FALSE);
else
e = pa_alsa_find_elem(m, "Capture", "Mic", FALSE);
break;
int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min);
-int pa_alsa_prepare_mixer(snd_mixer_t *mixer, const char *dev);
-snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const char *fallback, pa_bool_t playback);
-int pa_alsa_find_mixer_and_elem(snd_pcm_t *pcm, snd_mixer_t **_m, snd_mixer_elem_t **_e, const char *control_name);
-
typedef struct pa_alsa_profile_info {
pa_channel_map map;
const char *alsa_name;
const char *description; /* internationalized */
const char *name;
unsigned priority;
+ const char *playback_control_name, *playback_control_fallback;
+ const char *record_control_name, *record_control_fallback;
} pa_alsa_profile_info;
+int pa_alsa_prepare_mixer(snd_mixer_t *mixer, const char *dev);
+snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const char *fallback, pa_bool_t playback);
+int pa_alsa_find_mixer_and_elem(snd_pcm_t *pcm, snd_mixer_t **_m, snd_mixer_elem_t **_e, const char *control_name, const pa_alsa_profile_info*profile);
+
/* Picks a working profile based on the specified ss/map */
snd_pcm_t *pa_alsa_open_by_device_id_auto(
const char *dev_id,