mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
bluetooth: Let suspend-on-idle request audio in headset
When PA is doing gateway role, let module-suspend-on-idle resume the audio stream automatically. This will work until the user (or the remote side, which we also consider user-initiated) suspend the stream manually.
This commit is contained in:
parent
e492f2912e
commit
d84e36563c
1 changed files with 24 additions and 2 deletions
|
|
@ -1736,7 +1736,18 @@ static int add_sink(struct userdata *u) {
|
||||||
connect_ports(u, &data, PA_DIRECTION_OUTPUT);
|
connect_ports(u, &data, PA_DIRECTION_OUTPUT);
|
||||||
|
|
||||||
if (!bt_transport_is_acquired(u))
|
if (!bt_transport_is_acquired(u))
|
||||||
|
switch (u->profile) {
|
||||||
|
case PROFILE_A2DP:
|
||||||
|
case PROFILE_HSP:
|
||||||
|
data.suspend_cause = PA_SUSPEND_IDLE;
|
||||||
|
break;
|
||||||
|
case PROFILE_HFGW:
|
||||||
data.suspend_cause = PA_SUSPEND_USER;
|
data.suspend_cause = PA_SUSPEND_USER;
|
||||||
|
break;
|
||||||
|
case PROFILE_A2DP_SOURCE:
|
||||||
|
case PROFILE_OFF:
|
||||||
|
pa_assert_not_reached();
|
||||||
|
}
|
||||||
|
|
||||||
u->sink = pa_sink_new(u->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY);
|
u->sink = pa_sink_new(u->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY);
|
||||||
pa_sink_new_data_done(&data);
|
pa_sink_new_data_done(&data);
|
||||||
|
|
@ -1799,7 +1810,18 @@ static int add_source(struct userdata *u) {
|
||||||
connect_ports(u, &data, PA_DIRECTION_INPUT);
|
connect_ports(u, &data, PA_DIRECTION_INPUT);
|
||||||
|
|
||||||
if (!bt_transport_is_acquired(u))
|
if (!bt_transport_is_acquired(u))
|
||||||
|
switch (u->profile) {
|
||||||
|
case PROFILE_HSP:
|
||||||
|
data.suspend_cause = PA_SUSPEND_IDLE;
|
||||||
|
break;
|
||||||
|
case PROFILE_A2DP_SOURCE:
|
||||||
|
case PROFILE_HFGW:
|
||||||
data.suspend_cause = PA_SUSPEND_USER;
|
data.suspend_cause = PA_SUSPEND_USER;
|
||||||
|
break;
|
||||||
|
case PROFILE_A2DP:
|
||||||
|
case PROFILE_OFF:
|
||||||
|
pa_assert_not_reached();
|
||||||
|
}
|
||||||
|
|
||||||
u->source = pa_source_new(u->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY);
|
u->source = pa_source_new(u->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY);
|
||||||
pa_source_new_data_done(&data);
|
pa_source_new_data_done(&data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue