bluez5: set channel information for hfp/hsp transports

Fixes volume problems.
This commit is contained in:
Pauli Virtanen 2021-03-02 22:15:21 +02:00
parent 04a13471fb
commit 302282ef59
3 changed files with 9 additions and 0 deletions

View file

@ -1117,6 +1117,9 @@ static DBusHandlerResult hsphfpd_parse_endpoint_properties(struct spa_bt_backend
else else
t->codec = HFP_AUDIO_CODEC_CVSD; t->codec = HFP_AUDIO_CODEC_CVSD;
t->n_channels = 1;
t->channels[0] = SPA_AUDIO_CHANNEL_MONO;
t->enabled = true; t->enabled = true;
spa_bt_device_connect_profile(t->device, t->profile); spa_bt_device_connect_profile(t->device, t->profile);

View file

@ -39,6 +39,7 @@
#include <spa/support/plugin.h> #include <spa/support/plugin.h>
#include <spa/utils/type.h> #include <spa/utils/type.h>
#include <spa/utils/json.h> #include <spa/utils/json.h>
#include <spa/param/audio/raw.h>
#include "defs.h" #include "defs.h"
@ -144,6 +145,8 @@ static struct spa_bt_transport *_transport_create(struct rfcomm *rfcomm)
spa_list_append(&t->device->transport_list, &t->device_link); spa_list_append(&t->device->transport_list, &t->device_link);
t->profile = rfcomm->profile; t->profile = rfcomm->profile;
t->backend = backend; t->backend = backend;
t->n_channels = 1;
t->channels[0] = SPA_AUDIO_CHANNEL_MONO;
t->enabled = true; t->enabled = true;
spa_bt_transport_add_listener(t, &rfcomm->transport_listener, &transport_events, rfcomm); spa_bt_transport_add_listener(t, &rfcomm->transport_listener, &transport_events, rfcomm);

View file

@ -36,6 +36,7 @@
#include <spa/support/dbus.h> #include <spa/support/dbus.h>
#include <spa/support/plugin.h> #include <spa/support/plugin.h>
#include <spa/utils/type.h> #include <spa/utils/type.h>
#include <spa/param/audio/raw.h>
#include "defs.h" #include "defs.h"
@ -125,6 +126,8 @@ static struct spa_bt_transport *_transport_create(struct spa_bt_backend *backend
t->backend = backend; t->backend = backend;
t->profile = profile; t->profile = profile;
t->codec = codec; t->codec = codec;
t->n_channels = 1;
t->channels[0] = SPA_AUDIO_CHANNEL_MONO;
t->enabled = true; t->enabled = true;
finish: finish: