summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanchayan Maity <sanchayan@asymptotic.io>2021-01-22 16:26:52 +0530
committerSanchayan Maity <sanchayan@asymptotic.io>2021-01-22 20:10:54 +0530
commitc686215268452765803f1445a8e4db16a323c1d3 (patch)
treeb497eda0312ddc02f9397a01861bd4b1a1bc8027
parent9431e96ae498c3935fb3a4df29c1b88b4037eb3b (diff)
downloadpulseaudio-c686215268452765803f1445a8e4db16a323c1d3.tar.gz
bluetooth: ldac: Use format as FLOAT32LE
LDAC encoder already supports S16, S24, S32 and F32LE. Using FLOAT32LE for the sample format would avoid the additional call for conversion to pa_sconv_s32le_from_float32ne. perf tool shows this as being the function called frequently after encode. So, just avoid this by using sample format as F32LE. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/486>
-rw-r--r--src/modules/bluetooth/a2dp-codec-gst.c3
-rw-r--r--src/modules/bluetooth/a2dp-codec-ldac-gst.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/bluetooth/a2dp-codec-gst.c b/src/modules/bluetooth/a2dp-codec-gst.c
index bbc598467..80032bc7f 100644
--- a/src/modules/bluetooth/a2dp-codec-gst.c
+++ b/src/modules/bluetooth/a2dp-codec-gst.c
@@ -321,6 +321,9 @@ static GstCaps *gst_create_caps_from_sample_spec(const pa_sample_spec *ss) {
case PA_SAMPLE_S32LE:
sample_format = "S32LE";
break;
+ case PA_SAMPLE_FLOAT32LE:
+ sample_format = "F32LE";
+ break;
default:
pa_assert_not_reached();
break;
diff --git a/src/modules/bluetooth/a2dp-codec-ldac-gst.c b/src/modules/bluetooth/a2dp-codec-ldac-gst.c
index d14a35564..0f365b075 100644
--- a/src/modules/bluetooth/a2dp-codec-ldac-gst.c
+++ b/src/modules/bluetooth/a2dp-codec-ldac-gst.c
@@ -208,7 +208,7 @@ bool gst_init_ldac(struct gst_info *info, pa_sample_spec *ss, bool for_encoding)
return false;
}
- ss->format = PA_SAMPLE_S32LE;
+ ss->format = PA_SAMPLE_FLOAT32LE;
switch (info->a2dp_codec_t.ldac_config->frequency) {
case LDAC_SAMPLING_FREQ_44100: