Lines Matching refs:jack
322 pa_alsa_jack *jack;
326 PA_HASHMAP_FOREACH(jack, u->jacks, state) {
330 port = pa_hashmap_get(u->card->ports, jack->name);
332 if (jack->path)
333 port = jack->path->port;
341 cpa = jack->plugged_in ? jack->state_plugged : jack->state_unplugged;
344 /* If a plugged-in jack causes the availability to go to NO, it
347 if (jack->plugged_in) {
357 /* Output is available through at least one jack, so go to that
359 * the jacks in case a jack is plugged in that forces the state to no
378 pa_alsa_jack *jack;
385 /* Changing the jack state may cause a port change, and a port change will
395 * We rerun this function when being unsuspended to catch up on jack state
405 pa_log_warn("Failed to read jack detection from '%s'", pa_strnull(snd_hctl_elem_get_name(elem)));
415 PA_HASHMAP_FOREACH(jack, u->jacks, state)
416 if (jack->melem == melem) {
417 pa_alsa_jack_set_plugged_in(jack, plugged_in);
420 /* When using UCM, pa_alsa_jack_set_plugged_in() maps the jack
425 /* When not using UCM, we have to do the jack state -> port
427 pa_assert_se(tp->port = jack->path->port);
650 pa_alsa_jack* jack;
656 PA_LLIST_FOREACH(jack, u->ucm.jacks)
657 if (jack->has_control)
658 pa_hashmap_put(u->jacks, jack, jack);
663 PA_LLIST_FOREACH(jack, path->jacks)
664 if (jack->has_control)
665 pa_hashmap_put(u->jacks, jack, jack);
669 PA_LLIST_FOREACH(jack, path->jacks)
670 if (jack->has_control)
671 pa_hashmap_put(u->jacks, jack, jack);
679 PA_HASHMAP_FOREACH(jack, u->jacks, state) {
680 if (!jack->mixer_device_name) {
681 jack->mixer_handle = pa_alsa_open_mixer(u->mixers, u->alsa_card_index, false);
682 if (!jack->mixer_handle) {
683 pa_log("Failed to open mixer for card %d for jack detection", u->alsa_card_index);
687 jack->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, jack->mixer_device_name, false);
688 if (!jack->mixer_handle) {
689 pa_log("Failed to open mixer '%s' for jack detection", jack->mixer_device_name);
693 pa_alsa_mixer_set_fdlist(u->mixers, jack->mixer_handle, u->core->mainloop);
694 jack->melem = pa_alsa_mixer_find_card(jack->mixer_handle, &jack->alsa_id, 0);
695 if (!jack->melem) {
696 pa_alsa_mixer_id_to_string(buf, sizeof(buf), &jack->alsa_id);
698 pa_alsa_jack_set_has_control(jack, false);
701 snd_mixer_elem_set_callback(jack->melem, report_jack_state);
702 snd_mixer_elem_set_callback_private(jack->melem, u);
703 report_jack_state(jack->melem, 0);
771 pa_alsa_jack *jack;
774 /* We were unsuspended, update jack state in case it changed while we were suspended */
775 PA_HASHMAP_FOREACH(jack, u->jacks, state) {
776 if (jack->melem)
777 report_jack_state(jack->melem, 0);