From alsa-devel-owner@alsa.jcu.cz  Thu May  7 21:10:50 1998
Received: from entry.jcu.cz (perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.8.8/8.8.8) with SMTP id VAA07162;
	Thu, 7 May 1998 21:10:39 +0200
Date: Thu, 7 May 1998 21:10:39 +0200 (MET DST)
From: Jaroslav Kysela <perex@jcu.cz>
To: Gerd Knorr <kraxel@goldbach.isdn.cs.tu-berlin.de>
cc: Rober Taurok <robert@fet.htu.tuwien.ac.at>, alsa-user@alsa.jcu.cz,
        alsa-devel@alsa.jcu.cz
Subject: Re: Problem with SB16
In-Reply-To: <Pine.LNX.3.96.980507134104.1017B-100000@bogomips.isdn.cs.tu-berlin.de>
Message-ID: <Pine.LNX.3.96.980507210955.29712C-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Thu, 7 May 1998, Gerd Knorr wrote:

> On Thu, 7 May 1998, Jaroslav Kysela wrote:
> 
> > > > > sound record (afmt=128, ch=1, rate=22050, bs=8192, lat=185) 
> > > > > oops(open): unsupported sound format
> 
> > > It didn't even work with the old kernel, but ther was no error message
> > > like this.
> 
> > OK. This bug isn't on my (ALSA driver) side. Looks like krecord have
> > uninitialized for Soundcard -> afmt variable.
> 
> No.  afmt gets initialized with this piece of code:
> 
>     afmt = 0;
>     if (-1 != (dsp = open(devname, O_RDONLY))) {
>         ioctl(dsp, SNDCTL_DSP_SETFMT,  &afmt);     /* current */
> 
> According to the OSS specs this is supported to return the current
> format (0 == AFMT_QUERY).  Becauce the default format for /dev/dsp
> is 8 bit PCM, afmt should have AFMT_U8 after that ioctl.

Oops. My fault. Thank you for correction. For unknown reason I initialized
16-bit /dev/dsp with U16_LE (correct format is S16_LE).

Default format (U8 or S16_LE) depends on minor number which is assigned to
/dev/dsp (minor % 16 = 3 -> 8-bit unsigned, minor % 16 = 5 -> 16-bit
signed little endian).

>   Gerd

                                Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


