Re: [pulseaudio-discuss] [PATCH v2 01/10] build: Add Coverity scan model

2017-03-06 Thread Arun Raghavan


On Mon, 6 Mar 2017, at 01:13 PM, Peter Meerwald-Stadler wrote:
> the modeling file help to avoid false positives and increase scanning
> accuracy by explaining code Coverity can't see (out of tree libraries);
> the model file must be uploaded by an admin to:
> https://scan.coverity.com/projects/pulseaudio?tab=analysis_settings
> 
> the pa_assert_se() macro needs to be rewritten for Coverity so that
> the assignment is not declared a side-effect
> 
> Signed-off-by: Peter Meerwald-Stadler 
> Cc: Philip Withnall 
> ---
>  coverity/model.c  | 18 ++
>  src/pulsecore/macro.h |  9 +
>  2 files changed, 27 insertions(+)
>  create mode 100644 coverity/model.c
> 
> diff --git a/coverity/model.c b/coverity/model.c
> new file mode 100644
> index 000..afe7ca5
> --- /dev/null
> +++ b/coverity/model.c
> @@ -0,0 +1,18 @@
> +/* Coverity Scan model
> + * Copyright (C) 2017 Peter Meerwald-Stadler 
> + *
> + * This is a modeling file for Coverity Scan which helps to avoid false
> + * positives and increase scanning accuracy by explaining code Coverity
> + * can't see (out of tree libraries); the model file must be uploaded by
> + * an admin to:
> + * https://scan.coverity.com/projects/pulseaudio?tab=analysis_settings
> + */
> +
> +void fail(void) {
> +__coverity_panic__();
> +}
> +
> +void fail_unless(int x) {
> +if (!x)
> +__coverity_panic__();
> +}
> diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
> index 2c5d5f2..dbce5cd 100644
> --- a/src/pulsecore/macro.h
> +++ b/src/pulsecore/macro.h
> @@ -186,6 +186,7 @@ static inline size_t PA_ALIGN(size_t l) {
>  
>  /* pa_assert_se() is an assert which guarantees side effects of x,
>   * i.e. is never optimized away, regardless of NDEBUG or FASTPATH. */
> +#ifndef __COVERITY__
>  #define pa_assert_se(expr) 
>  \
>  do {   
>  \
>  if (PA_UNLIKELY(!(expr))) {
>  \
> @@ -193,6 +194,14 @@ static inline size_t PA_ALIGN(size_t l) {
>  abort();   
>  \
>  }  
>  \
>  } while (false)
> +#else
> +#define pa_assert_se(expr) 
> \
> +do {   
> \
> +int _unique_var = (expr);  
> \
> +if (!_unique_var)  
> \
> +abort();   
> \
> +} while (false)
> +#endif
>  
>  /* Does exactly nothing */
>  #define pa_nop() do {} while (false)
> -- 

Ack, go ahead and push this. Do we need to modify our Coverity project
settings?

-- Arun
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] module-echo-cancel microphone gain auto-adjust

2017-03-06 Thread Arun Raghavan
Hi,

On Sun, 5 Mar 2017, at 12:11 AM, Vasco Almeida wrote:
> A terça-feira, 21 de fevereiro de 2017 08:51:14 AZOT Vasco Almeida
> escreveu:
> > Hello.
> > I know that module-echo-cancel used to auto-adjust the gain of
> > microphone while one speaks. I used to see in pavucontrol the slider
> > move change the microphone gain. Now I don't see that happen anymore.
> > Was this feature removed or disabled?
> > I see this new behavior in Fedora 25 and OpenSUSE Tumbleweed.
> > How can I have microphone gain auto-adjust again?
> > 
> > I have searched a little to see what I could find about the issue but I
> > found nothing. This may be something new.
> > Please reply to me because I am not subscribed to the list.
> > Thank you.
> 
> pulseaudio 10.0
> pactl load-module module-echo-cancel aec_method=webrtc
> pactl load-module module-echo-cancel aec_method=webrtc 
> aec_args=agc_start_volume=200
> or without aec_method or other arguments.
> So far I could see the microphone slider move left only when the gain is
> 100% 
> and I yell. When I set the gain to low the slider does not move at all to
> pick 
> my voice.
> On fedora 24 automatic gain control for microphone with
> module-echo-cancel 
> works fine. On fedora 24 at the time of writing there is 
> pulseaudio-8.0-6.fc24.
> 
> From PulseAudio 9.0 release notes [1]
> > It's now possible to configure the initial volume when using AGC (automatic
> > gain control). To do that, pass "agc_start_volume=VOL" in aec_args when
> > loading module-echo-cancel (replace VOL with a number between 0 and 255).
> > Note that too low initial volume may prevent the AGC algorithm from ever
> > raising the volume high enough (there seems to be some regression in the
> > WebRTC code in this regard).
> 
> Would the above change affect the automatic gain control that it does not
> work 
> for me anymore?

