How to detect whether OSS mixer is emulated by ALSA
Hi,
my mixer (kmix) supports OSS and ALSA at the same time. This is good for a mixed-mode environment (e.g. if there is a TV card w/o ALSA support).
Unfortunately this means that kmix finds some mixers twice.
- One time the real thing (ALSA)
- One time the OSS-emulation
This will confuse users.
Is there any way to find out those OSS mixers which are just emulated? I browsed http://www.alsa-project.org/~iwai/OSS-Emulation.html and other documentation but found nothing . I also tried to build the docs below alsa-doc/lib, but failed (Yes, I have openjade installed).
Chris
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Quoted 5 lines
Hi,
my mixer (kmix) supports OSS and ALSA at the same time. This is good for a mixed-mode environment (e.g. if there is a TV card w/o ALSA support).
Quoted 7 lines
Unfortunately this means that kmix finds some mixers twice.
- One time the real thing (ALSA)
- One time the OSS-emulationThis will confuse users.
Is there any way to find out those OSS mixers which are just emulated?
check for the existence of /proc/asound and the absence of /proc/sndstat. if the first is there and the second is not, then any OSS mixers are emulated.
--p
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Quoted 9 lines · Christian Esken
Hi,
my mixer (kmix) supports OSS and ALSA at the same time. This is good for a mixed-mode environment (e.g. if there is a TV card w/o ALSA support).
Unfortunately this means that kmix finds some mixers twice.
- One time the real thing (ALSA)
- One time the OSS-emulation
Quoted 6 lines
This will confuse users.
Is there any way to find out those OSS mixers which are just emulated? I browsed http://www.alsa-project.org/~iwai/OSS-Emulation.html and other documentation but found nothing . I also tried to build the docs below alsa-doc/lib, but failed (Yes, I have openjade installed).
ALSA emulation layer always report the version of OSS mixer (OSS_GETVERSION) as:
#define SNDRV_OSS_VERSION ((3<<16)|(8<<8)|(1<<4)|(0)) /* 3.8.1a */
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Am Sunday 06 April 2003 14:05 schrieb Jaroslav Kysela:
Quoted 17 lines · Christian Esken
Quoted 9 lines
Hi,
my mixer (kmix) supports OSS and ALSA at the same time. This is good for a mixed-mode environment (e.g. if there is a TV card w/o ALSA support).
Unfortunately this means that kmix finds some mixers twice.
- One time the real thing (ALSA)
- One time the OSS-emulationQuoted 6 lines
This will confuse users.
Is there any way to find out those OSS mixers which are just emulated? I browsed http://www.alsa-project.org/~iwai/OSS-Emulation.html and other documentation but found nothing . I also tried to build the docs below alsa-doc/lib, but failed (Yes, I have openjade installed).
Quoted 5 lines
ALSA emulation layer always report the version of OSS mixer (
OSS_GETVERSION) as:#define
SNDRV_OSS_VERSION((3<<16)|(8<<8)|(1<<4)|(0)) /*
3.8.1a */
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 drivers. Driver 0 (drv=0) is ALSA, Driver 1 (drv=1) is OSS:
chris@debut:~/CVS/kdemultimedia/kmix> kmix
kmix: drv=0 kmix: dev=0 kmix: card=0 kmix: Added one mixer: Sound Fusion CS46xx kmix: card=1 kmix: card=2 kmix: card=3 kmix: dev=1 kmix: card=0 kmix: card=1 kmix: card=2 kmix: card=3 kmix: dev=2 kmix: card=0 kmix: card=1 kmix: card=2 kmix: card=3 kmix: drv=1 kmix: dev=0 kmix: card=0 Version is: 198672 kmix: Added one mixer: Cirrus Logic CS4294 rev 5,Cirru kmix: card=1 kmix: card=2 kmix: card=3 kmix: dev=1 kmix: card=0 Version is: 198672 kmix: Added one mixer: Avance Logic ALC650 rev 0 kmix: card=1 kmix: card=2 kmix: card=3 kmix: dev=2 kmix: card=0 kmix: card=1 kmix: card=2 kmix: card=3 kmix: Mixers found: 3, multi-driver-mode: true
So I find
1) "Sound Fusion CS46xx" (ALSA) and
2) "Cirrus Logic CS4294 rev 5,Cirru" (OSS-ALSA)
3) "Avance Logic ALC650 rev 0" (OSS-ALSA)
Both 2) and 3) have version "198672", but I only need to discard 2) as this is a duplicate of 1). How should I do this?!?
Chris
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Quoted 5 lines
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.
that's just my US$0.02, worth ever less with every bomb this country drops on iraq.
--p
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
At Tue, 08 Apr 2003 16:27:43 -0400,
Quoted 7 lines · Paul Davis
Quoted 6 lines
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
Quoted 8 lines
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
Am Wednesday 09 April 2003 11:19 schrieben Sie:
Quoted 18 lines
At Tue, 08 Apr 2003 16:27:43 -0400,
Quoted 15 lines · Paul Davis
Quoted 6 lines
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.
That's the theoretical approach - and I agree with you that this is the best way.
Quoted 3 lines
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.
That's how kmix is working since some months (years?).
OK, thanks for all your feedback. So now I know I have not missed a trivial soulution. I'll start to think up a workaround.
Bye,
Christian
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com