Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Wurmsdobler <peter@wurmsdobler.org>
To: alsa-devel@alsa-project.org
Subject: ioctl request code for specific alsa control
Date: Tue, 13 May 2008 19:31:12 +0100	[thread overview]
Message-ID: <4829DE70.7050103@wurmsdobler.org> (raw)

Hello,

The driver for our audio hardware provides 6 snd_kcontrol_new_t 
structures, with their proper callbacks, members and name. One is called 
pmic_control_pb_vol (.name = "Master Playback Volume") in the driver, 
but appears somehow as "Master" in amixer and can be successfully 
written to using the OSS interface and ioctl as:

     int mixerFd = open("/dev/mixer", O_RDWR);
     if (mixerFd >= 0) {
         unsigned int leftright;
         ioctl(mixerFd, SOUND_MIXER_WRITE_VOLUME, &leftright);
         close(mixerFd);
     }

It is a big enigma for me that the ioctl with the request code used 
above arrives automagically in the particular audio driver and calls 
pmic_pb_volume_put() defined in pmic_control_pb_vol.

Another control is called pmic_control_op_sw (.name = "Master Output 
Playback Volume") and appears in amixer as "Master Output" (in fact it 
is not a volume control but a switch). It is possible to set the output 
device using amixer. My questions are:

What is the ioctl request code for a particular snd_kcontrol_new_t 
defined in the driver?

Alternatively, how does the OSS layer in ALSA map the different ALSA 
controls to the predefined and fixed OSS controls?

The hard way (and what I am currently trying as last resort) is to write 
to all of them and see what happens.

Many thanks for your help,
peter

             reply	other threads:[~2008-05-13 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-13 18:31 Peter Wurmsdobler [this message]
2008-05-14  9:17 ` ioctl request code for specific alsa control Clemens Ladisch
     [not found]   ` <482AB7A1.6090303@wurmsdobler.org>
2008-05-15  7:28     ` Clemens Ladisch
2008-05-16  9:16       ` Peter Wurmsdobler

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=4829DE70.7050103@wurmsdobler.org \
    --to=peter@wurmsdobler.org \
    --cc=alsa-devel@alsa-project.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