The update to webrtc-audio-processing did make the AGC less quick to
react to input energy level changes. We might need to update the code
based on upstream again to see if things have gotten better.

By default, is the level of your mic (without module-echo-cancel)
sufficiently high? I would not expect this to be a problem if it is.

Regards,
Arun
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 00/10] Coverity fixes, raop

2017-03-06 Thread Hajime Fujita
Hi Peter,

Thank you for taking care of this!
Actually I also started working on this but haven’t had a chance to cleanup the 
patches.

Patches look good except where I made comments on each message.


Thanks,
Hajime

> On Mar 6, 2017, at 1:43 AM, Peter Meerwald-Stadler  wrote:
> 
> the first patch commits the model file as used on scan.coverity.com
> and rewrites pa_assert_se() so that Coverity doesn't complain about
> side-effects
> 
> some more Coverity fixes for the raop code
> 
> Peter Meerwald-Stadler (10):
>  build: Add Coverity scan model
>  raop: Fix double free
>  raop: Fix loop searching for port number
>  raop: Fix memleak
>  raop: Fix resource leaks
>  raop: Fix potential memory leak
>  raop: Fix indentation
>  raop: Silence unchecked return value warnings
>  raop: Fix potential resource leaks
>  raop: Fix potential NULL dereference
> 
> coverity/model.c| 18 ++
> src/modules/raop/module-raop-discover.c | 22 +
> src/modules/raop/raop-client.c  | 44 +
> src/modules/raop/raop-sink.c|  6 ++---
> src/pulsecore/macro.h   |  9 +++
> 5 files changed, 70 insertions(+), 29 deletions(-)
> create mode 100644 coverity/model.c
> 
> -- 
> 2.7.4
> 
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 08/10] raop: Silence unchecked return value warnings

2017-03-06 Thread Hajime Fujita

> On Mar 6, 2017, at 1:43 AM, Peter Meerwald-Stadler  wrote:
> 
> Signed-off-by: Peter Meerwald-Stadler 
> ---
> src/modules/raop/raop-client.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/modules/raop/raop-client.c b/src/modules/raop/raop-client.c
> index c6e1877..d329a09 100644
> --- a/src/modules/raop/raop-client.c
> +++ b/src/modules/raop/raop-client.c
> @@ -1034,9 +1034,9 @@ static void rtsp_stream_cb(pa_rtsp_client *rtsp, 
> pa_rtsp_state_t state, pa_rtsp_
> if ((pc = strstr(token, "="))) {
> *pc = 0;
> if (pa_streq(token, "control_port"))
> -pa_atou(pc + 1, );
> +(void) pa_atou(pc + 1, );
> if (pa_streq(token, "timing_port"))
> -pa_atou(pc + 1, );
> +(void) pa_atou(pc + 1, );

I think these should jump to `setup_error` in case of error instead of ignoring.

> *pc = '=';
> }
> pa_xfree(token);
> -- 
> 2.7.4
> 
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 05/10] raop: Fix resource leaks

2017-03-06 Thread Hajime Fujita

> On Mar 6, 2017, at 1:43 AM, Peter Meerwald-Stadler  wrote:
> 
> Coverity ID: #1398158, #1398159
> 
> Signed-off-by: Peter Meerwald-Stadler 
> ---
> src/modules/raop/raop-client.c | 14 ++
> 1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/src/modules/raop/raop-client.c b/src/modules/raop/raop-client.c
> index 4c3083e..03558f6 100644
> --- a/src/modules/raop/raop-client.c
> +++ b/src/modules/raop/raop-client.c
> @@ -1223,7 +1223,7 @@ static void rtsp_auth_cb(pa_rtsp_client *rtsp, 
> pa_rtsp_state_t state, pa_rtsp_st
> static bool waiting = false;
> const char *current = NULL;
> char space[] = " ";
> -char *token,*ath = NULL;
> +char *token, *ath = NULL;
> char *publ, *wath, *mth, *val;

Should we initialize mth to NULL here to prevent freeing a random address later?
This could happen when `wath = pa_xstrdup(pa_headerlist_gets(headers, 
"WWW-Authenticate"));` becomes NULL.

> char *realm = NULL, *nonce = NULL, *response = NULL;
> char comma[] = ",";
> @@ -1260,9 +1260,6 @@ static void rtsp_auth_cb(pa_rtsp_client *rtsp, 
> pa_rtsp_state_t state, pa_rtsp_st
> pa_raop_basic_response(DEFAULT_USER_NAME, c->password, 
> );
> ath = pa_sprintf_malloc("Basic %s",
> response);
> -
> -pa_xfree(response);
> -pa_xfree(realm);
> } else if (pa_safe_streq(mth, "Digest")) {
> rtrim_char(realm, '\"');
> rtrim_char(nonce, '\"');
> @@ -1271,17 +1268,18 @@ static void rtsp_auth_cb(pa_rtsp_client *rtsp, 
> pa_rtsp_state_t state, pa_rtsp_st
> ath = pa_sprintf_malloc("Digest username=\"%s\", 
> realm=\"%s\", nonce=\"%s\", uri=\"*\", response=\"%s\"",
> DEFAULT_USER_NAME, realm, nonce,
> response);
> -
> -pa_xfree(response);
> -pa_xfree(realm);
> -pa_xfree(nonce);
> } else {
> pa_log_error("unsupported authentication method: %s", 
> mth);
> +pa_xfree(realm);
> +pa_xfree(nonce);
> pa_xfree(wath);
> pa_xfree(mth);
> goto error;
> }
> 
> +pa_xfree(response);
> +pa_xfree(realm);
> +pa_xfree(nonce);
> pa_xfree(wath);
> pa_xfree(mth);
> 
> -- 
> 2.7.4
> 
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 10/10] raop: Fix potential NULL dereference

2017-03-06 Thread Hajime Fujita

> On Mar 6, 2017, at 1:43 AM, Peter Meerwald-Stadler  wrote:
> 
> 'realm' is mandatory
> 
> Signed-off-by: Peter Meerwald-Stadler 
> ---
> src/modules/raop/raop-client.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/modules/raop/raop-client.c b/src/modules/raop/raop-client.c
> index d329a09..5248691 100644
> --- a/src/modules/raop/raop-client.c
> +++ b/src/modules/raop/raop-client.c
> @@ -1254,13 +1254,13 @@ static void rtsp_auth_cb(pa_rtsp_client *rtsp, 
> pa_rtsp_state_t state, pa_rtsp_st
> pa_xfree(token);
> }
> 
> -if (pa_safe_streq(mth, "Basic")) {
> +if (pa_safe_streq(mth, "Basic") && realm) {
> rtrim_char(realm, '\"’);

I would remove `rtrim_char(realm, '\"’);` from this block and keep the if 
condition as-is, since realm is not used later.

> 
> pa_raop_basic_response(DEFAULT_USER_NAME, c->password, 
> );
> ath = pa_sprintf_malloc("Basic %s",
> response);
> -} else if (pa_safe_streq(mth, "Digest")) {
> +} else if (pa_safe_streq(mth, "Digest") && realm && nonce) {

Why don’t we do like this:
+if (realm == NULL) {
+pa_log_error("realm not provided");
+goto error;
+} else if (nonce == NULL) {
+pa_log_error("nonce not provided");
+goto error;
+}

> rtrim_char(realm, '\"');
> rtrim_char(nonce, '\"');
> 
> -- 
> 2.7.4
> 
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 1/3] backend-native: add support for the HSP Headset role

2017-03-06 Thread Tanu Kaskinen
On Thu, 2017-03-02 at 17:04 +0100, Georg Chini wrote:
>  #define HSP_AG_PROFILE "/Profile/HSPAGProfile"
> +#define HSP_HS_PROFILE "/Profile/HSPHSProfile"
> +
> +/* RFCOMM channel for HSP headset role */
> +#define HSP_HS_DEFAULT_CHANNEL  3

The comment still doesn't explain why 3 is a good default.

I realize you might not know, since this was originally written by Wim.
I added Wim to Cc -- Wim, can you explain why 3 is the best channel? It
looks like a deliberate choice.

> @@ -249,22 +373,38 @@ static void rfcomm_io_callback(pa_mainloop_api *io, 
> pa_io_event *e, int fd, pa_i
>  buf[len] = 0;
>  pa_log_debug("RFCOMM << %s", buf);
>  
> -if (sscanf(buf, "AT+VGS=%d", ) == 1) {
> -  t->speaker_gain = gain;
> -  pa_hook_fire(pa_bluetooth_discovery_hook(t->device->discovery, 
> PA_BLUETOOTH_HOOK_TRANSPORT_SPEAKER_GAIN_CHANGED), t);
> -} else if (sscanf(buf, "AT+VGM=%d", ) == 1) {
> -  t->microphone_gain = gain;
> -  pa_hook_fire(pa_bluetooth_discovery_hook(t->device->discovery, 
> PA_BLUETOOTH_HOOK_TRANSPORT_MICROPHONE_GAIN_CHANGED), t);
> +/* There are only four HSP AT commands:
> + * AT+VGS=value: value between 0 and 15, sets the speaker gain in AG 
> role or notifies the
> + * AG that the speaker gain has changed in HS role.
> + * AT+VGM=value: value between 0 and 15, sets the microphone gain in 
> AG role or notifies
> + * the AG that the microphone gain has changed.

I think +VGS/+VGM should be explained separately from AT+VGS/AT+VGM.

> @@ -295,17 +440,25 @@ static void set_speaker_gain(pa_bluetooth_transport *t, 
> uint16_t gain) {
>  
>  t->speaker_gain = gain;
>  
> -len = sprintf(buf, "\r\n+VGS=%d\r\n", gain);
> -pa_log_debug("RFCOMM >> +VGS=%d", gain);
> +/* If we are in the AG role, we send a command to the head set to change
> + * the speaker gain. In the HS role, source and sink are swapped, so
> + * in this case we notify the AG that the microphone gain has changed */
> +if (t->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT) {
> +len = sprintf(buf, "\r\n+VGS=%d\r\n", gain);
> +pa_log_debug("RFCOMM >> +VGS=%d", gain);
> +} else {
> +len = sprintf(buf, "\r\n+VGM=%d\r\n", gain);
> +pa_log_debug("RFCOMM >> +VGM=%d", gain);

AT+VGM should be used here.

> @@ -314,10 +467,18 @@ static void set_microphone_gain(pa_bluetooth_transport 
> *t, uint16_t gain) {
>  
>  t->microphone_gain = gain;
>  
> -len = sprintf(buf, "\r\n+VGM=%d\r\n", gain);
> -pa_log_debug("RFCOMM >> +VGM=%d", gain);
> +/* If we are in the AG role, we send a command to the head set to change
> + * the microphone gain. In the HS role, source and sink are swapped, so
> + * in this case we notify the AG that the speaker gain has changed */
> +if (t->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT) {
> +len = sprintf(buf, "\r\n+VGM=%d\r\n", gain);
> +pa_log_debug("RFCOMM >> +VGM=%d", gain);
> +} else {
> +len = sprintf(buf, "\r\n+VGS=%d\r\n", gain);
> +pa_log_debug("RFCOMM >> +VGS=%d", gain);

AT+VGS should be used here.

-- 
Tanu

https://www.patreon.com/tanuk
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 00/10] Coverity fixes, raop

2017-03-06 Thread Georg Chini

On 06.03.2017 08:43, Peter Meerwald-Stadler wrote:

the first patch commits the model file as used on scan.coverity.com
and rewrites pa_assert_se() so that Coverity doesn't complain about
side-effects

some more Coverity fixes for the raop code

Peter Meerwald-Stadler (10):
   build: Add Coverity scan model
   raop: Fix double free
   raop: Fix loop searching for port number
   raop: Fix memleak
   raop: Fix resource leaks
   raop: Fix potential memory leak
   raop: Fix indentation
   raop: Silence unchecked return value warnings
   raop: Fix potential resource leaks
   raop: Fix potential NULL dereference

  coverity/model.c| 18 ++
  src/modules/raop/module-raop-discover.c | 22 +
  src/modules/raop/raop-client.c  | 44 +
  src/modules/raop/raop-sink.c|  6 ++---
  src/pulsecore/macro.h   |  9 +++
  5 files changed, 70 insertions(+), 29 deletions(-)
  create mode 100644 coverity/model.c


All of them look good, except one small issue in patch 3.

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 03/10] raop: Fix loop searching for port number

2017-03-06 Thread Georg Chini

On 06.03.2017 08:43, Peter Meerwald-Stadler wrote:

do...while not reachable, loop should try different ports in case EADDRINUSE is 
returned
Coverity ID: #1398161

Signed-off-by: Peter Meerwald-Stadler 
---
  src/modules/raop/raop-client.c | 11 +++
  1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/modules/raop/raop-client.c b/src/modules/raop/raop-client.c
index 94342d2..e39663d 100644
--- a/src/modules/raop/raop-client.c
+++ b/src/modules/raop/raop-client.c
@@ -799,13 +799,16 @@ static int open_bind_udp_socket(pa_raop_client *c, 
uint16_t *actual_port) {
  }
  
  do {

-*sa_port = htons(port);
+int ret;
  
-if (bind(fd, sa, salen) < 0 && errno != EADDRINUSE) {

-pa_log("bind_socket() failed: %s", pa_cstrerror(errno));
+*sa_port = htons(port);
+ret = bind(fd, sa, salen);
+if (!ret)
+break;
+if (ret < 0 && errno != EADDRINUSE) {
+pa_log("bind() failed: %s", pa_cstrerror(errno));
  goto fail;
  }
-break;
  } while (++port > 0);
  


You should also fail if port is 0 after the loop.


  pa_log_debug("Socket bound to port %d (SOCK_DGRAM)", port);



___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 01/10] build: Add Coverity scan model

2017-03-06 Thread Philip Withnall
That looks good to me. Thanks for working on this!

Philip

On Mon, 2017-03-06 at 08:43 +0100, Peter Meerwald-Stadler wrote:
> the modeling file help to avoid false positives and increase scanning
> accuracy by explaining code Coverity can't see (out of tree
> libraries);
> the model file must be uploaded by an admin to:
> https://scan.coverity.com/projects/pulseaudio?tab=analysis_settings
> 
> the pa_assert_se() macro needs to be rewritten for Coverity so that
> the assignment is not declared a side-effect
> 
> Signed-off-by: Peter Meerwald-Stadler 
> Cc: Philip Withnall 
> ---
>  coverity/model.c  | 18 ++
>  src/pulsecore/macro.h |  9 +
>  2 files changed, 27 insertions(+)
>  create mode 100644 coverity/model.c
> 
> diff --git a/coverity/model.c b/coverity/model.c
> new file mode 100644
> index 000..afe7ca5
> --- /dev/null
> +++ b/coverity/model.c
> @@ -0,0 +1,18 @@
> +/* Coverity Scan model
> + * Copyright (C) 2017 Peter Meerwald-Stadler 
> + *
> + * This is a modeling file for Coverity Scan which helps to avoid
> false
> + * positives and increase scanning accuracy by explaining code
> Coverity
> + * can't see (out of tree libraries); the model file must be
> uploaded by
> + * an admin to:
> + * https://scan.coverity.com/projects/pulseaudio?tab=analysis_settin
> gs
> + */
> +
> +void fail(void) {
> +__coverity_panic__();
> +}
> +
> +void fail_unless(int x) {
> +if (!x)
> +__coverity_panic__();
> +}
> diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
> index 2c5d5f2..dbce5cd 100644
> --- a/src/pulsecore/macro.h
> +++ b/src/pulsecore/macro.h
> @@ -186,6 +186,7 @@ static inline size_t PA_ALIGN(size_t l) {
>  
>  /* pa_assert_se() is an assert which guarantees side effects of x,
>   * i.e. is never optimized away, regardless of NDEBUG or FASTPATH.
> */
> +#ifndef __COVERITY__
>  #define
> pa_assert_se(expr)  \
>  do
> {\
>  if (PA_UNLIKELY(!(expr)))
> { \
> @@ -193,6 +194,14 @@ static inline size_t PA_ALIGN(size_t l) {
>  abort();
> \
>  }   
> \
>  } while (false)
> +#else
> +#define
> pa_assert_se(expr)  \
> +do
> {\
> +int _unique_var =
> (expr);   \
> +if
> (!_unique_var)   \
> +abort();
> \
> +} while (false)
> +#endif
>  
>  /* Does exactly nothing */
>  #define pa_nop() do {} while (false)

signature.asc
Description: This is a digitally signed message part
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] Pulseaudio 8.0, paplay BUS ERROR

2017-03-06 Thread Hieu Le
Hi all,

I am trying to stream audio from my embedded Linux board to Bluetooth
speaker and everything seems to be OK with pair/connect/stream music
with 8, 11, and 22 KHz to the Bluetooth Speaker.
However, when I tried to play 44KHz music using PAPLAY I got the "BUS
ERROR" and PAPLAY exits immediately without streaming any sound.
I have tried to tweet around configuration files but the issue still
happens. It would be great if you can give me some suggestions or
advice.

Sorry for the long attached log.

- Here is my log:
1. BlueZ 5.43
2. Pulseaudio 8.0

- Log when using PAPLAY:
/tmp # paplay -v pcm0844s.wav
Opening a playback stream with sample specification 's16le 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 's16le 2ch 44100Hz', channel map 'front-left,front-right'.
Connected to device bluez_sink.00_51_2B_A6_44_00 (index: 1, suspended: no).
Bus error

- Log verbose of pulseaudio daemon:
W: [pulseaudio] main.c: This program is not intended to be run as root
(unless --system is specified).
D: [pulseaudio] conf-parser.c: Parsing configuration file
'//etc/pulse/client.conf'
D: [pulseaudio] conf-parser.c: //etc/pulse/client.conf.d does not
exist, ignoring.
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
D: [pulseaudio] core-util.c: setpriority() worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 8.0
D: [pulseaudio] main.c: Running on host: Linux armv7l 3.14.43 #1 SMP
PREEMPT Fri Mar 3 15:54:52 ICT 2017
D: [pulseaudio] main.c: Found 4 CPUs.
I: [pulseaudio] main.c: Page size is 4096 bytes
D: [pulseaudio] main.c: Compiled with Valgrind support: no
D: [pulseaudio] main.c: Running in valgrind mode: no
D: [pulseaudio] main.c: Running in VM: no
D: [pulseaudio] main.c: Optimized build: yes
D: [pulseaudio] main.c: FASTPATH defined, only fast path asserts disabled.
I: [pulseaudio] main.c: Machine ID is harlek-computer.
I: [pulseaudio] main.c: Using runtime directory
//.config/pulse/harlek-computer-runtime.
I: [pulseaudio] main.c: Using state directory //.config/pulse.
I: [pulseaudio] main.c: Using modules directory //lib/pulse-8.0/modules.
I: [pulseaudio] main.c: Running in system mode: no
W: [pulseaudio] pid.c: Stale PID file, overwriting.
I: [pulseaudio] main.c: System supports high resolution timers
D: [pulseaudio] memblock.c: Using private memory pool with 1024 slots
of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot
size is 65496
I: [pulseaudio] cpu-arm.c: CPU flags: V6 V7 VFP EDSP NEON VFPV3
I: [pulseaudio] svolume_arm.c: Initialising ARM optimized volume functions.
I: [pulseaudio] module-device-restore.c: Successfully opened database
file '//.config/pulse/harlek-computer-device-volumes'.
I: [pulseaudio] module.c: Loaded "module-device-restore" (index: #0;
argument: "").
I: [pulseaudio] module-stream-restore.c: Successfully opened database
file '//.config/pulse/harlek-computer-stream-volumes'.
D: [pulseaudio] protocol-dbus.c: Interface
org.PulseAudio.Ext.StreamRestore1 added for object
/org/pulseaudio/stream_restore1
D: [pulseaudio] protocol-dbus.c: Interface
org.PulseAudio.Ext.StreamRestore1.RestoreEntry added for object
/org/pulseaudio/stream_restore1/entry0
I: [pulseaudio] module.c: Loaded "module-stream-restore" (index: #1;
argument: "").
I: [pulseaudio] module-card-restore.c: Successfully opened database
file '//.config/pulse/harlek-computer-card-database'.
I: [pulseaudio] module.c: Loaded "module-card-restore" (index: #2;
argument: "").
I: [pulseaudio] module.c: Loaded "module-augment-properties" (index:
#3; argument: "").
I: [pulseaudio] module.c: Loaded "module-switch-on-port-available"
(index: #4; argument: "").
D: [pulseaudio] module.c: Checking for existence of
'/lib/pulse-8.0/modules/module-jackdbus-detect.so': failure
D: [pulseaudio] module.c: Checking for existence of
'/lib/pulse-8.0/modules/module-bluetooth-policy.so': success
I: [pulseaudio] module.c: Loaded "module-bluetooth-policy" (index: #5;
argument: "").
D: [pulseaudio] module.c: Checking for existence of
'/lib/pulse-8.0/modules/module-bluetooth-discover.so': success
D: [pulseaudio] module.c: Checking for existence of
'/lib/pulse-8.0/modules/module-bluez5-discover.so': success
D: [pulseaudio] dbus-util.c: Successfully connected to D-Bus system
bus cdb2e23e5f00b38a19e1db440027 as :1.11
I: [pulseaudio] module.c: Loaded "module-bluez5-discover" (index: #7;
argument: "").
D: [pulseaudio] module.c: Checking for existence of
'/lib/pulse-8.0/modules/module-bluez4-discover.so': failure
I: [pulseaudio] module.c: Loaded "module-bluetooth-discover" (index:
#6; argument: "").
I: [pulseaudio] module.c: Loaded "module-native-protocol-unix" (index:
#8; argument: "").
D: [pulseaudio] module.c: Checking for existence of
'/lib/pulse-8.0/modules/module-gconf.so': failure
I: [pulseaudio]