Discussion:
[pulseaudio-discuss] bluetooth: HFP | WBS | pollfd->revent POLLOUT not hit
Sathish Narasimman
2018-07-02 13:25:53 UTC
Permalink
Hi,

I am trying to make WBS with PulseAudio. I am almost successful in
establishing the connection and making a WBS traffic.

But out of 10 attempts or sometimes the TX packets are not sent due to
POLLOUT is not reflected in the pollfd
/* Test if the stream is writable */
if (pollfd->revents & POLLOUT)
writable = true;

I would like to know what causes the stream as not writable.
What are the connecting modules to resolve this?
This happening only with WBS as NBS works good without any problem.


Thanks,
Sathish N
Luiz Augusto von Dentz
2018-07-04 15:59:14 UTC
Permalink
Hi Sathish,
Post by Sathish Narasimman
Hi,
I am trying to make WBS with PulseAudio. I am almost successful in
establishing the connection and making a WBS traffic.
But out of 10 attempts or sometimes the TX packets are not sent due to
POLLOUT is not reflected in the pollfd
/* Test if the stream is writable */
if (pollfd->revents & POLLOUT)
writable = true;
Are you sure you are polling with POLLOUT?
Post by Sathish Narasimman
I would like to know what causes the stream as not writable.
What are the connecting modules to resolve this?
This happening only with WBS as NBS works good without any problem.
Thanks,
Sathish N
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
--
Luiz Augusto von Dentz
Sathish Narasimman
2018-07-06 06:43:10 UTC
Permalink
Hi Luiz,

Yes, I am doing the polling. I an not changing that part of the code. In
which it is default in which NBS also uses.

Thanks,
Sathish N
Post by Luiz Augusto von Dentz
Hi Sathish,
Post by Sathish Narasimman
Hi,
I am trying to make WBS with PulseAudio. I am almost successful in
establishing the connection and making a WBS traffic.
But out of 10 attempts or sometimes the TX packets are not sent due to
POLLOUT is not reflected in the pollfd
/* Test if the stream is writable */
if (pollfd->revents & POLLOUT)
writable = true;
Are you sure you are polling with POLLOUT?
Post by Sathish Narasimman
I would like to know what causes the stream as not writable.
What are the connecting modules to resolve this?
This happening only with WBS as NBS works good without any problem.
Thanks,
Sathish N
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
--
Luiz Augusto von Dentz
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Georg Chini
2018-07-07 10:07:46 UTC
Permalink
Post by Sathish Narasimman
Hi Luiz,
Yes, I am doing the polling. I an not changing that part of the code.
In which it is default in which NBS also uses.
Thanks,
Sathish N
The current code does not poll for POLLOUT in all situations,
see comment in the code. You should check if POLLOUT is
really set in pollfd->events. Actually a situation like you
describe is "normal" but should not impact sound quality,
again see comment in the code. You could try if it helps to
remove the "if (blocks_to_write > 0)" and set writable=false
unconditionally.
Post by Sathish Narasimman
On Wed, Jul 4, 2018 at 9:29 PM, Luiz Augusto von Dentz
Hi Sathish,
On Mon, Jul 2, 2018 at 4:25 PM, Sathish Narasimman
Post by Sathish Narasimman
Hi,
I am trying to make WBS with PulseAudio. I am almost successful in
establishing the connection and making a WBS traffic.
But out of 10 attempts or sometimes the TX packets are not sent
due to
Post by Sathish Narasimman
POLLOUT is not reflected in the pollfd
                 /* Test if the stream is writable */
                 if (pollfd->revents & POLLOUT)
                     writable = true;
Are you sure you are polling with POLLOUT?
Post by Sathish Narasimman
I would like to know what causes the stream as not writable.
What are the connecting modules to resolve this?
This happening only with WBS as NBS works good without any problem.
Thanks,
Sathish N
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
<https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss>
--
Luiz Augusto von Dentz
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
<https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss>
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Georg Chini
2018-07-07 11:22:47 UTC
Permalink
Post by Georg Chini
Post by Sathish Narasimman
Hi Luiz,
Yes, I am doing the polling. I an not changing that part of the code.
In which it is default in which NBS also uses.
Thanks,
Sathish N
The current code does not poll for POLLOUT in all situations,
see comment in the code. You should check if POLLOUT is
really set in pollfd->events. Actually a situation like you
describe is "normal" but should not impact sound quality,
again see comment in the code. You could try if it helps to
remove the "if (blocks_to_write > 0)" and set writable=false
unconditionally.
In fact, in all situations where you are woken up by POLLOUT but you
do not have a block to write, POLLOUT will not be polled on the next
iteration to prevent unnecessary looping. Therefore removing the if
condition may not help much. Does the write_block_size equal the
read_block_size? In theory, different sizes are supported, but I think
it could cause issues.
Post by Georg Chini
Post by Sathish Narasimman
On Wed, Jul 4, 2018 at 9:29 PM, Luiz Augusto von Dentz
Hi Sathish,
On Mon, Jul 2, 2018 at 4:25 PM, Sathish Narasimman
Post by Sathish Narasimman
Hi,
I am trying to make WBS with PulseAudio. I am almost successful in
establishing the connection and making a WBS traffic.
But out of 10 attempts or sometimes the TX packets are not sent
due to
Post by Sathish Narasimman
POLLOUT is not reflected in the pollfd
                 /* Test if the stream is writable */
                 if (pollfd->revents & POLLOUT)
                     writable = true;
Are you sure you are polling with POLLOUT?
Post by Sathish Narasimman
I would like to know what causes the stream as not writable.
What are the connecting modules to resolve this?
This happening only with WBS as NBS works good without any problem.
Thanks,
Sathish N
Loading...