From alsa-devel-owner@alsa.jcu.cz  Fri Jul 31 15:38:42 1998
Received: from mizar.rz.uni-ulm.de (mizar.rz.uni-ulm.de [134.60.240.5])
	by marvin.jcu.cz (8.8.8/8.8.8) with SMTP id PAA00020
	for <alsa-devel@alsa.jcu.cz>; Fri, 31 Jul 1998 15:37:12 +0200
Received: by mizar.rz.uni-ulm.de with Smail
	id m0z2FMs-001AoIC; Fri, 31 Jul 98 15:37 MET DST
Received: from freewayport17.extern.uni-ulm.de(134.60.7.144), claiming to be "mars.kusche.de"
 via SMTP by mizar.rz.uni-ulm.de, id smtpdBAA0o_Z34; Fri Jul 31 15:37:06 1998
From: Florian Kusche <florian.kusche@student.uni-ulm.de>
To: alsa-devel@alsa.jcu.cz
Subject: kernel oops (?)
Date: Fri, 31 Jul 1998 15:22:23 +0200
Content-Type: Multipart/Mixed;
  boundary="Boundary-=_XrJmOWFrxsjyBldbEFSArCBynEcd"
MIME-Version: 1.0
Message-Id: <98073115344400.00447@mars.kusche.de>
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list


--Boundary-=_XrJmOWFrxsjyBldbEFSArCBynEcd
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hello

I got a kernel oops. (At least I think it is one. I havent seen one befor=
e...)

This test-program opens the soundcard for reading and for writing. When d=
oing
the pcm_read(), the oops occurs. This happens with both 0.1.4 and 0.2.0pr=
e3
drivers.

=09if( snd_pcm_open( &handle, 0, 0, SND_PCM_OPEN_DUPLEX ) !=3D 0 )
=09=09perror( "pcm_open error 1" );
=09
=09memset( &spf, 0, sizeof( struct snd_pcm_format ));
=09spf.format   =3D SND_PCM_SFMT_U16_LE;
=09spf.rate     =3D SAMPLERATE;
=09spf.channels =3D 1;
=09if( snd_pcm_playback_format( handle, &spf ) !=3D 0 )
=09=09perror( "playback format" );

=09memset( &spf, 0, sizeof( struct snd_pcm_format ));
=09spf.format   =3D SND_PCM_SFMT_U16_LE;
=09spf.rate     =3D SAMPLERATE;
=09spf.channels =3D 1;
=09if( snd_pcm_record_format( handle, &spf ) !=3D 0 )
=09=09perror( "record format" );

=09memset( &sprp, 0, sizeof( sprp ));
=09sprp.fragment_size =3D FRAGSIZE;
=09sprp.fragments_min =3D 1;
=09if( snd_pcm_record_params( handle, &sprp ) !=3D 0 )
=09=09perror( "record params" );

=09printf( "POS1\n" );
=09fflush( stdout );
=09
=09c =3D snd_pcm_read( handle, recbuf, FRAGSIZE );
            ^^^^^^^^^^^^
            The oops occurs here.

The full program is included as an attachment.=09

Workaround: Call pcm_record_params BEFORE pcm_record_format
        OR: Use 8 bit sampling

My soundcard is a Creative "Vibra 16C", I'm using Redhat 5.0, 2.0.35

output of the program:

POS1
general protection: 0000
CPU:    0
EIP:    0010:[<0403b498>]
EFLAGS: 00010206
eax: 00000100   ebx: 000000ff   ecx: fffffe80   edx: 0357bcf9
esi: 0357bcf8   edi: 80fcff40   ebp: 00000200   esp: 0357bce0
ds: 0018   es: 0018   fs: 002b   gs: 002b   ss: 0018
Process test1 (pid: 368, process nr: 32, stackpage=3D0357b000)
Stack: 00000280 00fd0000 00000280 08049a74 0357bcf8 80fcff40 0357be80 035=
78000
       0357be3c 0009a218 bffffd55 00000001 00000019 0001fd55 00096a00 039=
da900
       039da900 039da900 0357bd58 0000002b 08049000 00000001 000b624c 000=
00342
Call Trace: [<00125f3a>] [<0015f8d8>] [<0018b91e>] [<00190d60>] [<00190a2=
0>] [<0018cec8>] [<0018cfa2>]
       [<0403cccb>] [<0401c85d>] [<001a8365>] [<0019e525>] [<0019e6b5>] [=
<0019e8c9>] [<0403b5db>] [<0403b5ec>]
       [<0403b93e>] [<00111ced>] [<0403be41>] [<04035d34>] [<04037594>] [=
<0401b0d8>] [<0012393c>] [<0010a8d1>]
Code: 8a 07 88 02 47 89 7c 24 14 42 89 d8 4b 85 c0 75 e7 89 eb 8b
Segmentation fault


lsmod: Please note that some modules use ntfs !?!?!
       (But this perhaps means nothing as some other modules
=09    like isdn also do that)
=09   This is the state after the crash.
=09   Though no program using sound is running, sb16 is still used.

