[PATCH v2 06/10] bluetooth: Fix profile information in the SCO over PCM mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the SCO over PCM mode the HSP and HFGW profiles don't create any
sinks and sources, so n_sinks, n_sources, max_sink_channels and
max_source_channels should be 0.
---
 src/modules/bluetooth/module-bluetooth-device.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 77826d0..bfd0f99 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2216,10 +2216,14 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
     } else if (pa_streq(uuid, HSP_HS_UUID) || pa_streq(uuid, HFP_HS_UUID)) {
         p = pa_card_profile_new("hsp", _("Telephony Duplex (HSP/HFP)"), sizeof(enum profile));
         p->priority = 20;
-        p->n_sinks = 1;
-        p->n_sources = 1;
-        p->max_sink_channels = 1;
-        p->max_source_channels = 1;
+
+        if (!USE_SCO_OVER_PCM(u)) {
+            p->n_sinks = 1;
+            p->n_sources = 1;
+            p->max_sink_channels = 1;
+            p->max_source_channels = 1;
+        }
+
         pa_hashmap_put(input_port->profiles, p->name, p);
         pa_hashmap_put(output_port->profiles, p->name, p);
 
@@ -2228,10 +2232,14 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
     } else if (pa_streq(uuid, HFP_AG_UUID)) {
         p = pa_card_profile_new("hfgw", _("Handsfree Gateway"), sizeof(enum profile));
         p->priority = 20;
-        p->n_sinks = 1;
-        p->n_sources = 1;
-        p->max_sink_channels = 1;
-        p->max_source_channels = 1;
+
+        if (!USE_SCO_OVER_PCM(u)) {
+            p->n_sinks = 1;
+            p->n_sources = 1;
+            p->max_sink_channels = 1;
+            p->max_source_channels = 1;
+        }
+
         pa_hashmap_put(input_port->profiles, p->name, p);
         pa_hashmap_put(output_port->profiles, p->name, p);
 
-- 
1.8.3.1



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux