From: Paolo Losi <p.losi@hypersonic.it>
To: Benno Senoner <sbenno@gardena.net>
Cc: alsa-devel@lists.sf.net
Subject: Re: Event Based time synchronization with ALSA
Date: Tue, 18 Jan 2005 12:47:11 +0100 [thread overview]
Message-ID: <41ECF73F.7070404@hypersonic.it> (raw)
In-Reply-To: <41EBEB8F.9030009@gardena.net>
Hi Benno,
thank you very much for you response.
Benno Senoner wrote:
> The above routine has the advantage that you can use any kind of
> periodsize (fragment size) in ALSA
> and the send_rtp packet() always gets 20msec worth of data.
> But you must ensure that the ALSA period size must be <20msec ,
> otherwise too much jitter is introduced.
I see your point.... but I would have two objections:
- I don't want/can't use threads
- I get too much jitter
If I make poll timeout every 20ms in the main loop,
I'm sure I get 20ms worth of data
so I can busy loop to reading (in blocking mode) all samples
(If I would want to enforced that period is power of two, I could
choose the max power of two number of samples that is divider of the
required number of samples)
That would be 8000HZ sampling for 20ms => 160 sample per packet
=> 5 32samples reads
But I'd rather tell ALSA: "please wake up poll as soon as you have
160 samples available". Is that feaseble? Can I expect to be always
woken up?
How
snd_pcm_sw_params_set_avail_min
snd_pcm_sw_params_set_sleep_min
snd_pcm_sw_params_set_start_threshold
relates to my problem?
I tried to read the API doc but, since I've no experience with audio
programming, I didn't get all the points...
Can anyone point to a good poll based read example?
thanks again benno!
Paolo
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
next prev parent reply other threads:[~2005-01-18 11:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-17 10:50 Event Based time synchronization with ALSA Paolo Losi
2005-01-17 16:45 ` Benno Senoner
2005-01-17 19:46 ` Jaroslav Kysela
2005-01-18 9:40 ` Takashi Iwai
2005-01-18 11:47 ` Paolo Losi [this message]
2005-01-18 13:46 ` Benno Senoner
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=41ECF73F.7070404@hypersonic.it \
--to=p.losi@hypersonic.it \
--cc=alsa-devel@lists.sf.net \
--cc=sbenno@gardena.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.