[pulseaudio-discuss] Arduino Tian issue changing card profile to A2DP with bluetooth headset

Mimmo mimmo at linino.org
Thu Oct 1 14:26:17 PDT 2015


Debugging using gdb pulseaudio when the pactl set-card-profile 0 
a2dp_sink is launched and the cpu utilization of pulseaudio reach 99%

Breaking gdb this its the backtrace:

(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
check_match (sym=sym at entry=0x77ef34c4, strtab=strtab at entry=0x77ef3c84 
"", undef_name=undef_name at entry=0x7762b9ac "_ITM_registerTMCloneTable",
     type_class=type_class at entry=1) at ldso/ldso/dl-hash.c:161
161        if ((sym->st_value == 0 && (ELF_ST_TYPE(sym->st_info) != 
STT_TLS))
(gdb) bt
#0  check_match (sym=sym at entry=0x77ef34c4, 
strtab=strtab at entry=0x77ef3c84 "",
     undef_name=undef_name at entry=0x7762b9ac "_ITM_registerTMCloneTable", 
type_class=type_class at entry=1) at ldso/ldso/dl-hash.c:161
#1  0x77fe1b5c in _dl_lookup_sysv_hash (type_class=1, 
undef_name=0x7762b9ac "_ITM_registerTMCloneTable", hash=192047269, 
symtab=0x77ef1494,
     tpnt=0x77ff52c0) at ldso/ldso/dl-hash.c:261
#2  _dl_find_hash (name=0x7762b9ac "_ITM_registerTMCloneTable", 
scope=<optimized out>, mytpnt=0x456a90, type_class=1, sym_ref=0x0)
     at ldso/ldso/dl-hash.c:339
#3  0x77fe1dc8 in _dl_perform_mips_global_got_relocations 
(tpnt=0x456a90, lazy=0) at ldso/ldso/mips/elfinterp.c:390
#4  0x77cec848 in do_dlopen (libname=0x45e0c0 
"/usr/lib/pulse-6.0/modules/module-null-sink.so", flag=2) at 
ldso/libdl/libdl.c:557
#5  0x77cecb0c in dlopen (libname=0x45e0c0 
"/usr/lib/pulse-6.0/modules/module-null-sink.so", flag=2) at 
ldso/libdl/libdl.c:664
#6  0x0040a078 in bind_now_open (d=<optimized out>, fname=0x45e0c0 
"/usr/lib/pulse-6.0/modules/module-null-sink.so", advise=<optimized out>)
     at daemon/ltdl-bind-now.c:74
#7  0x77da26f0 in tryall_dlopen ()
    from 
/home/mimmo/projects/linino_CC/scripts/../staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/libltdl.so.7
#8  0x77da3098 in find_handle_callback ()
    from 
/home/mimmo/projects/linino_CC/scripts/../staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/libltdl.so.7
#9  0x77da2dd8 in foreach_dirinpath ()
    from 
/home/mimmo/projects/linino_CC/scripts/../staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/libltdl.so.7
#10 0x77da2ef4 in find_handle ()
    from 
/home/mimmo/projects/linino_CC/scripts/../staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/libltdl.so.7
#11 0x77da4c60 in try_dlopen ()
    from 
/home/mimmo/projects/linino_CC/scripts/../staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/libltdl.so.7
#12 0x77da5028 in lt_dlopenadvise ()
    from 
/home/mimmo/projects/linino_CC/scripts/../staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/libltdl.so.7
#13 0x77da51a0 in lt_dlopenext ()
    from 
/home/mimmo/projects/linino_CC/scripts/../staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/libltdl.so.7
#14 0x77f6c15c in pa_module_load (c=0x423868, name=0x7763f89c 
"module-null-sink",
     argument=0x430758 "sink_name=auto_null 
sink_properties='device.description=\"Dummy Output\"'") at 
pulsecore/module.c:122
#15 0x7763f018 in load_null_sink_if_needed (c=0x423868, sink=<optimized 
out>, u=0x454418) at modules/module-always-sink.c:81
#16 0x7763f21c in unlink_hook_callback (c=<optimized out>, 
sink=<optimized out>, userdata=0x454418) at modules/module-always-sink.c:140
#17 0x77f69b74 in pa_hook_fire (hook=0x423a0c, data=0x474748) at 
pulsecore/hook-list.c:104
#18 0x77f8bd00 in pa_sink_unlink (s=0x474748) at pulsecore/sink.c:686
#19 0x773ecb2c in stop_thread (u=0x471b48) at 
modules/bluetooth/module-bluez5-device.c:1561
#20 0x773ef5e0 in set_profile_cb (c=<optimized out>, 
new_profile=0x4730d8) at modules/bluetooth/module-bluez5-device.c:1863
#21 0x77f65678 in pa_card_set_profile (c=<optimized out>, 
profile=0x4730d8, save=true) at pulsecore/card.c:279
#22 0x7771dc1c in command_set_card_profile (pd=<optimized out>, 
command=<optimized out>, tag=2, t=<optimized out>, userdata=0x46c368)
     at pulsecore/protocol-native.c:4782
