All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Hesseler <wolf1122@gmx.net>
To: alsa-devel@lists.sourceforge.net
Subject: Re: Callback after a specified number of samples
Date: Mon, 30 Sep 2002 20:46:46 +0200	[thread overview]
Message-ID: <3D989C16.74A1@gmx.net> (raw)
In-Reply-To: 20020930145227.16640gmx1@mx003-rz3.gmx.net

Paul Davis <pbd@op.net> wrote:
 
>    [ please forward to alsa-devel@lists.sourceforge.net. thanks. ]
> 
> >> however, it won't do what you want, because the resolution is limited
> >> to the interrupt frequency of the audio card, and for just about every
> >> interface out there, this is almost always a power of 2 value.
> >
> >Is this an Alsa design or a hardware limitation?
> 
> hardware limitation.
> 
> >> to put it another way, your approach is wrong :) syncing audio and
> >> video needs to be done differently. audio has a much higher frame
> >> rate, so use that as the basic time source, and simply redraw the
> >> screen at suitable intervals (preferably the vertical refresh
> >> interval), using the current audio "time" as a guide to what to draw.
> >
> >You think of polling snd_pcm_avail_update and drawing the picture when
> >the calculated number of samples have been played?
> 
> sure, if you want to burn 90-100% of your available CPU cycles on the
> poll.
> 
> look, the screen gets redrawn at most 80 times a second and regular
> video is at most 30 frames a second. that contrasts with the audio
> frame rate by 2 orders of magnitude. if you had a way to redraw the
> screen at the start of the vertical refresh cycle, you could maintain
> absolutely perfect sync without anything more than a way to ask "which
> audio frame is audible right now?", which ALSA provides.
> 
> unfortunately, as i understand it, X provides no way to do this
> without hacks and patches, so you have to settle for a given frame
> rate, timed by the kernel with usleep(2), and then do the same check
> on the current audible frame when you wake up to redraw the screen.
> 
> --p



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

       reply	other threads:[~2002-09-30 18:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020930145227.16640gmx1@mx003-rz3.gmx.net>
2002-09-30 18:46 ` Wolfgang Hesseler [this message]
     [not found] <20020929195903.6404gmx1@mx024-rz3.gmx.net>
2002-09-30 14:17 ` Callback after a specified number of samples Wolfgang Hesseler
2002-09-30 16:08   ` tomasz motylewski
2002-09-30 18:27     ` Jaroslav Kysela
2002-09-30 20:48       ` tomasz motylewski
2002-10-09  5:58         ` Jaroslav Kysela
2002-09-29 19:14 Wolfgang Hesseler
2002-09-29 20:07 ` Jaroslav Kysela

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=3D989C16.74A1@gmx.net \
    --to=wolf1122@gmx.net \
    --cc=alsa-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 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.