From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: "Marian Harbach" <harbach@mathematik.uni-marburg.de>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: gstreamer and sbcdec problem
Date: Wed, 16 Dec 2009 02:03:47 +0200 [thread overview]
Message-ID: <200912160203.53737.siarhei.siamashka@gmail.com> (raw)
In-Reply-To: <002301ca7dd1$cb5fa3c0$621eeb40$@uni-marburg.de>
[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]
On Tuesday 15 December 2009, Marian Harbach wrote:
> Hi,
>
> I have the same problem as described in this post:
>
> http://www.spinics.net/lists/linux-bluetooth/msg03627.html
This looks like either some completely random garbage gets there (valgrind
can probably help), or the decoder is not reinitialized properly and has
some stale data from the previous decode in some of its internal buffers.
> I found that depending on filesize, the original input is delayed by some
> bytes (180-260 for 16kHz PCM input)
SBC introduces some delay to the audio data due to the way how it works.
Some of the trailing samples of the buffer you feed to the 'sbc_encode'
function are actually not represented fully in the encoded data for this
frame, but are kept in the ring buffer and get processed later on
next 'sbc_encode' call.
The reference binary encoder introduces exactly the same delay.
> and additionally the first few samples
> are overwritten when doing sbcenc followed by sbcdec.
Could you please clarify this part? In what way and where do they get
overwritten (in files, memory buffers, ...)?
> Is there a fix for this issue?
My guess is that the client application can be aware of this delay and take it
into account somehow.
Also I don't have much trust in the current bluez SBC decoder implementation.
Its quality may be not the very best. I was considering to eventually review
its code, do some refactoring and merge some of its parts with the encoder
(SBC encode and decode are quite symmetric), but did not find some spare
time for this yet. Considering that bluez got SBC sink support now, improving
the decoder may make sense.
--
Best regards,
Siarhei Siamashka
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2009-12-16 0:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-15 21:58 gstreamer and sbcdec problem Marian Harbach
2009-12-16 0:03 ` Siarhei Siamashka [this message]
2009-12-16 8:28 ` AW: " Marian Harbach
2009-12-16 10:15 ` Siarhei Siamashka
2009-12-16 11:41 ` João Paulo Rechi Vita
2009-12-17 6:41 ` Siarhei Siamashka
2009-12-17 12:49 ` João Paulo Rechi Vita
2009-12-17 14:53 ` Siarhei Siamashka
2009-12-17 16:35 ` João Paulo Rechi Vita
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=200912160203.53737.siarhei.siamashka@gmail.com \
--to=siarhei.siamashka@gmail.com \
--cc=harbach@mathematik.uni-marburg.de \
--cc=linux-bluetooth@vger.kernel.org \
/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).