mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gordon Sadler <gbsadler1@lcisp.com>
To: linux-kernel@vger.kernel.org
Date: Wed, 16 May 2001 16:23:12 -0500	[thread overview]
Message-ID: <20010516162312.A19485@debian-home.lcisp.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

Please CC replies as I'm not subscribed.
I seem to be having some problems with sound ioctl's.

I've attached a short c file that opens /dev/dsp, prints the fd, tries
to issue SNDCTL_DSP_NONBLOCK ioctl, then does the same with /dev/audio.

Both calls to ioctl for NONBLOCK yield Invalid Invalid argument.
I've searched the kernel source under drivers/sound/ to see if/where
this ioctl is defined. 

grep -rl SNDCTL_DSP_NONBLOCK drivers/sound/*
drivers/sound/audio.c
drivers/sound/cmpci.c
drivers/sound/cs4281/cs4281m.c
drivers/sound/cs46xx.c
drivers/sound/emu10k1/audio.c
drivers/sound/es1370.c
drivers/sound/es1371.c
drivers/sound/esssolo1.c
drivers/sound/i810_audio.c
drivers/sound/maestro.c
drivers/sound/maestro3.c
drivers/sound/msnd_pinnacle.c
drivers/sound/sonicvibes.c
drivers/sound/trident.c
drivers/sound/vwsnd.c
drivers/sound/ymfpci.c

Now I'm using a via chipset embedded sound.
lsmod
via82cxxx_audio        16496   0 (autoclean)
soundcore               3472   2 (autoclean) [via82cxxx_audio]
ac97_codec              8352   0 (autoclean) [via82cxxx_audio]

So none of the files that use SNDCTL_DSP_NONBLOCK were compiled for my
kernel. I came up with a question and 2 possible solutions.

Question:
  Are all ioctl's valid for all devices within a major block?

Solutions:
 1.  Turn on CONFIG_SOUND_OSS so sound.o is produced, however the
 Configure.help says, "...Say Y or M here (the module will be called
 sound.o) if you haven't found a driver for your sound card above, then
 pick your driver from the list below.
       
 2.  Determine a way to tell which ioctl's a particular driver supports.

Any ideas here?

-- 
Gordon Sadler


[-- Attachment #2: test.c --]
[-- Type: text/x-csrc, Size: 659 bytes --]

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdio.h>
#include <linux/soundcard.h>



int main()
{
  int fd, fd1, ver;
  if((fd=open("/dev/dsp",O_WRONLY))<0)
	  perror("open ");
  printf (" %d is fd...\n",fd);
  if (ioctl(fd, OSS_GETVERSION, &ver)<0)
	  perror("ioctl ");
  printf (" %x is version...\n",ver);
  if (ioctl(fd, SNDCTL_DSP_NONBLOCK, NULL)<0)
	  perror("ioctl ");
  close(fd);
  
  if((fd1=open("/dev/audio",O_WRONLY))<0)
	  perror("open ");
  printf (" %d is fd1...\n",fd);
  if (ioctl(fd1, SNDCTL_DSP_NONBLOCK, NULL)<0)
	  perror("ioctl ");
  close(fd1);
  return 0;
}
  

                 reply	other threads:[~2001-05-16 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010516162312.A19485@debian-home.lcisp.com \
    --to=gbsadler1@lcisp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®