<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>I was reading over this thread while researching a fix for
my problem.&nbsp;&nbsp; I thought I would share what I happening on my machine,
and hopefully it will provide you with some insight into your situation.&nbsp;&nbsp;
I don&#8217;t have the answer yet, but maybe I can provide a different view of what
the problem is.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I am currently trying to get 4 PCI cards with 8 channels to
work with a new motherboard (MSI Neo 3FR).&nbsp;&nbsp; I also have an nvidia GeForce
9600 NGO video card, an Intel Core2 Extreme Quad processor, 4 GB of memory, and
4 Sata II disks installed. &nbsp;&nbsp;I am currently running Fedora Core 8,
with CCRMA modifications for sound.&nbsp;&nbsp; The audio card is an old Gadget
Labs card, and there is a linux driver, but it isn&#8217;t part of the Alsa
tree yet.&nbsp;&nbsp; I have to compile and install a module to make the Gadget
Labs cards work.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I can easily get 3 cards working (24 channels), but I am
needing to do some &#8216;black magic&#8217; to get 4 cards working.&nbsp;&nbsp;
I am not getting any sound out of the fourth soundcard.&nbsp; So far, it sounds
familiar, doesn&#8217;t it? (not enough channels coming out).&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;One
of the benefits of having the new linux driver is that there is already some
basic diagnostics built into the driver, and you can see reports in
/var/log/messages of how long it takes to open or close the card to it&#8217;s
memory buffer.&nbsp;&nbsp; This was originally used because the interface chip
was so old that it didn&#8217;t have DMA, and a &#8216;software DMA&#8217; had
to be written, and this was the mechanism to test the card/driver and figure
out its performance.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>For my particular system, because I can run a test and see
the driver performance in /var/log/messages (I&#8217;m using Jack/Ardour for &#8216;high
level stuff, &nbsp;aplay, arecord, etc for low level stuff), I have seen that
the video card driver is sending a bunch of interrupts down the PCI bus (even
though it is on PCI Express).&nbsp;&nbsp; The particular driver that is sending
the interrupts down the PCI bus is called NV, and is an open source
implementation of NVidia drivers.&nbsp; I get rid of all graphics by issuing &#8216;init
3&#8217; instead of being at the normal runlevel 5 (graphics).<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>As an example for playback only, here are some statistics
for one card in the graphics mode:<o:p></o:p></p>

<p class=MsoPlainText>[root@localhost tmp]# cat /var/log/messages |grep ISR<o:p></o:p></p>

<p class=MsoPlainText>...<o:p></o:p></p>

<p class=MsoPlainText>Dec 13 12:18:23 localhost kernel: api_gl824_stop ISR took
between 47 and 137 samples<o:p></o:p></p>

<p class=MsoPlainText>Dec 13 12:18:23 localhost kernel: api_gl824_stop Buffer
transfers TO CARD within ISR took between 11 and 100 samples<o:p></o:p></p>

<p class=MsoPlainText>Dec 13 12:18:23 localhost kernel: api_gl824_stop Buffer
transfers FROM CARD within ISR took between 35 and 125 samples<o:p></o:p></p>

<p class=MsoNormal>(There is a &nbsp;128 &nbsp;sample-memory on the card.&nbsp;
It is easier to deal with samples than time, so the 44100khz or 48000khz can be
scaled more easily.&nbsp;&nbsp; What you are seeing is that I am about to run
out of time on the PCI bus if I only have 128 samples to play with)<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>When I go to a non-graphics mode with init 3, I get the
following results:<o:p></o:p></p>

<p class=MsoPlainText>[root@localhost tmp]# cat /var/log/messages<o:p></o:p></p>

<p class=MsoPlainText>...<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:03:22 localhost kernel: pcm_gl824_output_trigger 0<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:03:22 localhost kernel: api_gl824_stop Master
card's clock position stopped at 1540<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:03:22 localhost kernel: api_gl824_stop ISR took
between 2 and 4 samples<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:03:22 localhost kernel: api_gl824_stop Buffer
transfers TO CARD within ISR took between 2 and 4 samples<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:03:22 localhost kernel: api_gl824_stop Buffer
transfers FROM CARD within ISR took between 0 and 1 samples<o:p></o:p></p>

<p class=MsoNormal>&#8230;<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:07:48 localhost kernel: pcm_gl824_output_trigger 0<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:07:48 localhost kernel: api_gl824_stop Master
card's clock position stopped at 1932<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:07:48 localhost kernel: api_gl824_stop ISR took between
10 and 12 samples<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:07:48 localhost kernel: api_gl824_stop Buffer
transfers TO CARD within ISR took between 10 and 11 samples<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:07:48 localhost kernel: api_gl824_stop Buffer
transfers FROM CARD within ISR took between 0 and 1 samples<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:07:48 localhost kernel: pcm_gl824_output_hw_free<o:p></o:p></p>

<p class=MsoNormal>Dec 13 22:07:48 localhost kernel: pcm_gl824_output_close<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>What this means is that some interrupt in the graphics mode
was taking up all the PCI bus.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Now, further testing in nongraphic mode revealed that there
is still an issue with hard disk interrupts taking up a lot of PCI bus time.<o:p></o:p></p>

<p class=MsoNormal>I&#8217;m running arecord and aplay for about 30 seconds to
see what the performance is.&nbsp;&nbsp; I&#8217;m recording and playing back 8
channels at once in the 32 bit noninterleaved mode.&nbsp; After I record 8
channels for about 30 seconds with arecord (creating one honkin&#8217; big
file) and playing it back with aplay, I get the following stats when looking at
the output of the card:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Dec 14 09:39:15 localhost kernel:
pcm_gl824_output_trigger 0<o:p></o:p></p>

<p class=MsoPlainText>Dec 14 09:39:15 localhost kernel: api_gl824_stop Master
card's clock position stopped at 397<o:p></o:p></p>

<p class=MsoPlainText>Dec 14 09:39:15 localhost kernel: api_gl824_stop ISR took
between 11 and 1498 samples<o:p></o:p></p>

<p class=MsoPlainText>Dec 14 09:39:15 localhost kernel: api_gl824_stop Buffer
transfers TO CARD within ISR took between 0 and 98 samples<o:p></o:p></p>

<p class=MsoPlainText>Dec 14 09:39:15 localhost kernel: api_gl824_stop Buffer
transfers FROM CARD within ISR took between 0 and 39 samples<o:p></o:p></p>

<p class=MsoPlainText>Dec 14 09:39:15 localhost kernel:
pcm_gl824_output_hw_free<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>This means that there are still interrupts happening on the
PCI bus while the card is trying to play.&nbsp;&nbsp; I&#8217;m reading the
following link to determine what is the best next thing to do, but I&#8217;m
also looking at a modern equivalent to &#8216;hdparm&#8217; (and maybe hdparm
if I can get it to work with my Sata disks).<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Here&#8217;s a link that gives an approach to solving the
problem:<o:p></o:p></p>

<p class=MsoNormal><a
href="http://www.gentoo.org/doc/en/articles/hardware-stability-p2.xml">http://www.gentoo.org/doc/en/articles/hardware-stability-p2.xml</a><o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>In my opinion, the problem I&#8217;m having is because the
hard disks are &#8216;too fast&#8217; with &#8216;too much priority&#8217; and
are taking up too much bandwidth on the PCI bus.&nbsp;&nbsp; You may be having
the same thing happen.&nbsp;&nbsp; It may be that instead of your problem being
that your disks are too slow, the real problem is that your disk may be too fast.&nbsp;&nbsp;
I remember having very severe problems with disk interrupts when I first
started using this software and scsi disks on a Sun V20z (which are much faster
than IDE or SATA).&nbsp;&nbsp; Once I switched to a normal PC (with slower IDE
disks), the underruns just disappeared.&nbsp;&nbsp; Fortunately with that
setup, you could actually hear the disks move and see the underruns happen at
the same time.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>If anyone else has been down this road and knows of how to
solve the underlying issues (sata hard disk interrupts taking up too much PCI
bandwidth), I am still searching for an answer and I&#8217;m VERY interested in
hearing something from you.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Thanks in advance,<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Mike Mazarick<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

<p class=MsoNormal>If someone else has been down this road<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>