[Pipewire-devel] Patch for SBC XQ support in Pipewire

Hyperion hyp3ri0n at sfr.fr
Sat Dec 26 15:43:03 UTC 2020


<font face="arial, helvetica, sans-serif"><span style="font-size:12px">‌Hi, </span></font><br>
<br>
<font face="arial, helvetica, sans-serif"><span style="font-size:12px">Here's a very simple and non-intrusive patch that enables SBC XQ (dual channel 452kbps / bipool 2x38) with automatic fallback to joint stereo. </span></font><br>
<font face="arial, helvetica, sans-serif"><span style="font-size:12px">This Bluetooth dual channel mode is allowed by A2DP specifications, is far below BT bandwidth limits, and has been tested on hundreds devices without any problem for more than 2 years (on Pulseaudio).<br>
<br>
I can move it to github if you wish :)<br>
<br>
All the best<br>
jp</span></font><br>
 
<div>diff -rNaud pipewire-0.3.18/spa/plugins/bluez5/a2dp-codec-sbc.c pipewire-0.3.18-HQ/spa/plugins/bluez5/a2dp-codec-sbc.c</div>

<div>--- pipewire-0.3.18/spa/plugins/bluez5/a2dp-codec-sbc.c<span style="white-space:pre"> </span>2020-12-15 12:45:21.000000000 +0100</div>

<div>+++ pipewire-0.3.18-HQ/spa/plugins/bluez5/a2dp-codec-sbc.c<span style="white-space:pre"> </span>2020-12-26 15:36:10.992155069 +0100</div>

<div>@@ -95,22 +95,22 @@</div>

<div> <span style="white-space:pre"> </span>switch (mode) {</div>

<div> <span style="white-space:pre"> </span>case SBC_CHANNEL_MODE_MONO:</div>

<div> <span style="white-space:pre"> </span>case SBC_CHANNEL_MODE_DUAL_CHANNEL:</div>

<div>-<span style="white-space:pre"> </span>return 31;</div>

<div>+<span style="white-space:pre"> </span>return 38;</div>

<div> </div>

<div> <span style="white-space:pre"> </span>case SBC_CHANNEL_MODE_STEREO:</div>

<div> <span style="white-space:pre"> </span>case SBC_CHANNEL_MODE_JOINT_STEREO:</div>

<div>-<span style="white-space:pre"> </span>return 53;</div>

<div>+<span style="white-space:pre"> </span>return 64;</div>

<div> <span style="white-space:pre"> </span>}</div>

<div> <span style="white-space:pre"> </span>return 53;</div>

<div> <span style="white-space:pre"> </span>case SBC_SAMPLING_FREQ_48000:</div>

<div> <span style="white-space:pre"> </span>switch (mode) {</div>

<div> <span style="white-space:pre"> </span>case SBC_CHANNEL_MODE_MONO:</div>

<div> <span style="white-space:pre"> </span>case SBC_CHANNEL_MODE_DUAL_CHANNEL:</div>

<div>-<span style="white-space:pre"> </span>return 29;</div>

<div>+<span style="white-space:pre"> </span>return 36;</div>

<div> </div>

<div> <span style="white-space:pre"> </span>case SBC_CHANNEL_MODE_STEREO:</div>

<div> <span style="white-space:pre"> </span>case SBC_CHANNEL_MODE_JOINT_STEREO:</div>

<div>-<span style="white-space:pre"> </span>return 51;</div>

<div>+<span style="white-space:pre"> </span>return 62;</div>

<div> <span style="white-space:pre"> </span>}</div>

<div> <span style="white-space:pre"> </span>return 51;</div>

<div> <span style="white-space:pre"> </span>}</div>

<div>@@ -140,12 +140,12 @@</div>

<div> <span style="white-space:pre"> </span>else</div>

<div> <span style="white-space:pre"> </span>return -ENOTSUP;</div>

<div> </div>

<div>-<span style="white-space:pre"> </span>if (conf.channel_mode & SBC_CHANNEL_MODE_JOINT_STEREO)</div>

<div>+<span style="white-space:pre"> </span>if (conf.channel_mode & SBC_CHANNEL_MODE_DUAL_CHANNEL)</div>

<div>+<span style="white-space:pre"> </span>conf.channel_mode = SBC_CHANNEL_MODE_DUAL_CHANNEL;</div>

<div>+<span style="white-space:pre"> </span>else if (conf.channel_mode & SBC_CHANNEL_MODE_JOINT_STEREO)</div>

<div> <span style="white-space:pre"> </span>conf.channel_mode = SBC_CHANNEL_MODE_JOINT_STEREO;</div>

<div> <span style="white-space:pre"> </span>else if (conf.channel_mode & SBC_CHANNEL_MODE_STEREO)</div>

<div> <span style="white-space:pre"> </span>conf.channel_mode = SBC_CHANNEL_MODE_STEREO;</div>

<div>-<span style="white-space:pre"> </span>else if (conf.channel_mode & SBC_CHANNEL_MODE_DUAL_CHANNEL)</div>

<div>-<span style="white-space:pre"> </span>conf.channel_mode = SBC_CHANNEL_MODE_DUAL_CHANNEL;</div>

<div> <span style="white-space:pre"> </span>else if (conf.channel_mode & SBC_CHANNEL_MODE_MONO)</div>

<div> <span style="white-space:pre"> </span>conf.channel_mode = SBC_CHANNEL_MODE_MONO;</div>

<div> <span style="white-space:pre"> </span>else</div>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pipewire-devel/attachments/20201226/e96c2f6b/attachment.htm>


More information about the Pipewire-devel mailing list