Skip to contentSkip to conversation

Mix audio at different frequencies

DISCUSSION Juan Zapatero 6 participants 17 messages May 12, 2006 – May 26, 2006

lore
Share & tools
lore
#0 lore raw

Hello,
I need to mix in playback two different audio streams, one coming from an ogg player, which is at 44100Hz, and the other one, coming out of a VoIP application, in this case, at 8000Hz. As I am using the dmix plugin for mixing, I can't find out how to implement the resampling operations needed.

Thanks.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

-------------------------------------------------------
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 Fri, 12 May 2006 12:25:41 +0200,

Quoted 7 lines · Juan Zapatero

Hello,
I need to mix in playback two different audio streams, one coming from an ogg player, which is at 44100Hz, and the other one, coming out of a VoIP application, in this case, at 8000Hz. As I am using the dmix plugin for mixing, I can't find out how to implement the resampling operations needed.

Use plug or rate plugin. The default setting does it automatically, too.

Note that the rate plugin in 1.0.11 release has some bugs that was already fixed on HG repo.

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

#2 lore raw

What do you mean? Here is my .asoundrc, what has to be changed?

# this makes native ALSA apps default to using dmix
pcm.!default {
  type plug
  slave.pcm "duplex"
}

ctl.!default {
type hw
card 0
}

pcm.duplex{
type asym
playback.pcm "dmix0"
capture.pcm "plughw:0,0"
}

pcm.dmix0 {
    type dmix
    ipc_key 219345           # any unique number here
    slave {
            pcm "hw:0,0"
            period_time 0
            #buffer_time 0
            period_size 2048    # jm: much smoother than 1024/8192!
            buffer_size 32768
            rate 44100
    }    
    bindings {
        0 0   # from 0 => to 0
        1 1   # from 1 => to 1
    }
}
Quoted 10 lines · Takashi Iwai

At Fri, 12 May 2006 12:25:41 +0200,

Quoted 7 lines · Juan Zapatero

Hello,
I need to mix in playback two different audio streams, one coming from an ogg player, which is at 44100Hz, and the other one, coming out of a VoIP application, in this case, at 8000Hz. As I am using the dmix plugin for mixing, I can't find out how to implement the resampling operations needed.

Quoted 8 lines

Use plug or rate plugin. The default setting does it automatically, too.

Note that the rate plugin in 1.0.11 release has some bugs that was already fixed on HG repo.

Takashi

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

-------------------------------------------------------
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&kid0709&bid&3057&dat1642

#3 lore raw

At Mon, 15 May 2006 09:06:26 +0200,

Quoted 2 lines · Juan Zapatero

What do you mean? Here is my .asoundrc, what has to be changed?

It looks OK. And doesn't it work with your voip program?

Takashi

Quoted 69 lines
# this makes native ALSA apps default to using dmix
pcm.!default {
  type plug
  slave.pcm "duplex"
}

ctl.!default {
type hw
card 0
}

pcm.duplex{
   type asym
   playback.pcm "dmix0"
   capture.pcm "plughw:0,0"
}
pcm.dmix0 {
    type dmix
    ipc_key 219345           # any unique number here
    slave {
            pcm "hw:0,0"
            period_time 0
            #buffer_time 0
            period_size 2048    # jm: much smoother than 1024/8192!
            buffer_size 32768
            rate 44100
    }    
    bindings {
        0 0   # from 0 => to 0
        1 1   # from 1 => to 1
    }
}
Quoted 10 lines · Takashi Iwai

At Fri, 12 May 2006 12:25:41 +0200,

Quoted 7 lines · Juan Zapatero

Hello,
I need to mix in playback two different audio streams, one coming from an ogg player, which is at 44100Hz, and the other one, coming out of a VoIP application, in this case, at 8000Hz. As I am using the dmix plugin for mixing, I can't find out how to implement the resampling operations needed.

Quoted 8 lines

Use plug or rate plugin. The default setting does it automatically, too.

Note that the rate plugin in 1.0.11 release has some bugs that was already fixed on HG repo.

Takashi

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

Quoted 9 lines

______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

-------------------------------------------------------
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&kid0709&bid&3057&dat1642

#4 lore raw

No, it returns wrong buffer sizes. Instead of 160 samples, which is what I am expecting at 8000Hz, it returns a value of 341, which I do not understand.

----- Original Message ----- From: "Takashi Iwai" <[email protected]>
To: "Juan Zapatero" <[email protected]>
Cc: <[email protected]>
Sent: Monday, May 15, 2006 12:03 PM
Subject: Re: [Alsa-devel] Mix audio at different frequencies

Quoted 90 lines

At Mon, 15 May 2006 09:06:26 +0200,

Quoted 2 lines · Juan Zapatero

What do you mean? Here is my .asoundrc, what has to be changed?

It looks OK. And doesn't it work with your voip program?

Takashi

Quoted 79 lines
# this makes native ALSA apps default to using dmix
pcm.!default {
  type plug
  slave.pcm "duplex"
}

ctl.!default {
type hw
card 0
}

pcm.duplex{
   type asym
   playback.pcm "dmix0"
   capture.pcm "plughw:0,0"
}
pcm.dmix0 {
    type dmix
    ipc_key 219345           # any unique number here
    slave {
            pcm "hw:0,0"
            period_time 0
            #buffer_time 0
            period_size 2048    # jm: much smoother than 1024/8192!
            buffer_size 32768
            rate 44100
    }
    bindings {
        0 0   # from 0 => to 0
        1 1   # from 1 => to 1
    }
}
Quoted 10 lines · Takashi Iwai

At Fri, 12 May 2006 12:25:41 +0200,

Quoted 7 lines · Juan Zapatero

Hello,
I need to mix in playback two different audio streams, one coming from an ogg player, which is at 44100Hz, and the other one, coming out of a VoIP application, in this case, at 8000Hz. As I am using the dmix plugin for mixing, I can't find out how to implement the resampling operations needed.

Quoted 8 lines

Use plug or rate plugin. The default setting does it automatically, too.

Note that the rate plugin in 1.0.11 release has some bugs that was already fixed on HG repo.

Takashi

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are
addressed.
Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial
en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed.
Any unauthorised copy, disclosure or distribution of this message
is strictly forbidden. If you have received this transmission in error,
please notify the sender immediately and delete it.
______________________

-------------------------------------------------------
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&kid0709&bid&3057&dat1642

#5 lore raw

At Mon, 15 May 2006 13:25:39 +0200,

Quoted 4 lines · Juan Antonio Zapatero Campo

No, it returns wrong buffer sizes. Instead of 160 samples, which is what I am expecting at 8000Hz, it returns a value of 341, which I do not understand.

You cannot get always the exactly same buffer size you requested. Especially dmix limits the buffer size to its own and rate plugin rescales the size according to the rate conversion.

Takashi

Quoted 114 lines

----- Original Message -----
From: "Takashi Iwai" <[email protected]>
To: "Juan Zapatero" <[email protected]>
Cc: <[email protected]>
Sent: Monday, May 15, 2006 12:03 PM
Subject: Re: [Alsa-devel] Mix audio at different frequencies

Quoted 94 lines

At Mon, 15 May 2006 09:06:26 +0200,

Quoted 2 lines · Juan Zapatero

What do you mean? Here is my .asoundrc, what has to be changed?

It looks OK. And doesn't it work with your voip program?

Takashi

Quoted 83 lines
# this makes native ALSA apps default to using dmix
pcm.!default {
  type plug
  slave.pcm "duplex"
}

ctl.!default {
type hw
card 0
}

pcm.duplex{
   type asym
   playback.pcm "dmix0"
   capture.pcm "plughw:0,0"
}
pcm.dmix0 {
    type dmix
    ipc_key 219345           # any unique number here
    slave {
            pcm "hw:0,0"
            period_time 0
            #buffer_time 0
            period_size 2048    # jm: much smoother than 1024/8192!
            buffer_size 32768
            rate 44100
    }
    bindings {
        0 0   # from 0 => to 0
        1 1   # from 1 => to 1
    }
}
Quoted 14 lines · Takashi Iwai

At Fri, 12 May 2006 12:25:41 +0200,

Quoted 11 lines · Juan Zapatero

