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

Hyperion hyp3ri0n at sfr.fr
Thu Jan 7 00:07:12 UTC 2021


<span style="font-family:arial,helvetica,sans-serif; font-size:12px">‌Hi,<br>
<br>
Just did it, as requested :)<br>
<br>
regards<br>
JP</span>

<div class="gl_quote" style="margin-top: 20px; padding-top: 5px;">De : "George Kiagiadakis"<br>
A : "Hyperion" ,pipewire-devel at lists.freedesktop.org<br>
Envoyé: mercredi 6 janvier 2021 11:42<br>
Objet : Re: [Pipewire-devel] Patch for SBC XQ support in Pipewire<br>
 
<div class="gl_quoted">
<div>Hi,</div>

<div> </div>

<div>The best way to move this forward would be to create a merge request on gitlab:</div>

<div><a href="https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests">https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests</a></div>

<div> </div>

<div>Best regards,</div>

<div>George</div>

<div> </div>

<div class="protonmail_quote">
<div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐</div>

<div>On Friday, January 1st, 2021 at 12:32, Hyperion <hyp3ri0n at sfr.fr> wrote:</div>
</div>

<div> </div>

<blockquote class="protonmail_quote" type="cite"><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>
</blockquote>
</div>

<div class="gl_quoted"> </div>
</div>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pipewire-devel/attachments/20210107/f5667d65/attachment.htm>


More information about the Pipewire-devel mailing list