From alsa-devel-owner@alsa.jcu.cz  Tue Mar 17 14:41:20 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 OAA00358
	for <alsa-devel@jcu.cz>; Tue, 17 Mar 1998 14:41:19 +0100
Date: Tue, 17 Mar 1998 14:41:19 +0100 (MET)
From: Jaroslav Kysela <perex@jcu.cz>
To: alsa-devel@jcu.cz
Subject: Re: alsalib 0.0.6 src/mixer/mixer.c
In-Reply-To: <19980317142906.40415@flora>
Message-ID: <Pine.LNX.3.96.980317144004.16401F-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 Tue, 17 Mar 1998, Marcus Brinkmann wrote:

> 
> Hello!
> 
> This is what I found in alsalib/src/mixer/mixer.c
> 
> int snd_mixer_channel_read( void *handle, int channel, snd_mixer_channel_t *data )
> {
>   snd_mixer_t *mixer;
> 
>   mixer = (snd_mixer_t *)handle;
>   if ( !mixer ) return -EINVAL;
>   data -> channel = channel;
>   if ( ioctl( mixer -> fd, SND_MIXER_IOCTL_CHANNEL_READ, channel ) < 0 )
>     return -errno;
>   return 0;
> }
> 
> And in channel_write, too:
> 
>   if ( ioctl( mixer -> fd, SND_MIXER_IOCTL_CHANNEL_WRITE, channel ) < 0 )
>     return -errno;
> 
> But in Mixer/Mixer.cpp:
> void Mixer::DeviceWrite(int32 device, int32 left, int32 right, int32 flags)
> {
>         ch_data.channel = device;
>         ch_data.left = left;
>         ch_data.right = right;
>         ch_data.flags = flags;
>         ioctl(mixer_fd, SND_MIXER_IOCTL_CHANNEL_WRITE, &ch_data);
> }
> 
> I think the both calls in the alsalib should be:
> ioctl( mixer -> fd, SND_MIXER_IOCTL_CHANNEL_READ, data)

Yes, it's bug... Fixed.. Thank you...

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


