From: Clemens Ladisch <clemens@ladisch.de>
To: Stefano Panella <stefano.panella@citrix.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: paravirtualized alsa kernel driver for XEN
Date: Thu, 22 Mar 2012 13:09:09 +0100 [thread overview]
Message-ID: <4F6B1665.6070402@ladisch.de> (raw)
In-Reply-To: <4F6B0B86.20603@citrix.com>
Stefano Panella wrote:
> The backend in dom0 is a userspace process using portaudio on top of alsa.
> The process is running in realtime priority and is calling a callback to
> feed data every 64 frames.
> In the callback I copy 64 frames from the shared pages to the portaudio
> buffer and update the HW pointer in an other shared page accordingly.
If PortAudio requires to use a callback, this is the only algorithm
that you can implement.
> Would it be possible to run the backend in dom0 kernel space and to use
> my shared pages from the alsa-driver in the VM as real pages for the HW?
No, the buffer pages are always under the control of and allocated by
the actual driver (some devices might have special requirements, or do
not support mmap at all).
If the actual driver support mmap, you would have to map these dom0
pages into the VM, and I guess this is not possible. (?)
As far as I can see, you have two options:
1) Stay with the current algorithm. You get an additional latency
corresponding to dom0's buffer size, and your process is forced to
wake up every 64 frames (or whatever PortAudio is configured for).
2) Replace PortAudio with ALSA in the backend, and implement the copy
callback in your driver. Any call of snd_pcm_write*() in the VM will
result in one or more calls to your driver's copy(), which should end
up as a call to snd_pcm_write*() in dom0. (Using the copy callback
also implies that the driver does not support mmap.)
Regards,
Clemens
next prev parent reply other threads:[~2012-03-22 12:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 17:15 paravirtualized alsa kernel driver for XEN Stefano Panella
2012-03-20 9:52 ` David Henningsson
2012-03-21 10:11 ` Stefano Panella
2012-03-20 13:10 ` Clemens Ladisch
2012-03-21 10:16 ` Stefano Panella
2012-03-21 13:37 ` Clemens Ladisch
2012-03-22 11:22 ` Stefano Panella
2012-03-22 12:09 ` Clemens Ladisch [this message]
2012-04-11 17:08 ` Stefano Panella
2012-04-11 18:41 ` Clemens Ladisch
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=4F6B1665.6070402@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=stefano.panella@citrix.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 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.