* Alsa Mixer api documentation.
@ 2005-07-24 23:46 Chuckles
2005-07-25 1:20 ` Lee Revell
0 siblings, 1 reply; 6+ messages in thread
From: Chuckles @ 2005-07-24 23:46 UTC (permalink / raw)
To: alsa-devel
Hello,
I am trying to find a clear example, tutorial or guide to the
alsa mixer api. The documentation generated in the doxygen
subdirectory of the doc subdirectory of the alsa-lib package is not
very clear. The index page of the library api documentation does
contain a link to some mixer info:
API Links
........
Page Mixer interface explains the mixer controls API.
........
But that link contains:
Mixer interface
Mixer interface is designed to access the abstracted
mixer controls. This is an abstraction layer over the
hcontrol layer.
General overview
And that's it, there is nothing under the heading General Overview. I
have found some of the method prototypes are documented but they are a
bit ambiguous in regards to the actual functions they perform.
(snd_mixer_first_elem) Michal Kochanowicz previously sent an email
about this with subject
'Mixer programming - is there any documentation available?'
So...is there? If anyone can even give me a simple "open mixer, set
pcm to 50%, close mixer" example that'd be great.
Thanks for any and all help,
Cathal
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id\x16492&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Alsa Mixer api documentation.
2005-07-24 23:46 Alsa Mixer api documentation Chuckles
@ 2005-07-25 1:20 ` Lee Revell
2005-07-25 11:33 ` Chuckles
0 siblings, 1 reply; 6+ messages in thread
From: Lee Revell @ 2005-07-25 1:20 UTC (permalink / raw)
To: Chuckles; +Cc: alsa-devel
On Mon, 2005-07-25 at 01:46 +0200, Chuckles wrote:
> So...is there? If anyone can even give me a simple "open mixer, set
> pcm to 50%, close mixer" example that'd be great.
Why don't you look at the source to xmms or mplayer?
Lee
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Alsa Mixer api documentation.
2005-07-25 1:20 ` Lee Revell
@ 2005-07-25 11:33 ` Chuckles
2005-07-25 13:11 ` Jaroslav Kysela
0 siblings, 1 reply; 6+ messages in thread
From: Chuckles @ 2005-07-25 11:33 UTC (permalink / raw)
To: Lee Revell; +Cc: alsa-devel
So that's a no then. I had been looking at the source for amixer.c but
what can I tell ya? Pouring over 1500 lines of uncommented, (mostly)
static methods written in C is hardly the best way to learn an api now
is it? (Do linux developers hate c++/oo programming or do they just
willfully ignore it?) Apart from the opening few lines about the gnu
gpl there are 3 (count 'em) 3, one line comments in a source file of
over 1500 lines. But if the alsa developers can't be bothered to write
the docs I suppose I don't have much choice.
Cathal
On 7/25/05, Lee Revell <rlrevell@joe-job.com> wrote:
> On Mon, 2005-07-25 at 01:46 +0200, Chuckles wrote:
> > So...is there? If anyone can even give me a simple "open mixer, set
> > pcm to 50%, close mixer" example that'd be great.
>
> Why don't you look at the source to xmms or mplayer?
>
> Lee
>
>
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id\x16492&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Re: Alsa Mixer api documentation.
2005-07-25 11:33 ` Chuckles
@ 2005-07-25 13:11 ` Jaroslav Kysela
2005-07-25 14:20 ` Alsa Mixer api documentation. (Damn u C programmers!) Chuckles
0 siblings, 1 reply; 6+ messages in thread
From: Jaroslav Kysela @ 2005-07-25 13:11 UTC (permalink / raw)
To: Chuckles; +Cc: alsa-devel
On Mon, 25 Jul 2005, Chuckles wrote:
> So that's a no then. I had been looking at the source for amixer.c but
> what can I tell ya? Pouring over 1500 lines of uncommented, (mostly)
> static methods written in C is hardly the best way to learn an api now
> is it? (Do linux developers hate c++/oo programming or do they just
> willfully ignore it?) Apart from the opening few lines about the gnu
> gpl there are 3 (count 'em) 3, one line comments in a source file of
> over 1500 lines. But if the alsa developers can't be bothered to write
> the docs I suppose I don't have much choice.
The amixer code cannot be easier, but I agree that C++ programmer will
have trouble with it, because functions contains more than 10 lines ;-)
Write some docs in doxygen, we'll include it to our repository.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Alsa Mixer api documentation. (Damn u C programmers!)
2005-07-25 13:11 ` Jaroslav Kysela
@ 2005-07-25 14:20 ` Chuckles
2005-07-26 13:12 ` Jaroslav Kysela
0 siblings, 1 reply; 6+ messages in thread
From: Chuckles @ 2005-07-25 14:20 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: alsa-devel
> The amixer code cannot be easier, but I agree that C++ programmer will
> have trouble with it, because functions contains more than 10 lines ;-)
I can see my eternal damnation now, an eternity sorting through
uncommented C programs in hell's ironic punishment department. :op
> Write some docs in doxygen, we'll include it to our repository.
>
> Jaroslav
No probs. I'd be more than willing to write some docs for the mixer
api, if I could work out how to use it. So can you answer some
questions about it? I'm confused as to why its necessary to use
elements, simple elements and a high level control interface to set
sound levels on the mixer. I have done some mixer programming with
OSS, but this is very different. I see the snd_mixer_open function
opens an empty mixer, fine, does this imply that a software mixer has
to be built from the ground up? As in you add a pcm element, a master
element, a cd element depending on what is available on your
particular sound card to this empty mixer?
Cathal
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id\x16492&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Alsa Mixer api documentation. (Damn u C programmers!)
2005-07-25 14:20 ` Alsa Mixer api documentation. (Damn u C programmers!) Chuckles
@ 2005-07-26 13:12 ` Jaroslav Kysela
0 siblings, 0 replies; 6+ messages in thread
From: Jaroslav Kysela @ 2005-07-26 13:12 UTC (permalink / raw)
To: Chuckles; +Cc: alsa-devel
On Mon, 25 Jul 2005, Chuckles wrote:
> > Write some docs in doxygen, we'll include it to our repository.
> >
> > Jaroslav
>
> No probs. I'd be more than willing to write some docs for the mixer
> api, if I could work out how to use it. So can you answer some
> questions about it? I'm confused as to why its necessary to use
> elements, simple elements and a high level control interface to set
> sound levels on the mixer.
Please, choose only one method. You can access directly the universal
control elements (direct mapping to driver) or use more simple interface
(snd_mixer_selem* function / defines).
> I have done some mixer programming with OSS, but this is very different.
> I see the snd_mixer_open function opens an empty mixer, fine, does this
> imply that a software mixer has to be built from the ground up? As in
> you add a pcm element, a master element, a cd element depending on what
> is available on your particular sound card to this empty mixer?
The alsa-lib does all this work. You need only enumerate (see selems()
function in amixer.c) and write/read values (see sset() function in
amixer.c) from such elements. Also note that all elements might be dynamic
(removed / added on the fly).
Basically, you need only to create a connection between driver (universal
control interface) and the more abstract layer in the initialization
phase.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-07-26 13:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-24 23:46 Alsa Mixer api documentation Chuckles
2005-07-25 1:20 ` Lee Revell
2005-07-25 11:33 ` Chuckles
2005-07-25 13:11 ` Jaroslav Kysela
2005-07-25 14:20 ` Alsa Mixer api documentation. (Damn u C programmers!) Chuckles
2005-07-26 13:12 ` Jaroslav Kysela
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.