temp/pulseaudio: fork for Bluetooth HFP/HSP support (MR 3080)
PulseAudio is used for handling all audio on postmarketOS.
This also involves Bluetooth audio such as A2DP, HSP and HFP audio.
In the case of HFP/HSP, the HF and AG can interact with each other
through AT commands defined in the Bluetooth HFP 1.8 spec.
This set of patches implements HFP support to allow Bluetooth devices
to accept/reject/hangup calls, dial numbers, DTMF tone generation,
query signal strength, roaming status, service status, AG battery level,
call status, etc.
More details in the upstream MR:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/693
Available in edge for testing this merge request with a broader user
base. Not intended for backporting to stable branches.
[ci:skip-build]: already built successfully in CI
2022-04-19 13:57:59 +00:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
# Copyright 1999-2011 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Header: /var/cvsroot/gentoo-x86/media-sound/pulseaudio/files/pulseaudio.init.d-5,v 1.1 2011/03/27 16:58:49 ssuominen Exp $
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
need localmount
|
|
|
|
use net
|
|
|
|
|
|
|
|
local script="/etc/pulse/system.pa"
|
|
|
|
|
|
|
|
for opt in ${PA_OPTS}; do
|
|
|
|
case "$opt" in
|
|
|
|
--file=*) script="${opt#*=}" ;;
|
|
|
|
-F*) script="${opt#-F}" ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
config "$script"
|
|
|
|
|
|
|
|
local needs="$(get_options need)"
|
|
|
|
if [ -n "${needs}" ]; then
|
|
|
|
need ${needs}
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2023-10-14 22:04:04 +00:00
|
|
|
if grep -E -q '^[[:space:]]*load-module[[:space:]]+module-console-kit' "$script"; then
|
temp/pulseaudio: fork for Bluetooth HFP/HSP support (MR 3080)
PulseAudio is used for handling all audio on postmarketOS.
This also involves Bluetooth audio such as A2DP, HSP and HFP audio.
In the case of HFP/HSP, the HF and AG can interact with each other
through AT commands defined in the Bluetooth HFP 1.8 spec.
This set of patches implements HFP support to allow Bluetooth devices
to accept/reject/hangup calls, dial numbers, DTMF tone generation,
query signal strength, roaming status, service status, AG battery level,
call status, etc.
More details in the upstream MR:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/693
Available in edge for testing this merge request with a broader user
base. Not intended for backporting to stable branches.
[ci:skip-build]: already built successfully in CI
2022-04-19 13:57:59 +00:00
|
|
|
needs="${needs} consolekit"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#ifdef UDEV
|
2023-10-14 22:04:04 +00:00
|
|
|
if grep -E -q '^[[:space:]]*load-module[[:space:]]+module-udev-detect' "$script"; then
|
temp/pulseaudio: fork for Bluetooth HFP/HSP support (MR 3080)
PulseAudio is used for handling all audio on postmarketOS.
This also involves Bluetooth audio such as A2DP, HSP and HFP audio.
In the case of HFP/HSP, the HF and AG can interact with each other
through AT commands defined in the Bluetooth HFP 1.8 spec.
This set of patches implements HFP support to allow Bluetooth devices
to accept/reject/hangup calls, dial numbers, DTMF tone generation,
query signal strength, roaming status, service status, AG battery level,
call status, etc.
More details in the upstream MR:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/693
Available in edge for testing this merge request with a broader user
base. Not intended for backporting to stable branches.
[ci:skip-build]: already built successfully in CI
2022-04-19 13:57:59 +00:00
|
|
|
needs="${needs} udev"
|
|
|
|
fi
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef AVAHI
|
2023-10-14 22:04:04 +00:00
|
|
|
if grep -E -q '^[[:space:]]*load-module[[:space:]]+module-zeroconf-publish' "$script"; then
|
temp/pulseaudio: fork for Bluetooth HFP/HSP support (MR 3080)
PulseAudio is used for handling all audio on postmarketOS.
This also involves Bluetooth audio such as A2DP, HSP and HFP audio.
In the case of HFP/HSP, the HF and AG can interact with each other
through AT commands defined in the Bluetooth HFP 1.8 spec.
This set of patches implements HFP support to allow Bluetooth devices
to accept/reject/hangup calls, dial numbers, DTMF tone generation,
query signal strength, roaming status, service status, AG battery level,
call status, etc.
More details in the upstream MR:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/693
Available in edge for testing this merge request with a broader user
base. Not intended for backporting to stable branches.
[ci:skip-build]: already built successfully in CI
2022-04-19 13:57:59 +00:00
|
|
|
needs="${needs} avahi-daemon"
|
|
|
|
fi
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef BLUETOOTH
|
2023-10-14 22:04:04 +00:00
|
|
|
if grep -E -q '^[[:space:]]*load-module[[:space:]]+module-bt-proximity' "$script"; then
|
temp/pulseaudio: fork for Bluetooth HFP/HSP support (MR 3080)
PulseAudio is used for handling all audio on postmarketOS.
This also involves Bluetooth audio such as A2DP, HSP and HFP audio.
In the case of HFP/HSP, the HF and AG can interact with each other
through AT commands defined in the Bluetooth HFP 1.8 spec.
This set of patches implements HFP support to allow Bluetooth devices
to accept/reject/hangup calls, dial numbers, DTMF tone generation,
query signal strength, roaming status, service status, AG battery level,
call status, etc.
More details in the upstream MR:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/693
Available in edge for testing this merge request with a broader user
base. Not intended for backporting to stable branches.
[ci:skip-build]: already built successfully in CI
2022-04-19 13:57:59 +00:00
|
|
|
needs="${needs} bluetooth"
|
|
|
|
fi
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ALSA
|
2023-10-14 22:04:04 +00:00
|
|
|
if grep -E -q '^[[:space:]]*load-module[[:space:]]+module-alsa-(sink|source)' "$script" ||
|
|
|
|
grep -E -q '^[[:space:]]*load-module[[:space:]]+module-(udev-)?detect' "$script" ||
|
|
|
|
grep -E -q '^[[:space:]]*add-autoload-source[[:space:]]+(input|output)[[:space:]]+module-alsa-(sink|source)' "$script"; then
|
temp/pulseaudio: fork for Bluetooth HFP/HSP support (MR 3080)
PulseAudio is used for handling all audio on postmarketOS.
This also involves Bluetooth audio such as A2DP, HSP and HFP audio.
In the case of HFP/HSP, the HF and AG can interact with each other
through AT commands defined in the Bluetooth HFP 1.8 spec.
This set of patches implements HFP support to allow Bluetooth devices
to accept/reject/hangup calls, dial numbers, DTMF tone generation,
query signal strength, roaming status, service status, AG battery level,
call status, etc.
More details in the upstream MR:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/693
Available in edge for testing this merge request with a broader user
base. Not intended for backporting to stable branches.
[ci:skip-build]: already built successfully in CI
2022-04-19 13:57:59 +00:00
|
|
|
needs="${needs} alsa" # in Alpine install alsa-utils to provide /etc/init.d/alsa (not alsasound as in Gentoo).
|
|
|
|
fi
|
|
|
|
#endif
|
|
|
|
|
|
|
|
need "${needs}"
|
|
|
|
save_options need "${needs}"
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
if [ -z "${PULSEAUDIO_SHOULD_NOT_GO_SYSTEMWIDE}" ]; then
|
|
|
|
eerror "Please don't use system wide PulseAudio unless you read the"
|
|
|
|
eerror "documentation available at http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
|
|
|
|
eerror ""
|
|
|
|
eerror "When you're done, please set the variable PULSEAUDIO_SHOULD_NOT_GO_SYSTEMWIDE in"
|
|
|
|
eerror "/etc/conf.d/pulseaudio . Please remember that upstream does not support this mode"
|
|
|
|
eerror "when used for standard desktop configurations."
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
ebegin "Starting pulseaudio"
|
|
|
|
PA_ALL_OPTS="${PA_OPTS} --fail=1 --daemonize=1 --system"
|
|
|
|
start-stop-daemon --start --exec /usr/bin/pulseaudio -- ${PA_ALL_OPTS}
|
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
ebegin "Stopping pulseaudio"
|
|
|
|
start-stop-daemon --stop --quiet --exec /usr/bin/pulseaudio --pidfile /var/run/pulse/pid
|
|
|
|
eend $?
|
|
|
|
}
|