From alsa-devel-owner@alsa.jcu.cz  Mon Oct 19 12:29:10 1998
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id MAA16236;
	Mon, 19 Oct 1998 12:27:17 +0200
Date: Mon, 19 Oct 1998 12:27:16 +0200 (CEST)
From: Jaroslav Kysela <perex@jcu.cz>
To: Andy Lo A Foe <arloafoe@cs.vu.nl>
cc: alsa-devel@jcu.cz
Subject: Re: setting playback_format after OSS usage
In-Reply-To: <Pine.LNX.3.96.981019020053.10707A-100000@orbital>
Message-ID: <Pine.LNX.3.96.981019115200.3751M-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 Mon, 19 Oct 1998, Andy Lo A Foe wrote:

> Hi,
> 
> After using the OSS emulation (/dev/audio) with speak freely trying to
> initialize the PCM device with other values (via asoundlib) fails.
> When initing AlsaPlayer I do:
> 
> -------
> snd_pcm_format_t pf;
> 
> pf.format = SND_PCM_SFMT_S16_LE;
> pf.rate = 44100;
> pf.channels = 2;
> memset(pf.reserved, 0, sizeof(pf.reserved));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Wrong, reserved member maybe shorted in future (if some variables will be
added to structure). Use bzero rather to clean whole structure before
initialization...

> if ((err = snd_pcm_playback_format(handle, &pf)) < 0) {
> 	printf"error..etc\n");
> 	exit(1);
> }
> ---------
> 
> catting /proc/asound/card1/pcm0 tells me the device is at 44100Hz
> but the actual playback rate is still 8000Hz (or the rate
> which speak freely uses). Setting the rate via OSS ioctl call
> does work though (e.g. OSS mikmod at 44Khz puts it correctly at 44Khz)..
> 
> Bug?

Maybe in lowlevel driver (S3 SonicVibes?).. I didn't see anything wrong in
middle level code. Can you try repeat setup if it helps?

							Jaroslav

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


