From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: How to detect whether OSS mixer is emulated by ALSA Date: Wed, 09 Apr 2003 11:19:34 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <200304082022.25993.c.esken@cityweb.de> Mime-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Paul Davis Cc: Christian Esken , "alsa-devel@lists.sourceforge.net" List-Id: alsa-devel@alsa-project.org At Tue, 08 Apr 2003 16:27:43 -0400, Paul Davis wrote: > > >Well, how should this help?!? It reports this value for any device, whether > >showing up duplicated or not. It doesn't help mapping ALSA mixers to > >ALSA_OSS-Mixers, does it? > > > >For explaining things better I'll show the log of scanning 4 (sound)cards on 2 > > although i am somewhat sympathetic to what you are trying to do, and i > agree that there should be a way to do it more easily than now, i > think that your goal is misplaced. > > you need to pick an audio API, and write a mixer app that uses > it. ALSA's provision of OSS back-compatibility is not there to be used > by programs that use the native ALSA API. either use OSS, or ALSA, and > don't try both. yep, the easiest way would be to detect the alsa mixers at first then run kmix as alsa-native mode if any found. if no alsa mixer is found, try to probe oss mixers and run in oss mode as fallback. even if you want to mix up the both modes, the same rule is applied - probe ALSA first then OSS. the ALSA OSS-emulation maps the devices based on the card. that is, the ALSA card #0 uses only /dev/mixer0 and /dev/amixer0 (for pcm, only /dev/pcm0 and /dev/apcm0). hence, you can check the alsa cards at first, then skip the corresponding oss devices. but this won't work well if ALSA OSS-emulation is DISABLED and both ALSA and OSS systems are running at the same time (yeah it's possible), although this must be a veeery rare case. ciao, Takashi ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf