From: "Clemens Ladisch" <cladisch@fastmail.net>
To: witzel.thomas@comcast.net, alsa-devel@lists.sourceforge.net
Subject: Re: Intel ICH programming & ALSA driver
Date: Mon, 13 Nov 2006 09:51:34 +0100 [thread overview]
Message-ID: <1163407894.22401.275661099@webmail.messagingengine.com> (raw)
In-Reply-To: <200611101225.55072.witzel.thomas@comcast.net>
Thomas Witzel wrote:
> BTW, If anyone cares to help me on this one, I made the code available at:
> https://www.nmr.mgh.harvard.edu/~twitzel/rti8xx.tar.bz2
Thanks.
in function rt_i8xx_singlebuffer_bdbars():
> /* in case the DMA is running, stop it now
> I'm setting value to 2, so that the ich state is reset. Otherwise
> (val = 0) would only pause the DMA
> */
> val = 2;
> busmaster_putbyte(chip, chip->ichd[idx].reg_offset + ICH_REG_OFF_CR, val);
It shouldn't be necessary to reset the DMA engine here. This code
should be moved to the chip initialization.
And if DMA is running, your code must stop it and wait for it to be
actually stopped before a reset.
After setting the reset bit, you have to wait for the reset to be
completed.
> chip->ichd[idx].bdbar[1] = cpu_to_le32(0x80000000 | 32768/2);
You allocate a buffer having 262144 bytes. With 32-bit samples, the
buffer has 65536 samples. With two channels, it has 32768 frames. With
two periods in the buffer, one period has 131072 bytes or 32768 samples
or 16384 frames.
The number of samples for this buffer list entry should be 32768.
in function rt_i8xx_interrupt():
> /* Now at this point we could either do something about setting a new buffer,
> or just stop the DMA.
> For now just stop the DMA
> */
> val = 2;
> busmaster_putbyte(ctx->chip, ctx->chip->ichd[1].reg_offset + ICH_REG_OFF_CR, val);
I don't think it's a good idea to reset the DMA when _any_ interrupt
occurs; this could be too early. You could just wait for it to halt by
itself when the last buffer entry is reached, and reset the DMA when the
device is closed.
in function rt_i8xx_open():
> mixer_putword(ctx->chip, 0x02, 0x7fff);
> mixer_putword(ctx->chip, 0x06, 0x7fff);
> ...
The mixer_putword() function just writes a value to a ICH's mixer
control register. You have to wait for the write to be completed on the
AC'97 bus before you can write the next value.
> if(global_sta & 0x100)
> rtdm_printk("\t Primary CODEC ready\n");
Is it?
> for(k=0; k<65536; k++)
> iptr[k] = (65536-k)<<16+(65536);
This generates a triangle wave with a frequency of about 1.5 Hz. Both
the codec and the analog components will filter it out.
To generate random noise, use something like this:
unsigned int r = 22222;
for (k = 0; k < 65536; ++k) {
r = r * 96314165 + 907633515;
iptr[k] = r;
}
HTH
Clemens
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
next prev parent reply other threads:[~2006-11-13 8:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-10 17:25 Intel ICH programming & ALSA driver Thomas Witzel
2006-11-13 8:51 ` Clemens Ladisch [this message]
[not found] ` <200611131558.44643.witzel.thomas@comcast.net>
2006-11-13 16:40 ` Clemens Ladisch
-- strict thread matches above, loose matches on Subject: below --
2006-11-08 14:52 witzel.thomas
2006-11-08 1:28 Thomas Witzel
2006-11-08 13:04 ` 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=1163407894.22401.275661099@webmail.messagingengine.com \
--to=cladisch@fastmail.net \
--cc=alsa-devel@lists.sourceforge.net \
--cc=witzel.thomas@comcast.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.