Skip to contentSkip to conversation

Getting and changing Volume

DISCUSSION Luca bedogni 2 participants 3 messages Aug 30, 2006 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi all
first message from me here.
I'm writing a simple application for interacting with alsa. All's ok, except for the volume.
I open the pcm devices correctly, but then can't find nothing to get the current volume and setting the new one, such alsamixer does.

Any idea?

Bye
Bedo

Signature · 12 lines
Debian Powered GNU/Linux User #373118
Bedogni Luca - 	Blog | http://blog.lucabedogni.it
		Site | http://www.lucabedogni.it
Debianizzati - www.debianizzati.org | Founder Member
--
Scherzando, si puo' dire di tutto, anche la verita'.  Sigmund Freud

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
#1 lore raw

At Wed, 30 Aug 2006 12:53:27 +0200,

Quoted 9 lines · Luca bedogni

Hi all
first message from me here.
I'm writing a simple application for interacting with alsa. All's ok, except for the volume.
I open the pcm devices correctly, but then can't find nothing to get the current volume and setting the new one, such alsamixer does.

Any idea?

Currently, there is no explicit API which mixer element corresponds to a certain PCM stream. So, most apps use simply the mixer interface and access either "PCM" or "Master" mixer element for controlling the total volume.

In theory, it's possible to build a softvol entry for each PCM substream so that the volume can be controlled independently by each app even if the hardware multi-stream PCM volume control isn't possible. But, it's still in dream as long as unimplemented...

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

At Wed, 30 Aug 2006 17:39:31 +0200,

Quoted 9 lines · Luca bedogni
Quoted 5 lines · On Wed, 30 Aug 2006 17:01:13 +0200 Takashi Iwai <[email protected]> wrote:

Currently, there is no explicit API which mixer element corresponds to a certain PCM stream. So, most apps use simply the mixer interface and access either "PCM" or "Master" mixer element for controlling the total volume.

Quoted 7 lines
Quoted 4 lines

In theory, it's possible to build a softvol entry for each PCM substream so that the volume can be controlled independently by each app even if the hardware multi-stream PCM volume control isn't possible. But, it's still in dream as long as unimplemented...

So it's not possible to control the volume? I've seen amixer and gamix codes for finding something helpful for me, but find nothing :(

It's of course possible to change the volume, but it will influence on other streams, too.

The mixer interface is independent from the PCM interface. You cannot change the volume from snd_pcm_t handle.

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642