Hello,
I need to mix in playback two different audio streams, one coming from
an ogg player, which is at 44100Hz, and the other one, coming out of a
VoIP application, in this case, at 8000Hz. As I am using the dmix plugin
for mixing, I can't find out how to implement the resampling operations
needed.

Quoted 8 lines

Use plug or rate plugin. The default setting does it automatically, too.

Note that the rate plugin in 1.0.11 release has some bugs that was already fixed on HG repo.

Takashi

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are
addressed.
Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

Quoted 9 lines

______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

-------------------------------------------------------
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&kid0709&bid&3057&dat1642

#6 lore raw
Quoted 6 lines · Takashi Iwai

At Mon, 15 May 2006 13:25:39 +0200,

Quoted 2 lines · Juan Antonio Zapatero Campo

No, it returns wrong buffer sizes. Instead of 160 samples, which is what I am expecting at 8000Hz, it returns a value of 341, which I do not understand.

Quoted 7 lines

You cannot get always the exactly same buffer size you requested. Especially dmix limits the buffer size to its own and rate plugin rescales the size according to the rate conversion.

Takashi

I would argue that maybe we should modify the way alsa behaves, and somehow get dmix to work with user(application) defined buffer and period sizes. I.e. Let alsa handle whatever buffer and period size the user application wants, and get ALSA to translate it into the sized needed for the hardware. Maybe implement the use of the system timer in order to trigger the buffer events we need.

James

-------------------------------------------------------
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

#7 lore raw

At Mon, 15 May 2006 14:16:56 +0100,

Quoted 17 lines · James Courtier-Dutton
Quoted 8 lines · Takashi Iwai

At Mon, 15 May 2006 13:25:39 +0200,

Quoted 4 lines · Juan Antonio Zapatero Campo

No, it returns wrong buffer sizes. Instead of 160 samples, which is what I am expecting at 8000Hz, it returns a value of 341, which I do not understand.

Quoted 7 lines

You cannot get always the exactly same buffer size you requested. Especially dmix limits the buffer size to its own and rate plugin rescales the size according to the rate conversion.

Takashi

Quoted 8 lines

I would argue that maybe we should modify the way alsa behaves, and somehow get dmix to work with user(application) defined buffer and period sizes.
I.e. Let alsa handle whatever buffer and period size the user application wants, and get ALSA to translate it into the sized needed for the hardware.
Maybe implement the use of the system timer in order to trigger the buffer events we need.

The current handling of buffers in dmix is better than the earlier version. The buffer size has an upper limit of the slave PCM, and the minimum period size is also defined from the slave PCM. But you can choose freely between them. Though, still there are rooms for improvements.

Anyway, you cannot use a bigger buffer than the slave PCM without another sound daemon or extra threading, regardless of dmix or hw layer. The point of dmix is that the copy (mixing) of data is done by the application itself, not by the daemon. When an app writes a bigger chunk than slave PCM and gets sleep, you'll get underrun because no one updates/syncs the data between the slave PCM and the app buffer.

The current dmix code allows you to specify a bigger buffer than slave PCM (by passing a large number to max_periods parameter), but I already hit this problem.

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

#8 lore raw
In reply to Juan Zapatero
Quoted 2 lines · Juan Zapatero

What do you mean? Here is my .asoundrc, what has to be changed?

That ALSA already defaults to using dmix with the rate plugin since version 1.0.9. It should work without an .asoundrc.

Lee

Quoted 78 lines
# this makes native ALSA apps default to using dmix
pcm.!default {
  type plug
  slave.pcm "duplex"
}

ctl.!default {
type hw
card 0
}

pcm.duplex{
   type asym
   playback.pcm "dmix0"
   capture.pcm "plughw:0,0"
}
pcm.dmix0 {
    type dmix
    ipc_key 219345           # any unique number here
    slave {
            pcm "hw:0,0"
            period_time 0
            #buffer_time 0
            period_size 2048    # jm: much smoother than 1024/8192!
            buffer_size 32768
            rate 44100
    }    
    bindings {
        0 0   # from 0 => to 0
        1 1   # from 1 => to 1
    }
}
Quoted 10 lines · Takashi Iwai

At Fri, 12 May 2006 12:25:41 +0200,

Quoted 7 lines · Juan Zapatero

