Skip to contentSkip to conversation

how to write a mixer using alsa lib api ?

DISCUSSION Xiaolong Guo 4 participants 4 messages Oct 20, 2003 – Nov 24, 2003

lore
Share & tools
lore
#0 lore raw

dear all,
I want to write a mixer using alsa lib api. Now I am
reading the example program alsamixer.c and amixer.c, and I want to know where I find some documnent to know how to use these alsa lib api,namely,I want a specification of these api,thanks a lots .

best wishes
Marco Guo

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo The Event For Linux Datacenter Solutions & Strategies in The Enterprise Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com

#1 lore raw
Quoted 3 lines

and I want to know where I find some documnent to know how to use these alsa lib api,namely,I want a specification of these api,thanks a lots .

http://www.alsa-project.org/alsa-doc/alsa-lib/

Tommi

-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations Here's your chance to show off your extensive product knowledge We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54

#2 lore raw
Quoted 5 lines · Tommi Sakari Uimonen
Quoted 3 lines

and I want to know where I find some documnent to know how to use these alsa lib api,namely,I want a specification of these api,thanks a lots .

http://www.alsa-project.org/alsa-doc/alsa-lib/

Nice hint. But your comment is barely nothing more than a RTFM. If the mixer documentation would be usable this would be OK. But actually the documentation is lacking a lot, especially with the mixer interface. Need an example:

int snd_mixer_poll_descriptors()
Documnetation says: "get poll descriptors"

Cool: "get poll descriptors". I wanted to do this my whole life. :) Whatever these "poll descriptors" do, I do not know. But it is important, or is it not?!? :-(

More questions: Why are there multiple API's: Should I use the "normal" or the "simple" API (BTW:The simple mixer interface from mixer/simple.c is not on the Web).

Need more examples:
snd_mixer_set_callback()
What good is this function for? A callback for what? And is this optional, just to avoid polling or and explicite update or what?

snd_mixer_elem_attach()
Documentation say: "Attach an HCTL to an opened mixer."
Whatever an HCTL might be, I don't know. Why I should do it, I do not know as well. The snd_mixer_attach() documentation does not tell me. It also does not tell me what is an in- or out-parameter and if I have to allocate the memory for the data (if there are any) of the out-parameter myself.

snd_mixer_elem_type_t snd_mixer_elem_get_type ( const snd_mixer_elem_t * obj ) Documentation does not tell me what types exist: snd_mixer_elem_type_t is not hyperlinked and neither be found under "Data Structures" nor under "Data Fields"

Sorry if my posting sounds rude, but I am fighting since months with the mixer API and the frustration is growing: I am not even able to read the correct playback volume if another application changes it. I went to reading the alsa-lib source, because alsamixer is not a really good example (it also has no documentation).

Sorry again, but with ALSA1.0 approaching, the documentation clearly needs an
upgrade: The Mixer is not even contained in the "Module Index" of the mentioned web page.
Telling application developers that want to push ALSA to RTFM is not the right way IMHO.

Greetings,
Chris

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#3 lore raw

At Mon, 24 Nov 2003 00:01:53 +0100,

Quoted 47 lines · Christian Esken
Quoted 5 lines · Tommi Sakari Uimonen
Quoted 3 lines

and I want to know where I find some documnent to know how to use these alsa lib api,namely,I want a specification of these api,thanks a lots .

http://www.alsa-project.org/alsa-doc/alsa-lib/

Nice hint. But your comment is barely nothing more than a RTFM. If the mixer documentation would be usable this would be OK. But actually the documentation is lacking a lot, especially with the mixer interface. Need an example:

int snd_mixer_poll_descriptors()
Documnetation says: "get poll descriptors"

Cool: "get poll descriptors". I wanted to do this my whole life. :) Whatever these "poll descriptors" do, I do not know. But it is important, or is it not?!? :-(

More questions: Why are there multiple API's: Should I use the "normal" or the "simple" API (BTW:The simple mixer interface from mixer/simple.c is not on the Web).

Need more examples:
snd_mixer_set_callback()
What good is this function for? A callback for what? And is this optional, just to avoid polling or and explicite update or what?

snd_mixer_elem_attach()
Documentation say: "Attach an HCTL to an opened mixer."
Whatever an HCTL might be, I don't know. Why I should do it, I do not know as well. The snd_mixer_attach() documentation does not tell me. It also does not tell me what is an in- or out-parameter and if I have to allocate the memory for the data (if there are any) of the out-parameter myself.

snd_mixer_elem_type_t snd_mixer_elem_get_type ( const snd_mixer_elem_t * obj ) Documentation does not tell me what types exist: snd_mixer_elem_type_t is not hyperlinked and neither be found under "Data Structures" nor under "Data Fields"

Sorry if my posting sounds rude, but I am fighting since months with the mixer API and the frustration is growing: I am not even able to read the correct playback volume if another application changes it. I went to reading the alsa-lib source, because alsamixer is not a really good example (it also has no documentation).

Quoted 5 lines

Sorry again, but with ALSA1.0 approaching, the documentation clearly needs an
upgrade: The Mixer is not even contained in the "Module Index" of the mentioned web page.
Telling application developers that want to push ALSA to RTFM is not the right way IMHO.

about the mixer application, it'd better to wait for a while.

in parallel with the release of ALSA 1.0, Jaroslav is working on the higher abstraction layer for mixer. this will be definitely easier to use for normal cases rather than the still complex abstraction as it is.

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/