A PCI bus based "professional" soundcard has a digital input (S/PDIF).
Connected this input to a CD player's output and recorded about 20 seconds
using waverecorder.

Found 12 "clicks" in the recorded WAV file.
The clicks are false sample values, exactly one false sample in each case
(sample rate does not matter, same at 22kHz, 44.1kHz, 48 kHz, 96 kHz).
Sample value is random (never full scale nor zero).

Searched for the clicks and determined their sample number.
10 of them have a sample number ending with "1", 2 of them end with "2", so
definitely *not random*.

Calculated the difference between sample numbers ending with "1".
Calculated the gcd (greatest common divisor) of these differences and found
that it is always 440 (or multiples of 440, e.g. 880, 2200).

Soundcard is a PCI busmaster, but has "Min_Gnt = 0" and "Max_Lat = 0".

My questions:
From the point of view of a device driver programmer do you have any idea
what goes wrong here?
What may the 440 stand for?

Juergen

Re: Occasionally false samples from a soundcard driver by Alexander

Alexander
Thu Mar 09 10:36:38 CST 2006

Maybe your "professional" sound card does internal conversion to 48000 and
then back to 44100? Maybe the soundcard SPDIF input cannot recover sample
clock from SPDIF?

I can speculate that the sound card is fed with 5 ms buffers. Because of
incorrect driver (or application), the buffer size may not be multiple of
sample size (5 ms=220.5 samples=882 bytes). This may cause the board to barf
at the last sample.

Why do you bother with S/PDIF for CD reading, anyway? Any $50 cheapo CDROM
will read exact data from your CD.

"Juergen Marquardt" <marquardt@alc.de> wrote in message
news:%23mrjj21QGHA.1688@TK2MSFTNGP11.phx.gbl...
>A PCI bus based "professional" soundcard has a digital input (S/PDIF).
> Connected this input to a CD player's output and recorded about 20 seconds
> using waverecorder.
>
> Found 12 "clicks" in the recorded WAV file.
> The clicks are false sample values, exactly one false sample in each case
> (sample rate does not matter, same at 22kHz, 44.1kHz, 48 kHz, 96 kHz).
> Sample value is random (never full scale nor zero).
>
> Searched for the clicks and determined their sample number.
> 10 of them have a sample number ending with "1", 2 of them end with "2",
> so
> definitely *not random*.
>
> Calculated the difference between sample numbers ending with "1".
> Calculated the gcd (greatest common divisor) of these differences and
> found
> that it is always 440 (or multiples of 440, e.g. 880, 2200).
>
> Soundcard is a PCI busmaster, but has "Min_Gnt = 0" and "Max_Lat = 0".
>
> My questions:
> From the point of view of a device driver programmer do you have any idea
> what goes wrong here?
> What may the 440 stand for?
>
> Juergen
>
>



Re: Occasionally false samples from a soundcard driver by m

m
Thu Mar 09 11:25:10 CST 2006

BTW: (probably unrelated) 440Hz is 'A' in standard tuning.


"Juergen Marquardt" <marquardt@alc.de> wrote in message
news:%23mrjj21QGHA.1688@TK2MSFTNGP11.phx.gbl...
>A PCI bus based "professional" soundcard has a digital input (S/PDIF).
> Connected this input to a CD player's output and recorded about 20 seconds
> using waverecorder.
>
> Found 12 "clicks" in the recorded WAV file.
> The clicks are false sample values, exactly one false sample in each case
> (sample rate does not matter, same at 22kHz, 44.1kHz, 48 kHz, 96 kHz).
> Sample value is random (never full scale nor zero).
>
> Searched for the clicks and determined their sample number.
> 10 of them have a sample number ending with "1", 2 of them end with "2",
> so
> definitely *not random*.
>
> Calculated the difference between sample numbers ending with "1".
> Calculated the gcd (greatest common divisor) of these differences and
> found
> that it is always 440 (or multiples of 440, e.g. 880, 2200).
>
> Soundcard is a PCI busmaster, but has "Min_Gnt = 0" and "Max_Lat = 0".
>
> My questions:
> From the point of view of a device driver programmer do you have any idea
> what goes wrong here?
> What may the 440 stand for?
>
> Juergen
>
>



Re: Occasionally false samples from a soundcard driver by Juergen

Juergen
Thu Mar 09 13:06:39 CST 2006

> Why do you bother with S/PDIF for CD reading, anyway? Any $50 cheapo CDROM
> will read exact data from your CD.

This - with CD - is just a test scenario.
Main goal is to move huge material from 32k sampled DAT tapes to PC.



Re: Occasionally false samples from a soundcard driver by m

m
Thu Mar 09 16:48:43 CST 2006

In any case, you should contact the manufacturer



"Juergen Marquardt" <marquardt@alc.de> wrote in message
news:dupubk$at5$01$1@news.t-online.com...
>> Why do you bother with S/PDIF for CD reading, anyway? Any $50 cheapo
>> CDROM will read exact data from your CD.
>
> This - with CD - is just a test scenario.
> Main goal is to move huge material from 32k sampled DAT tapes to PC.
>
>



Re: Occasionally false samples from a soundcard driver by Alexander

Alexander
Thu Mar 09 23:43:48 CST 2006

This 440 samples thing may be just an artifact of CD sample rate vs bogus
buffer size. If it's your application, make sure you feed properly sized
buffers to the soundcard.

"Juergen Marquardt" <marquardt@alc.de> wrote in message
news:dupubk$at5$01$1@news.t-online.com...
>> Why do you bother with S/PDIF for CD reading, anyway? Any $50 cheapo
>> CDROM will read exact data from your CD.
>
> This - with CD - is just a test scenario.
> Main goal is to move huge material from 32k sampled DAT tapes to PC.
>
>



Re: Occasionally false samples from a soundcard driver by Juergen

Juergen
Fri Mar 10 01:01:39 CST 2006

Some more details:

Soundcard is based on an ICE-1712 Envy24 PCI interface.
SPDIF interface is Cirrus CS8427.
A/D-D/A is AKM AK4524.
OS is WinXP Prof. SP2.
Mainboard is ASUS P4PE, chipset is Intel 845PE (82801).
CPU is Pentium 4, 2.8 GHz, RAM is 1GB.
Soundcard sits in PCI slot 5, IRQ 9, slot 5 shares IRQ only with (empty)
slot 1, so IRQ 9 is exclusively for soundcard.

Recording application is WaveLab Lite 2.0 (but getting comparable results
with Audacity, Windows recorder...).

Getting clicks no matter if using digital/SPDIF or analog inputs.
Getting clicks no matter of which sample rate using (tried 22.050k to
96.000k).
Getting clicks only if some "level" is there, getting no clicks while
recording silence.
Absolute no clicks are heard on line out/headphone while recording.

These are the sample numbers of false samples for SPDIF optical in at 44.1k
(always exactly one false sample) as shown by Audacity:

0 start of silence
177074 (ca.) start of music
182602 4,140635 sec
194481 4,410000 sec diff: 11879
247281 5,607279 sec diff: 52800 (gcd : 1320; for 11880)
248161 5,627234 sec diff: 880 gcd : 880
279841 6,345601 sec diff: 31680 gcd : 880
459801 10,426327 sec diff:179960 gcd : 440
492801 11,174626 sec diff: 33000 gcd : 440
523161 11,863061 sec diff: 30360 gcd : 1320
705761 16,003651 sec diff:182600 gcd : 440
726001 16,462608 sec diff: 20240 gcd : 440
754602 17,111156 sec diff: 28601 (gcd : 440; for 28600)
796401 18,058980 sec diff: 41799 (gcd : 2200, for 41800/28600)
999241 22,658526 sec diff:202840 (gcd : 440; for 41800)
1049841 23,805918 sec diff: 50600 gcd : 440

Wondering if these PCI Config Space entries are ok:
Soundcard is a PCI busmaster, but has "Min_Gnt = 0" and "Max_Lat = 0".




Re: Occasionally false samples from a soundcard driver by Alexander

Alexander
Fri Mar 10 10:07:49 CST 2006

Get any cheap SPDIF card (Creative?) and try with it. It looks like 5 ms
(internal?) buffer issue.

"Juergen Marquardt" <marquardt@alc.de> wrote in message
news:dur887$av0$02$1@news.t-online.com...
> Some more details:
>
> Soundcard is based on an ICE-1712 Envy24 PCI interface.
> SPDIF interface is Cirrus CS8427.
> A/D-D/A is AKM AK4524.
> OS is WinXP Prof. SP2.
> Mainboard is ASUS P4PE, chipset is Intel 845PE (82801).
> CPU is Pentium 4, 2.8 GHz, RAM is 1GB.
> Soundcard sits in PCI slot 5, IRQ 9, slot 5 shares IRQ only with (empty)
> slot 1, so IRQ 9 is exclusively for soundcard.
>
> Recording application is WaveLab Lite 2.0 (but getting comparable results
> with Audacity, Windows recorder...).
>
> Getting clicks no matter if using digital/SPDIF or analog inputs.
> Getting clicks no matter of which sample rate using (tried 22.050k to
> 96.000k).
> Getting clicks only if some "level" is there, getting no clicks while
> recording silence.
> Absolute no clicks are heard on line out/headphone while recording.
>
> These are the sample numbers of false samples for SPDIF optical in at
> 44.1k
> (always exactly one false sample) as shown by Audacity:
>
> 0 start of silence
> 177074 (ca.) start of music
> 182602 4,140635 sec
> 194481 4,410000 sec diff: 11879
> 247281 5,607279 sec diff: 52800 (gcd : 1320; for 11880)
> 248161 5,627234 sec diff: 880 gcd : 880
> 279841 6,345601 sec diff: 31680 gcd : 880
> 459801 10,426327 sec diff:179960 gcd : 440
> 492801 11,174626 sec diff: 33000 gcd : 440
> 523161 11,863061 sec diff: 30360 gcd : 1320
> 705761 16,003651 sec diff:182600 gcd : 440
> 726001 16,462608 sec diff: 20240 gcd : 440
> 754602 17,111156 sec diff: 28601 (gcd : 440; for 28600)
> 796401 18,058980 sec diff: 41799 (gcd : 2200, for 41800/28600)
> 999241 22,658526 sec diff:202840 (gcd : 440; for 41800)
> 1049841 23,805918 sec diff: 50600 gcd : 440
>
> Wondering if these PCI Config Space entries are ok:
> Soundcard is a PCI busmaster, but has "Min_Gnt = 0" and "Max_Lat = 0".
>
>
>



Re: Occasionally false samples from a soundcard driver by Juergen

Juergen
Sat Mar 11 02:32:10 CST 2006

> Get any cheap SPDIF card (Creative?) and try with it.

Pragmatic solution, of course.
But cards capable of 32k via SPDIF In are hard to find.
All I found so far are AC97 cards which resample twice (from 32k to 48k and
back to 32k).
Same applies for Creative and USB cards.
Juergen