From alsa-devel-owner@alsa.jcu.cz  Sun Nov  1 15:07:48 1998
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id PAA29433;
	Sun, 1 Nov 1998 15:06:51 +0100
Date: Sun, 1 Nov 1998 15:06:51 +0100 (CET)
From: Jaroslav Kysela <perex@jcu.cz>
To: Carl van Schaik <carl@dreamcoat.che.uct.ac.za>
cc: alsa-devel@alsa.jcu.cz
Subject: Re: Question about mixer support
In-Reply-To: <363C2255.8C163930@leg.uct.ac.za>
Message-ID: <Pine.LNX.3.96.981101145113.12661B-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 Sun, 1 Nov 1998, Carl van Schaik wrote:

> Hi
> 
> I was wondering whether the ALSA drivers have support for advanced mixer
> settings which don't seem to be possible from OSS.
> 
> Things I am tlaking about are:
> Support to choose from which channel to record,
> ie
> 
> Record Left           Record Right
> 
> left  right            left right
> [x]   [x]               [x]  [x]  -> CD
> 
> left  right            left right
> [x]   [x]               [x]  [x]  -> Line-In
> 
> etc

OK. I made these changes to ALSA mixer API:

#define SND_MIXER_CINFO_CAP_RECORD	0x00000001
#define SND_MIXER_CINFO_CAP_STEREO	0x00000002
#define SND_MIXER_CINFO_CAP_MUTE	0x00000004	/* always set at this moment, driver emulates mute */
#define SND_MIXER_CINFO_CAP_HWMUTE	0x00000008	/* channel supports hardware mute */
#define SND_MIXER_CINFO_CAP_DIGITAL	0x00000010	/* channel does digital (not analog) mixing */
#define SND_MIXER_CINFO_CAP_INPUT	0x00000020	/* external input channel */
#define SND_MIXER_CINFO_CAP_JOINMUTE	0x00000040	/* join mute is supported only (left and right channel doesn't have separate mute control) */
#define SND_MIXER_CINFO_CAP_JOINRECORD	0x00000080	/* join record is supported only (left and right channel doesn't have separate record control) */
#define SND_MIXER_CINFO_CAP_LTOR	0x00000100	/* route left input to right output is supported */
#define SND_MIXER_CINFO_CAP_RTOL	0x00000200	/* route right input to left output is supported */
#define SND_MIXER_CINFO_CAP_RECORDBYMUTE 0x00000400	/* we can record data even if output path is muted (to avoid loopback) */

#define SND_MIXER_FLG_RECORD_LEFT	0x00000001	/* channel record source - left input */
#define SND_MIXER_FLG_RECORD_RIGHT	0x00000002	/* channel record source - right input */
#define SND_MIXER_FLG_RECORD		0x00000003	/* channel record source both inputs */
#define SND_MIXER_FLG_MUTE_LEFT		0x00010000
#define SND_MIXER_FLG_MUTE_RIGHT	0x00020000
#define SND_MIXER_FLG_MUTE		0x00030000
#define SND_MIXER_FLG_LTOR		0x00100000	/* route left input to right output */
#define SND_MIXER_FLG_RTOL		0x00200000	/* route right input to left output */
#define SND_MIXER_FLG_DECIBEL		0x40000000	/* if this bit is set, driver sets volume from dB variables (left_dB, right_dB) */
#define SND_MIXER_FLG_FORCE		0x80000000	/* force set - don't use in user space - reserved for kernel */

I added to capabilities list these flags:

MONOMUTE was renamed to JOINMUTE which better describes this flag (my
sorry goes to developers, but this is why version 0.2.0 have still
pre postfix ;-))).. JOINRECORD, LTOR, RTOL and RECORDBYMUTE was added.

To channel flags list were added these flags:

RECORD_LEFT, RECORD_RIGHT, LTOR and RTOL..

Unfortunately converting record source from mono to stereo will cause that
binaries which use record source setup with previous ALSA API will be
malfunctioning now (only left channel will be controlled if hardware
supports separate record source selection), thus all mixer application
should be recompiled for correct function. No changes in sources aren't
needed.

If someone have other ideas - mail me now.. I'm closing 0.2.0pre
versions of driver..

> Also things like to choose your outputs,
> ie output Line-IN (left channel) and CD-Left channel etc

Look to above API, I hope that is enough...

> And support to have different Record and Playback volumes for each
> channel like win95.

This isn't possible with hardware.. You probably mean "mixer profiles"...
This is application thing how will be volume handling done.. Driver
shouldn't handle two volumes (one for playback and second for record)..
I didn't see to this time any hardware which have separate volume levels
for each outputs and inputs (in most mixers is only some sort of record
gain).

							Jaroslav

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


