Hi,
On Sun, Oct 26, 2003 at 01:14:44PM -0800, [EMAIL PROTECTED] wrote:
> Message: 3
> Subject: Re: [Alsa-user] Re: Um, can't do GETOSPACE?
> From: The Peach <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Organization: Hampcake Studios
> Date: Sun, 26 Oct 2003 12:06:09 +0100
>
> On Sun, 2003-10-26 at 09:45, Andreas Mohr wrote:
> > That refers to the SNDCTL_DSP_GETOSPACE ioctl (OSS emulation).
> >
> > Try running quake with strace -f to find out what gets returned when
> > it does that ioctl, then find out why the ALSA OSS layer handles it that
> > way (in alsa-driver/acore/oss/pcm_oss.c).
> >
> > Andreas Mohr
> >
>
> thanks Andreas for your reply.
>
> What I discovered from strace -f call is this (most significant part):
>
> [code]
> 2325 write(2, "\n------- sound initialization --"..., 38) = 38
> 2325 setresuid32(0xffffffff, 0x3e8, 0xffffffff) = 0
> 2325 open("/dev/dsp", O_RDWR) = 82
> 2325 getuid32() = 1000
> 2325 setresuid32(0xffffffff, 0x3e8, 0xffffffff) = 0
> 2325 ioctl(82, SNDCTL_DSP_GETCAPS, 0xbffff594) = 0
> 2325 ioctl(82, SOUND_PCM_READ_RATE, 0x81776ac) = 0
> 2325 ioctl(82, SNDCTL_DSP_STEREO, 0xbffff58c) = 0
> 2325 ioctl(82, SOUND_PCM_READ_RATE, 0x88446b4) = 0
> 2325 ioctl(82, SNDCTL_DSP_SETFMT, 0xbffff588) = 0
> 2325 ioctl(82, SNDCTL_DSP_GETOSPACE, 0xbffff5a0) = -1 EINVAL (Invalid
> argument)
> 2325 write(2, "GETOSPACE: Invalid argument\n", 28) = 28
> 2325 write(2, "Um, can\'t do GETOSPACE?\n", 24) = 24
> 2325 close(82) = 0
> [/code]
>
>
> and in pcm_oss.c (found in alsa-driver/alsa-kernel/core/oss/) the only
> reference to GETOSPACE is this:
>
> [code from line 1948 to 1958]
> case SNDCTL_DSP_GETFMTS:
> res = snd_pcm_oss_get_formats(pcm_oss_file);
> if (res < 0)
> return res;
> return put_user(res, (int *)arg) ? -EFAULT : 0;
> case SNDCTL_DSP_GETOSPACE:
> case SNDCTL_DSP_GETISPACE:
> return snd_pcm_oss_get_space(pcm_oss_file,
> cmd == SNDCTL_DSP_GETISPACE ?
> SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK,
> (struct audio_buf_info *) arg);
> [/code]
>
> seems to me that there're no instructions in that switch case
> infact the return code is:
>
> [code from line 2006 to 2008]
> }
> return -EINVAL;
> }
> [/code]
Umm, now you're talking trash :-)
SNDCTL_DSP_GETOSPACE is empty becaused it's supposed to *fall through*
to SNDCTL_DSP_GETISPACE (both ioctls are handled the same way).
Then snd_pcm_oss_get_space() with SNDRV_PCM_STREAM_CAPTURE or
SNDRV_PCM_STREAM_PLAYBACK, depending on the ioctl cmd.
Finally, the return code is NOT in line 2006, since snd_pcm_oss_get_space()
itself returns already.
--> Try to find out where exactly within snd_pcm_oss_get_space()
the -EINVAL return value comes from...
(e.g. add tons of snd_printk() until you know what happens...)
Oh, and make sure to verify that this code part actually gets called by
Quake...
Good luck!
--
Open Source Software: because smart people know to prefer a multitude of
Support Options to a Single Point of Failure commonly used software represents.
(who's left to sue given your average all-denying End User License Agreements,
or who to ask for support if a vendor or product decided to silently die away?)
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user