snd-sb16           1=09=091 (autoclean)
snd-sb-dsp         4=09[snd-sb16]=090 (autoclean)
snd-pcm1           4=09[snd-sb-dsp]=091 (autoclean)
snd-mpu401-uart    1=09[snd-sb16]=090 (autoclean)
snd-mixer          3=09[snd-sb16 snd-sb-dsp]=090 (autoclean)
snd-midi           3=09[snd-sb16 snd-sb-dsp snd-mpu401-uart]=090 (autocle=
an)
snd-pcm            2=09[snd-sb16 snd-sb-dsp snd-pcm1]=090 (autoclean)
snd-opl3           1=09[snd-sb16]=090 (autoclean)
snd-synth          1=09[snd-sb16 snd-opl3]=090 (autoclean)
snd-timer          1=09[snd-opl3]=090 (autoclean)
snd                6=09[snd-sb16 snd-sb-dsp snd-pcm1 snd-mpu401-uart snd-=
mixer snd-midi snd-pcm snd-opl3 snd-synth snd-timer]=090 (autoclean)
ntfs               9=09[snd-sb16 snd-sb-dsp snd-pcm1 snd-mixer snd-midi s=
nd-pcm snd]=091 (autoclean)
Module         Pages    Used by


more info. all theese cats have been made after the crash:

cat /proc/sound/*

0 [card1          ]: SB16 - Sound Blaster 16
                     Sound Blaster 16 at 0x220, irq 5, dma 1&5
144: [0]   : control
152: [0- 0]: mixer
168: [0- 0]: digital audio
200: [0- 0]: raw midi
Driver using 18 pages (73728 bytes) of kernel memory for data.
  0: [0- 0]: mixer
  2: [0- 2]: raw midi
  6:       : sndstat
  9: [0- 9]: raw midi
00-00: SB DSP : DSP v4.13
00-00: OPL3 FM
XX-XX: unlimited system timer : 10000.0us (1-10000000)
Advanced Linux Sound Architecture Driver Version 0.2.0-pre3.
Compiled in Jul 28 1998 for kernel 2.0.35.

cat /proc/sound/0/midi0

MPU-401 (UART)

Output
  Tx bytes     : 0
Input
  Rx bytes     : 0

cat /proc/sound/0/mixer0

Mixer 'CTL1745'
Channel 'Master' 0 31 31 31
Channel 'Bass' 0 15 9 9
Channel 'Treble' 0 15 9 9
Channel 'Synth' 0 31 31 31
Channel 'PCM' 0 31 31 31
Channel 'Line-In' 0 31 31 31
Channel 'MIC' 0 31 0 0 lmute rmute rec
Channel 'CD' 0 31 31 31 rec
Channel 'In-Gain' 0 3 3 3
Channel 'Out-Gain' 0 3 3 3
Channel 'PC Speaker' 0 3 0 0

cat /proc/sound/0/pcm0

DSP v4.13

Playback isn't active.
Record
  Mode           : native
  Format         : Unsigned 16-bit Little Endian
  Rate           : 8000Hz [requested 8000Hz]
  Channels       : 1
  Buffer size    : 65536
  Buffer used    : 130560
  Fragments      : 204
  Fragment size  : 640
  Fragments min  : 1
  Overruns       : 5792
  Total overruns : 5792

cat /proc/sound/0/sb16

SB16 DMA usage

Playback DMA  : auto (inactive)
Record DMA    : auto (8-bit)


bye, flo

--Boundary-=_XrJmOWFrxsjyBldbEFSArCBynEcd
Content-Type: text/x-c;
  name="test2.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test2.c"

I2luY2x1ZGUJPGVycm5vLmg+CiNpbmNsdWRlCTxzdGRpby5oPgojaW5jbHVkZQk8ZmNudGwuaD4K
I2luY2x1ZGUJPHN0cmluZy5oPgojaW5jbHVkZQk8c3lzL3NvdW5kbGliLmg+CiNpbmNsdWRlCTxz
dGRsaWIuaD4KCiNkZWZpbmUJCUJVRlNJWkUJCQk0MDAwCiNkZWZpbmUJCVNBTVBMRVJBVEUJCTgw
MDAKI2RlZmluZQkJRlJBR1NJWkUJCTY0MAoKc3RhdGljIGNoYXIgcmVjYnVmW0JVRlNJWkVdOwoK
aW50IG1haW4oKQp7Cgl2b2lkICpoYW5kbGU7CglzdHJ1Y3Qgc25kX3BjbV9mb3JtYXQgc3BmOwoJ
c3RydWN0IHNuZF9wY21fcmVjb3JkX3BhcmFtcyBzcHJwOwoJaW50IGM7CgkKCWlmKCBzbmRfcGNt
X29wZW4oICZoYW5kbGUsIDAsIDAsIFNORF9QQ01fT1BFTl9EVVBMRVggKSAhPSAwICkKCQlwZXJy
b3IoICJwY21fb3BlbiBlcnJ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