From: Fabien Chevalier <fabchevalier@free.fr>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] PATCH1/2: bluez-utils -fix-a2dp-buffer-constraints
Date: Wed, 17 Oct 2007 12:23:06 +0200 [thread overview]
Message-ID: <4715E28A.3080009@free.fr> (raw)
In-Reply-To: <000601c80f19$b92b2270$0f9db70a@NOE.Nokia.com>
Hello Kai,
> I've been testing with a low spec GNU/Debian desktop, and the problem has
> been too high CPU load leading to a continuous stream of XRUNs in
> the pcm_bluetooth.c code (i.e. no audio output at all). With the patch,
> on the same exact system, playback is flawless. And the problem only
> occurs with apps that always poll/select before writing to the device (i.e.
> not aplay). Relaxing the buffering constraints allows apps to feed audio
> to A2DP with less context switches and less system calls (bigger buffer
> fragments at a time basicly).
I'm quite interested in optimizations for low end ARM boxes :-)
Could you provide CPU details and the player you used to performed your
testing ? I'd like to be able to reproduce those on my Neo1973 box :-)
>
>>> - /* supported block size */
>>> + /* supported block sizes:
>>> + * - lower limit is A2DP codec size
>>> + * - total buffer size is the upper limit (with two periods) */
>>> err = snd_pcm_ioplug_set_param_minmax(io,
> SND_PCM_IOPLUG_HW_PERIOD_BYTES,
> [...]
>>> + /* supported buffer sizes */
>>> + err = snd_pcm_ioplug_set_param_minmax(io,
> SND_PCM_IOPLUG_HW_BUFFER_BYTES,
>>> + MIN_BUFFER_SIZE,
> MAX_BUFFER_SIZE);
>>> if (err < 0)
>>> return err;
>>
>> This part of the code is useless, you don't need to set
>> SND_PCM_IOPLUG_HW_BUFFER_BYTES if you set
>> SND_PCM_IOPLUG_HW_PERIODS, you just have to choose one of the
>> two alternatives :-)
>
> But if we'd drop setting mimax for BUFFER_BYTES, the application could
> request for 64 periods of size 'MAX_BUFFER_SIZE / 2' -> 524288 bytes.
> Of course we could fix this by limiting the max period size, but then
> the application couldn't use a buffering setup of two max-sized periods
> (good for robust playback). If we'd limit the max count of periods,
> application couldn't choose a buffering setup of lots of small
> buffer fragments (good for robust recording with minimal latency).
>
> So defining a minmax range for all three params gives more
> flexibility without requiring any added logic to the plugin
> code.
That's definately a good answer :-).
Maybe we should drop SND_PCM_IOPLUG_HW_PERIODS and keep
SND_PCM_IOPLUG_HW_BUFFER_BYTES only then ?
Cheers,
Fabien
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2007-10-17 10:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 12:25 [Bluez-devel] PATCH1/2: bluez-utils - fix-a2dp-buffer-constraints Kai Vehmanen
2007-10-14 3:36 ` Luiz Augusto von Dentz
2007-10-14 11:19 ` Fabien Chevalier
2007-10-15 10:54 ` [Bluez-devel] PATCH1/2: bluez-utils -fix-a2dp-buffer-constraints Kai Vehmanen
2007-10-17 10:23 ` Fabien Chevalier [this message]
2007-10-17 14:36 ` Kai.Vehmanen
-- strict thread matches above, loose matches on Subject: below --
2007-10-17 16:31 [Bluez-devel] PATCH1/2: bluez-utils - fix-a2dp-buffer-constraints Kai.Vehmanen
2007-10-18 10:08 ` Fabien Chevalier
2007-10-18 17:33 ` Jim Carter
2007-10-22 12:28 ` [Bluez-devel] PATCH1/2: bluez-utils -fix-a2dp-buffer-constraints Kai.Vehmanen
2007-10-22 20:15 ` Luiz Augusto von Dentz
2007-10-23 16:58 ` Fabien Chevalier
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=4715E28A.3080009@free.fr \
--to=fabchevalier@free.fr \
--cc=bluez-devel@lists.sourceforge.net \
/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).