Peter Kornatowski | 1 Jul 2010 15:33
Picon

Bug with Alias

Hello,

I have several headsets of the same model, so I set an Alias for each 
to distinguish them in my own application. But since bluez 4.64 the 
Alias is bugged. Sometimes after a reboot or after a bluez restart 
when i read out the Alias through the dbus api, I get the Name 
instead. I also tried to read it with d-feet or through a dbus-send 
call (dbus-send --system --print-reply --dest=org.bluez 
/org/bluez/11344/hci0/dev_00_XX_XX_XX_XX_XX 
org.bluez.Device.GetProperties) and also got the Name instead of the 
Alias. But in the aliases file under 
/var/lib/bluetooth/XX:XX:XX:XX:XX:XX/aliases is the correct Alias. 
The bug seems to have something to do with the commit 
48a2c31cdbc1f2ac2a2bbadbd505976f84a9eaca 
(http://git.kernel.org/?p=bluetooth/bluez.git;a=commit;h=48a2c31cdbc1f2ac2a2bbadbd505976f84a9eaca).
I hope someone can resolve this issue.

Thanks,
Peter

David Miller | 2 Jul 2010 06:28
Favicon

Re: [PATCH] drivers: bluetooth: bluecard_cs.c: Fixed include error, changed to linux/io.h

From: "Gustavo F. Padovan" <gustavo@...>
Date: Sun, 27 Jun 2010 03:50:07 -0300

> * Cody Rester <codyrester@...> [2010-06-27 02:12:22 -0400]:
> 
>> Fixed include error, changed to linux/io.h
>> 
>> Signed-off-by: Cody Rester <codyrester@...>
...
> Acked-by: Gustavo F. Padovan <padovan@...>

Applied, thanks.
Siarhei Siamashka | 2 Jul 2010 14:25
Picon

[PATCH 0/5] SBC encoder optimizations for ARM processors

From: Siarhei Siamashka <siarhei.siamashka@...>

This patch series adds a bunch of ARM assembly optimizations.

Now all the functions from 'sbc_primitives.c' got NEON optimized
variants. As benchmarked with the common A2DP case (44100kHz audio
with bitpool set to 53, 8 subbands, joint stereo), SBC encoding is
now approximately 1.6x faster overall when compared to bluez-4.66.
Some more room for improvement still exists though.

For ARMv6 processors, only analysis filter has been implemented
(using dual 16-bit multiply-accumulate instructions). But that's
the most important optimization and it doubles performance already.
And older processors such as ARM11 are much slower, so they
definitely benefit more on a relative scale (Nokia N800/N810 users
may find this update useful).

All the optimizations are bitexact. Given the same input, they provide
the same output as the SBC encoder from the previous bluez versions.

Patches are also available in the branch 'sbc-arm-optimizations' here:
git://gitorious.org/system-performance/bluez-sbc.git

Siarhei Siamashka (5):
  sbc: ARM NEON optimized joint stereo processing in SBC encoder
  sbc: ARM NEON optimizations for input permutation in SBC encoder
  sbc: slightly faster 'sbc_calc_scalefactors_neon'
  sbc: faster 'sbc_calculate_bits' function
  sbc: ARMv6 optimized version of analysis filter for SBC encoder

(Continue reading)

Siarhei Siamashka | 2 Jul 2010 14:25
Picon

[PATCH 1/5] sbc: ARM NEON optimized joint stereo processing in SBC encoder

From: Siarhei Siamashka <siarhei.siamashka@...>

Improves SBC encoding performance when joint stereo is used, which
is a typical A2DP configuration.

Benchmarked on ARM Cortex-A8:

== Before: ==

$ time ./sbcenc -b53 -s8 -j test.au > /dev/null

real    0m5.239s
user    0m4.805s
sys     0m0.430s

samples  %        image name               symbol name
26083    25.0856  sbcenc                   sbc_pack_frame
21548    20.7240  sbcenc                   sbc_calc_scalefactors_j
19910    19.1486  sbcenc                   sbc_analyze_4b_8s_neon
14377    13.8272  sbcenc                   sbc_calculate_bits
9990      9.6080  sbcenc                   sbc_enc_process_input_8s_be
8667      8.3356  no-vmlinux               /no-vmlinux
2263      2.1765  sbcenc                   sbc_encode
696       0.6694  libc-2.10.1.so           memcpy

== After: ==

$ time ./sbcenc -b53 -s8 -j test.au > /dev/null

real    0m4.389s
(Continue reading)

Siarhei Siamashka | 2 Jul 2010 14:25
Picon

[PATCH 2/5] sbc: ARM NEON optimizations for input permutation in SBC encoder

From: Siarhei Siamashka <siarhei.siamashka@...>

Using SIMD optimizations for 'sbc_enc_process_input_*' functions provides
a modest, but consistent speedup in all SBC encoding cases.

Benchmarked on ARM Cortex-A8:

== Before: ==

$ time ./sbcenc -b53 -s8 -j test.au > /dev/null

real    0m4.389s
user    0m3.969s
sys     0m0.422s

samples  %        image name               symbol name
26234    29.9625  sbcenc                   sbc_pack_frame
20057    22.9076  sbcenc                   sbc_analyze_4b_8s_neon
14306    16.3393  sbcenc                   sbc_calculate_bits
9866     11.2682  sbcenc                   sbc_enc_process_input_8s_be
8506      9.7149  no-vmlinux               /no-vmlinux
5219      5.9608  sbcenc                   sbc_calc_scalefactors_j_neon
2280      2.6040  sbcenc                   sbc_encode
661       0.7549  libc-2.10.1.so           memcpy

== After: ==

$ time ./sbcenc -b53 -s8 -j test.au > /dev/null

real    0m3.989s
(Continue reading)

Siarhei Siamashka | 2 Jul 2010 14:25
Picon

[PATCH 3/5] sbc: slightly faster 'sbc_calc_scalefactors_neon'

From: Siarhei Siamashka <siarhei.siamashka@...>

Previous variant was basically derived from C and MMX implementations.
Now new variant makes use of 'vmax' instruction, which is available in
NEON and can do this job faster. The same method for calculating scale
factors is also used in 'sbc_calc_scalefactors_j_neon'.

Benchmarked without joint stereo on ARM Cortex-A8:

== Before: ==

$ time ./sbcenc -b53 -s8 test.au > /dev/null

real    0m3.851s
user    0m3.375s
sys     0m0.469s

samples  %        image name               symbol name
26260    34.2672  sbcenc                   sbc_pack_frame
20013    26.1154  sbcenc                   sbc_analyze_4b_8s_neon
13796    18.0027  sbcenc                   sbc_calculate_bits
8388     10.9457  no-vmlinux               /no-vmlinux
3229      4.2136  sbcenc                   sbc_enc_process_input_8s_be_neon
2408      3.1422  sbcenc                   sbc_calc_scalefactors_neon
2093      2.7312  sbcenc                   sbc_encode

== After: ==

$ time ./sbcenc -b53 -s8 test.au > /dev/null

(Continue reading)

Siarhei Siamashka | 2 Jul 2010 14:25
Picon

[PATCH 4/5] sbc: faster 'sbc_calculate_bits' function

From: Siarhei Siamashka <siarhei.siamashka@...>

By using SBC_ALWAYS_INLINE trick, the implementation of 'sbc_calculate_bits'
function is split into two branches, each having 'subband' variable value
known at compile time. It helps the compiler to generate more optimal code
by saving at least one extra register, and also provides more obvious
opportunities for loops unrolling.

Benchmarked on ARM Cortex-A8:

== Before: ==

$ time ./sbcenc -b53 -s8 -j test.au > /dev/null

real    0m3.989s
user    0m3.602s
sys     0m0.391s

samples  %        image name               symbol name
26057    32.6128  sbcenc                   sbc_pack_frame
20003    25.0357  sbcenc                   sbc_analyze_4b_8s_neon
14220    17.7977  sbcenc                   sbc_calculate_bits
8498     10.6361  no-vmlinux               /no-vmlinux
5300      6.6335  sbcenc                   sbc_calc_scalefactors_j_neon
3235      4.0489  sbcenc                   sbc_enc_process_input_8s_be_neon
2172      2.7185  sbcenc                   sbc_encode

== After: ==

$ time ./sbcenc -b53 -s8 -j test.au > /dev/null
(Continue reading)

Siarhei Siamashka | 2 Jul 2010 14:25
Picon

[PATCH 5/5] sbc: ARMv6 optimized version of analysis filter for SBC encoder

From: Siarhei Siamashka <siarhei.siamashka@...>

The optimized filter gets enabled when the code is compiled
with -mcpu=/-march options set to target the processors which
support ARMv6 instructions. This code is also disabled when
NEON is used (which is a lot better alternative). For additional
safety ARM EABI is required and thumb mode should not be used.

Benchmarks from ARM11:

== 8 subbands ==

$ time ./sbcenc -b53 -s8 -j test.au > /dev/null

real    0m 35.65s
user    0m 34.17s
sys     0m 1.28s

$ time ./sbcenc.armv6 -b53 -s8 -j test.au > /dev/null

real    0m 17.29s
user    0m 15.47s
sys     0m 0.67s

== 4 subbands ==

$ time ./sbcenc -b53 -s4 -j test.au > /dev/null

real    0m 25.28s
user    0m 23.76s
(Continue reading)

Vinicius Gomes | 2 Jul 2010 15:56

Re: Bug with Alias

Hi Peter,

On Thu, Jul 1, 2010 at 10:33 AM, Peter Kornatowski <pkorn@...> wrote:
> Hello,
>
> I have several headsets of the same model, so I set an Alias for each to
> distinguish them in my own application. But since bluez 4.64 the Alias is
> bugged. Sometimes after a reboot or after a bluez restart when i read out
> the Alias through the dbus api, I get the Name instead. I also tried to read
> it with d-feet or through a dbus-send call (dbus-send --system --print-reply
> --dest=org.bluez /org/bluez/11344/hci0/dev_00_XX_XX_XX_XX_XX
> org.bluez.Device.GetProperties) and also got the Name instead of the Alias.
> But in the aliases file under /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/aliases
> is the correct Alias. The bug seems to have something to do with the commit
> 48a2c31cdbc1f2ac2a2bbadbd505976f84a9eaca
> (http://git.kernel.org/?p=bluetooth/bluez.git;a=commit;h=48a2c31cdbc1f2ac2a2bbadbd505976f84a9eaca).

Thanks for the bug report.

I suggested a fix[1], waiting for review.

> I hope someone can resolve this issue.
>
> Thanks,
> Peter
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> in
> the body of a message to majordomo@...
(Continue reading)

Johan Hedberg | 2 Jul 2010 21:04
Picon
Gravatar

Re: [PATCH 0/5] SBC encoder optimizations for ARM processors

Hi Siarhei,

On Fri, Jul 02, 2010, Siarhei Siamashka wrote:
> This patch series adds a bunch of ARM assembly optimizations.
> 
> Now all the functions from 'sbc_primitives.c' got NEON optimized
> variants. As benchmarked with the common A2DP case (44100kHz audio
> with bitpool set to 53, 8 subbands, joint stereo), SBC encoding is
> now approximately 1.6x faster overall when compared to bluez-4.66.
> Some more room for improvement still exists though.
> 
> For ARMv6 processors, only analysis filter has been implemented
> (using dual 16-bit multiply-accumulate instructions). But that's
> the most important optimization and it doubles performance already.
> And older processors such as ARM11 are much slower, so they
> definitely benefit more on a relative scale (Nokia N800/N810 users
> may find this update useful).
> 
> All the optimizations are bitexact. Given the same input, they provide
> the same output as the SBC encoder from the previous bluez versions.
> 
> Patches are also available in the branch 'sbc-arm-optimizations' here:
> git://gitorious.org/system-performance/bluez-sbc.git
> 
> Siarhei Siamashka (5):
>   sbc: ARM NEON optimized joint stereo processing in SBC encoder
>   sbc: ARM NEON optimizations for input permutation in SBC encoder
>   sbc: slightly faster 'sbc_calc_scalefactors_neon'
>   sbc: faster 'sbc_calculate_bits' function
>   sbc: ARMv6 optimized version of analysis filter for SBC encoder
(Continue reading)


Gmane