From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
linux-bluetooth@vger.kernel.org,
Lennart Poettering <lennart@poettering.net>
Subject: Re: SBC encoder/decoder API & errors handling
Date: Wed, 30 Jun 2010 13:07:45 +0000 [thread overview]
Message-ID: <201006301307.49874.siarhei.siamashka@gmail.com> (raw)
In-Reply-To: <20100630085347.GA31839@jh-x301>
[-- Attachment #1: Type: Text/Plain, Size: 2451 bytes --]
On Wednesday 30 June 2010 08:53:47 Johan Hedberg wrote:
> Hi Luiz,
>
> On Wed, Jun 30, 2010, Luiz Augusto von Dentz wrote:
> > audio/pcm_bluetooth.c:1060: encoded = sbc_encode(&a2dp->sbc,
> > data->buffer, a2dp->codesize,
> > audio/pcm_bluetooth.c:1096: encoded = sbc_encode(&a2dp->sbc, buff,
> > a2dp->codesize,
>
> My patch already contained the fix for these two.
>
> > audio/gstsbcenc.c:391: consumed = sbc_encode(&enc->sbc,
(gpointer) data,
>
> This place actually passes NULL as the output parameter so no issue
> there.
Well, it is still kind of an issue because some types of errors are not
detected here at all.
> I'll push in a minute the fix in two separate commits (the libsbc
> changes should be in an independent patch so they can easily be exported
> to external copies like pulseaudio).
Yes, I used exactly the same patch myself and it helped. It's a bit artificial
problem and does not need an urgent fix. I found it by running a script which
uses 'sbcenc' with lots with different permutations of configuration options
(some of them are invalid) and logs md5 hashes of the encoded results. But as
long as the SBC encoder is always used with valid settings, no problems should
happen.
Anyway, API inconsistency is a bit ugly. Maybe it's better to always report
errors as a negative function return value (and have real constants defined
instead of some magic numbers)? Or just adjust encoding settings to the closest
valid configuration automatically and never fail there?
Another SBC issue (I found this report just on the last weekend) is the missing
support for the dynamically changing bitpool value:
https://tango.0pointer.de/pipermail/pulseaudio-discuss/2010-January/006042.html
It is a clear problem for the SBC decoder (in addition to the other issues like
not so good audio quality and poor performance, which would have to be
addressed eventually).
But SBC encoder could also make some use of this changing bitpool feature to
adaptively change it when connection quality is not very good and audio would
start skipping otherwise (due to the interference from wifi, walking away from
the bluetooth dongle behind a concrete wall or anything else).
So would it be a good idea to just fix the issues in the bluez SBC code as we
feel appropriate and then notify pulseaudio developers about the changes?
--
Best regards,
Siarhei Siamashka
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-06-30 13:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-29 18:45 SBC encoder/decoder API & errors handling Siarhei Siamashka
2010-06-30 7:53 ` Johan Hedberg
2010-06-30 8:31 ` Luiz Augusto von Dentz
2010-06-30 8:53 ` Johan Hedberg
2010-06-30 13:07 ` Siarhei Siamashka [this message]
2010-06-30 11:03 ` Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201006301307.49874.siarhei.siamashka@gmail.com \
--to=siarhei.siamashka@gmail.com \
--cc=johan.hedberg@gmail.com \
--cc=lennart@poettering.net \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).