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]

mind that I'm using alsa 0.9.8


this "sounds" quite confusing to me, any idea? (i.e. why it usually
works but not for me?)

Peach



-------------------------------------------------------
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

Reply via email to