From 28533cb61560dafd0d78268248dd47ab1797ca20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Tue, 6 Sep 2022 12:13:14 +0200 Subject: [PATCH] bluez5: backend-native: Add a ModemManager dependency Some Linux phones doesn't use oFono but ModemManager to control the modem. --- meson_options.txt | 4 ++++ spa/meson.build | 4 ++++ spa/plugins/bluez5/meson.build | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/meson_options.txt b/meson_options.txt index 63b5e21af..b7c3d0e24 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -92,6 +92,10 @@ option('bluez5-backend-hfp-native', description: 'Enable HFP in native backend in bluez5 spa plugin', type: 'feature', value: 'enabled') +option('bluez5-backend-native-mm', + description: 'Enable ModemManager in native backend in bluez5 spa plugin', + type: 'feature', + value: 'disabled') option('bluez5-backend-ofono', description: 'Enable oFono HFP backend in bluez5 spa plugin (no dependency on oFono)', type: 'feature', diff --git a/spa/meson.build b/spa/meson.build index b3193241f..64cc7b310 100644 --- a/spa/meson.build +++ b/spa/meson.build @@ -66,6 +66,10 @@ if get_option('spa-plugins').allowed() summary({'Opus': opus_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs') lc3_dep = dependency('lc3', required : get_option('bluez5-codec-lc3')) summary({'LC3': lc3_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs') + if get_option('bluez5-backend-hsp-native').allowed() or get_option('bluez5-backend-hfp-native').allowed() + mm_dep = dependency('ModemManager', version : '>= 1.10.0', required : get_option('bluez5-backend-native-mm')) + summary({'ModemManager': mm_dep.found()}, bool_yn: true, section: 'Bluetooth backends') + endif endif avcodec_dep = dependency('libavcodec', required: get_option('ffmpeg')) jack_dep = dependency('jack', version : '>= 1.9.10', required: get_option('jack')) diff --git a/spa/plugins/bluez5/meson.build b/spa/plugins/bluez5/meson.build index 104a0d20e..190dc9013 100644 --- a/spa/plugins/bluez5/meson.build +++ b/spa/plugins/bluez5/meson.build @@ -10,6 +10,7 @@ cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', get_option('bluez5-backend-hfp-native').allowed()) cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', get_option('bluez5-backend-hsp-native').allowed()) cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', get_option('bluez5-backend-hfp-native').allowed()) +cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE_MM', get_option('bluez5-backend-native-mm').allowed()) cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', get_option('bluez5-backend-ofono').allowed()) cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', get_option('bluez5-backend-hsphfpd').allowed()) cdata.set('HAVE_BLUEZ_5_HCI', dependency('bluez', version: '< 6', required: false).found()) @@ -38,6 +39,9 @@ if get_option('bluez5-backend-hsp-native').allowed() or get_option('bluez5-backe if libusb_dep.found() bluez5_deps += libusb_dep endif + if mm_dep.found() + bluez5_deps += mm_dep + endif bluez5_sources += ['backend-native.c'] endif