[pulseaudio-tickets] [Bug 91359] New: [bluetooth] wrong SBC configuration on big endian platforms

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jul 16 05:16:31 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=91359

            Bug ID: 91359
           Summary: [bluetooth] wrong SBC configuration on big endian
                    platforms
           Product: PulseAudio
           Version: unspecified
          Hardware: Other
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: modules
          Assignee: pulseaudio-bugs at lists.freedesktop.org
          Reporter: p06 at o2.pl
        QA Contact: pulseaudio-bugs at lists.freedesktop.org
                CC: lennart at poettering.net

PLATFORM:
AR9311 MIPS 24K SoC
OpenWRT Chaos Calmer 15.05
BlueZ 5.32
PulseAudio 6.0

PROBLEM:
White noise when streaming audio over A2DP from bluetooth device to PA server
running on big endian platforms.

CAUSE:
method bt_transport_config_a2dp() in
src/modules/bluetooth/module-bluez4-device.c  
method transport_config() in src/modules/bluetooth/module-bluez5-device.c

The current code assumes that endianness of the data returned by SBC is always
little endian and configure the transport in this way:

module-bluez4-device.c
1707|    u->sample_spec.format = PA_SAMPLE_S16LE;

module-bluez5-device.c
1159|    u->sample_spec.format = PA_SAMPLE_S16LE;

However an endianness in default settings returned by SBC is set according to
endianness of target platform:

1025|        sbc->blocks = SBC_BLK_16;
1026|        sbc->bitpool = 32;
1027|    #if __BYTE_ORDER == __LITTLE_ENDIAN
1028|        sbc->endian = SBC_LE;
1029|    #elif __BYTE_ORDER == __BIG_ENDIAN
1030|        sbc->endian = SBC_BE;
1031|    #else
1032|    #error "Unknown byte order"
1033|    #endif

see:
http://git.kernel.org/cgit/bluetooth/sbc.git/tree/sbc/sbc.c#n1027

Thus on big endian platforms SBC returns data in big endian format but PA
treats it as little endian, which results with white noise.

SOLUTION:

Explicitly set SBC configuration to produce little endian data by adding:

module-bluez4-device.c
1714|    sbc_info->sbc.endian = SBC_LE;

module-bluez5-device.c
1167|    sbc_info->sbc.endian = SBC_LE;

WORKAROUND:
not known.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20150716/a652fb91/attachment.html>


More information about the pulseaudio-bugs mailing list