Hello,
I need to mix in playback two different audio streams, one coming from an ogg player, which is at 44100Hz, and the other one, coming out of a VoIP application, in this case, at 8000Hz. As I am using the dmix plugin for mixing, I can't find out how to implement the resampling operations needed.

Quoted 8 lines

Use plug or rate plugin. The default setting does it automatically, too.

Note that the rate plugin in 1.0.11 release has some bugs that was already fixed on HG repo.

Takashi

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

Quoted 10 lines

-------------------------------------------------------
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&kid0709&bid&3057&dat1642
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

-------------------------------------------------------
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

#9 lore raw
Quoted 2 lines · Lee Revell

That ALSA already defaults to using dmix with the rate plugin since version 1.0.9. It should work without an .asoundrc.

actually, that depends on the driver, thus on the sound card (which doesn't look it was specified in this thread?).

-------------------------------------------------------
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

#10 lore raw
Quoted 8 lines · Thierry Vignaud
Quoted 2 lines · Lee Revell

That ALSA already defaults to using dmix with the rate plugin since version 1.0.9. It should work without an .asoundrc.

actually, that depends on the driver, thus on the sound card (which doesn't look it was specified in this thread?).

It should have been solved in the latest release for everything but USB audio.

Lee

-------------------------------------------------------
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

#11 lore raw

Raise and lower volume through Alsa Api

Is there any way of modifying stream's volume through libasound API? I mean, raising or lowering a streams volume before sending it to soundcard with write(...)

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

#12 lore raw

Re: Raise and lower volume through Alsa Api

you have the softvolume plugin i think.

-- Ben

Quoted 32 lines · Juan Zapatero

Is there any way of modifying stream's volume through libasound API? I mean, raising or lowering a streams volume before sending it to soundcard with write(...)

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#13 lore raw

Re: Raise and lower volume through Alsa Api

But what about doing it through API, so that volume is set in the application, without using any volume plugin...

Quoted 38 lines · Benoit Fouet

you have the softvolume plugin i think.

-- Ben

Quoted 32 lines · Juan Zapatero

Is there any way of modifying stream's volume through libasound API? I mean, raising or lowering a streams volume before sending it to soundcard with write(...)

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#14 lore raw

Re: Raise and lower volume through Alsa Api

AFAIK, there's no way to do this... but i don't know ALSA that much to be sure of it...
but you can easily manage such a soft volume before sending samples to ALSA.

-- Ben

Quoted 69 lines · Juan Zapatero

But what about doing it through API, so that volume is set in the application, without using any volume plugin...

Quoted 42 lines · Benoit Fouet

you have the softvolume plugin i think.

-- Ben

Quoted 34 lines · Juan Zapatero

Is there any way of modifying stream's volume through libasound API? I mean, raising or lowering a streams volume before sending it to soundcard with write(...)

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion.
______________________
This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it.
______________________

Quoted 6 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#15 lore raw

Re: Raise and lower volume through Alsa Api

In reply to Juan Zapatero
Quoted 2 lines · Juan Zapatero

But what about doing it through API, so that volume is set in the application, without using any volume plugin...

No, it's not currently possible with ALSA. You have to implement your own software volunme control.

Lee

#16 lore raw

Re: Raise and lower volume through Alsa Api

At Fri, 26 May 2006 13:16:20 -0400,

Quoted 7 lines · Lee Revell
Quoted 2 lines · Juan Zapatero

But what about doing it through API, so that volume is set in the application, without using any volume plugin...

No, it's not currently possible with ALSA. You have to implement your own software volunme control.

Well, I'm considering of the implementation since there are really many demands on this feature.

One question is whether this control should be private or public.

If it's fine to be public, we can add a softvol to the "default" PCM. This softvol has IFACE_PCM and contains same number of elements as PCM substreams so that each PCM substream has own softvol. It corresponds to emu10k1's "PCM Volume" control. Since it's IFACE_PCM, this won't appear in the mixer app.

If the control should be private, it has to be implemented differently with more changes in alsa-lib code.

Another question is whether we need an alsa-lib API function for this. I guess something like

snd_ctl_elem_id_t *snd_pcm_get_volume_control(pcm_handle)

would be easy to use for apps.

Takashi