All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Boullis <nboullis@debian.org>
To: alsa-devel@lists.sourceforge.net
Subject: Re: writing an alsa driver for an MPEG decoder chip
Date: Mon, 29 Aug 2005 00:35:56 +0200	[thread overview]
Message-ID: <20050828223555.GA16031@home> (raw)
In-Reply-To: <431233D5.4020502@superbug.co.uk>

Hi,

On Sun, Aug 28, 2005 at 10:59:49PM +0100, James Courtier-Dutton wrote:
> 
> I looked at the code. The period and buffer size selection looks a bit 
> wrong. Can you explain to me what the actual buffer contraints are for 
> the em8300 card? It looks to me that the only current contraint is 
> number of periods. This seems to me to be rather a strange contrain to have.

First of all, thanks for your answer.
Unfortunately, I have to admit that I'm not sure I have undestood what 
periods really are.

The em8300 chip uses a small on-chip circular buffer (whose size is 
given by the read_ucregister(MA_PCISize) call) as a FIFO. This FIFO is 
fed with structs that contain both a pointer to some sound data in main 
memory and size of this buffer. The structs have a size of 3, which 
means the cicrular buffer has a size of read_ucregister(MA_PCISize)/3 
elements.

A fifo engine takes all elements in the fifo in order. For each element, 
the DMA engine gets the sound data from main memory, and the sound is 
played. Sometimes, the chip raises an interruption when the DMA engine 
as finished reading a buffer. (That's generally once every two buffers, 
but it happens that 2 consecutive buffers both lead to an interruption. 
I never understood how that works...)

Hence, I thought I should set up read_ucregister(MA_PCISize)/3 static 
buffers of random (well, <65536 bytes) size, and let each buffer 
correspond to 1 period.

Do you think this is broken and this could explain why most applications 
fail to get any sound, while xmms succeeds?


Thanks for your help,

Nicolas Boullis


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

  reply	other threads:[~2005-08-28 22:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-28 14:46 writing an alsa driver for an MPEG decoder chip Nicolas Boullis
2005-08-28 21:59 ` James Courtier-Dutton
2005-08-28 22:35   ` Nicolas Boullis [this message]
2005-08-28 22:51     ` James Courtier-Dutton
2005-08-28 23:36       ` Nicolas Boullis
2005-08-29  0:04         ` James Courtier-Dutton
2005-08-29 17:45           ` Nicolas Boullis

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=20050828223555.GA16031@home \
    --to=nboullis@debian.org \
    --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.