* Re: Intel ICH programming & ALSA driver
@ 2006-11-10 17:25 Thomas Witzel
2006-11-13 8:51 ` Clemens Ladisch
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Witzel @ 2006-11-10 17:25 UTC (permalink / raw)
To: alsa-devel
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, Thomas
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Intel ICH programming & ALSA driver
2006-11-10 17:25 Intel ICH programming & ALSA driver Thomas Witzel
@ 2006-11-13 8:51 ` Clemens Ladisch
[not found] ` <200611131558.44643.witzel.thomas@comcast.net>
0 siblings, 1 reply; 6+ messages in thread
From: Clemens Ladisch @ 2006-11-13 8:51 UTC (permalink / raw)
To: witzel.thomas, alsa-devel
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Intel ICH programming & ALSA driver
@ 2006-11-08 14:52 witzel.thomas
0 siblings, 0 replies; 6+ messages in thread
From: witzel.thomas @ 2006-11-08 14:52 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: alsa-devel
-------------- Original message ----------------------
From: "Clemens Ladisch" <cladisch@fastmail.net>
> Thomas Witzel wrote:
> > I'm not sure this really belongs here, but I have nowhere else to ask. I'm
> > writing an Intel ICH sound driver for Xenomai (real time Linux) and got stuck
> > with no sound. I'm not doing this for a common audio application but rather
> > in an attempt to generate an experimental setup with low-cost arbitrary
> > waveform function generators (which are the sound chips).
> > Long story short, I learned as much as I could from looking at the ALSA driver
> > and the datasheet.
>
> Did you read the PRM, too?
Yes, that gave me the instructions on how to do the DMA.
> > I'm running the DMA on the PCM OUT I believe, but I get no sound. I
> > set all mixer volume controls to max (and read them back to confirm)
> > and make sure they are unmuted. Codec one is ready, AC97 power is up.
>
> What codec are you using? Many codecs must be configured to route the
> sound to the correct output.
On my development machine its a ALC650 (RealTek) in the oldest incarnation (0x414c,0x4720).
If it helps I can post an archive of my code somewhere.
Thanks for your help so far
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Intel ICH programming & ALSA driver
@ 2006-11-08 1:28 Thomas Witzel
2006-11-08 13:04 ` Clemens Ladisch
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Witzel @ 2006-11-08 1:28 UTC (permalink / raw)
To: alsa-devel
Hello,
I'm not sure this really belongs here, but I have nowhere else to ask. I'm
writing an Intel ICH sound driver for Xenomai (real time Linux) and got stuck
with no sound. I'm not doing this for a common audio application but rather
in an attempt to generate an experimental setup with low-cost arbitrary
waveform function generators (which are the sound chips).
Long story short, I learned as much as I could from looking at the ALSA driver
and the datasheet. I'm setting up the DMA buffers, I give the chip the Buffer
Descriptor table and after I start the DMA I get a while later an interrupt
that the LVI was reached and handle that. I'm running the DMA on the PCM OUT
I believe, but I get no sound. I set all mixer volume controls to max (and
read them back to confirm) and make sure they are unmuted. Codec one is
ready, AC97 power is up. Everything looks fine.
So now I'm wondering what I'm doing wrong. I filled the buffers for the sound
with random values, which might be wrong, but I was hoping to get some
crackling or noise at least.
On a different note, it seems that the ALSA driver is writing to the CIV
register, even though the Intel datasheet indicates this to be read-only.
Thank you for any useful hints in advance,
Thomas
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Intel ICH programming & ALSA driver
2006-11-08 1:28 Thomas Witzel
@ 2006-11-08 13:04 ` Clemens Ladisch
0 siblings, 0 replies; 6+ messages in thread
From: Clemens Ladisch @ 2006-11-08 13:04 UTC (permalink / raw)
To: witzel.thomas, alsa-devel
Thomas Witzel wrote:
> I'm not sure this really belongs here, but I have nowhere else to ask. I'm
> writing an Intel ICH sound driver for Xenomai (real time Linux) and got stuck
> with no sound. I'm not doing this for a common audio application but rather
> in an attempt to generate an experimental setup with low-cost arbitrary
> waveform function generators (which are the sound chips).
> Long story short, I learned as much as I could from looking at the ALSA driver
> and the datasheet.
Did you read the PRM, too?
> I'm setting up the DMA buffers, I give the chip the Buffer Descriptor
> table and after I start the DMA I get a while later an interrupt that
> the LVI was reached and handle that.
The DMA engine seems to be running OK.
> I'm running the DMA on the PCM OUT I believe, but I get no sound. I
> set all mixer volume controls to max (and read them back to confirm)
> and make sure they are unmuted. Codec one is ready, AC97 power is up.
What codec are you using? Many codecs must be configured to route the
sound to the correct output.
> On a different note, it seems that the ALSA driver is writing to the CIV
> register, even though the Intel datasheet indicates this to be read-only.
It's only written to when initalizing the device. I don't know why, but
it might be for one of the ICH (not-quite-)clones by other manufacturers.
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-11-13 16:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-10 17:25 Intel ICH programming & ALSA driver Thomas Witzel
2006-11-13 8:51 ` Clemens Ladisch
[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
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.