#23 0x77e9fc50 in pa_pdispatch_run (pd=0x485850, packet=0x463f58, 
ancil_data=0x478dd8, userdata=0x46c368) at pulsecore/pdispatch.c:341
#24 0x77726fd4 in pstream_packet_callback (p=0x478bf0, packet=0x463f58, 
ancil_data=0x478dd8, userdata=<optimized out>)
     at pulsecore/protocol-native.c:4896
#25 0x77ea3258 in do_read (p=0x478bf0, re=0x478d30) at 
pulsecore/pstream.c:880
#26 0x77ea5b48 in do_pstream_read_write (p=0x478bf0) at 
pulsecore/pstream.c:193
#27 0x77f14628 in dispatch_pollfds (m=0x421708) at pulse/mainloop.c:655
#28 pa_mainloop_dispatch (m=0x421708) at pulse/mainloop.c:898
---Type <return> to continue, or q <return> to quit---
#29 0x77f147e0 in pa_mainloop_iterate (m=0x421708, block=<optimized 
out>, retval=0x7fff6be8) at pulse/mainloop.c:929
#30 0x77f14864 in pa_mainloop_run (m=0x421708, retval=0x7fff6be8) at 
pulse/mainloop.c:944
#31 0x004056e8 in main (argc=<optimized out>, argv=<optimized out>) at 
daemon/main.c:1134
(gdb)


Any suggestion on why this happen?

On 30/09/15 11:52, Mimmo wrote:
>
>
> On 30/09/15 11:21, Tanu Kaskinen wrote:
>> On Wed, 2015-09-30 at 10:20 +0200, Mimmo wrote:
>>> Arduino Tian (an evolution of Arduino Yun) is a board that has a MIPS
>>> processor where Linux is runinng. The distribution used is Linino,
>>> derived from openWRT.
>>>
>>> On this board Wifi from Qualcomm and Bluetooth from CSR are embedded.
>>>
>>> Software version details:
>>> - kernel 3.18.11
>>> - bluez5 version 5.23
>>> - pulseaudio 6.0
>>> - dbus 1.9
>>>
>>> The Headset device is properly connected but using paplay:
>>>
>>> root at linino:~# paplay -v -d bluez_sink.5D_43_5A_03_31_EA 
>>> /root/sample.wav
>>> Opening a playback stream with sample specification 's16be 2ch 44100Hz'
>>> and channel map 'front-left,front-right'.
>>> Connection established.
>>> Stream successfully created.
>>> Buffer metrics: maxlength=4194304, tlength=352800, prebuf=349276,
>>> minreq=3528
>>> Using sample spec 's16be 2ch 44100Hz', channel map 
>>> 'front-left,front-right'.
>>> Connected to device bluez_sink.5D_43_5A_03_31_EA (index: 1, 
>>> suspended: no).
>>>
>>> it start to play the music but without any sound. Trying to change the
>>> card profile from HSP to A2DP with the command:
>>>
>>> pactl set-card-profile 0, a2dp_sink
>>>
>>> hangs the board and exit with connection failure: Timeout
>> Hangs the board? What does that mean? If pactl prints something after
>> the hang, apparently not the whole board gets hung (unless pactl runs
>> on a different machine).
> It means that pactl exit after 10 secs but the pulseaudio process runs 
> at 90-99% of the cpu, and I need to restart the pulseaudio process to 
> continue to use the board.
>>
>>> trying to trace the code, I noticed that it stops on the call
>>> stop_thread on module-bluez5-device.c
>> How did you trace the code? Can you check with gdb where it's stopping?
> I used strace to understand what system call did, and then I put so 
> log messages. I'll try using gdb and let you know.
>>> Can you help me to understand why is hanging changing the profile?
>>>
>>> Is it possible to force the default to A2DP instead of HSP?
>> "pactl set-card-profile" should save the chosen profile so that later
>> on a2dp would get activated automatically. However, the code hangs
>> before the new profile preference gets written to the disk... You could
>> in theory hack the card-database file in ~/.config/pulse, but it's
>> binary data, so not exactly easy.
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20151001/e2627d7b/attachment.html>


More information about the pulseaudio-discuss mailing list