[pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-07-25 Thread Amar Akshat
Hi,
I have a multiple sound cards connected to my pc, and I have input and
output configured as different virtual devices, like this,
pcm.pulse_i {
type pulse
device alsa_input.pci-_00_1b.0.analog-stereo
}
pcm.pulse_o {
type pulse
device alsa_output.pci-_00_1b.0.analog-mono
}
Can I combine both of them into one virtual device ? Since my application
requires specifying only sound card name for both operations. ?
Thanks in advance.

-- 


Thank you...

*Amar Akshat (アマール)*

 *"Walking on water and developing software from a specification are easy
if both are frozen."*
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-07-02 Thread Tanu Kaskinen
On Mon, 2012-07-02 at 19:10 +0900, Amar Akshat wrote:
> Thanks for the compilation details, it all compiled in the 1st go,
> 
> While modifying the code to accept source and sink parameter in the
> asoundrc, is it advisable to have to 2
> snd_pcm_pulse_t *pcm; objects ?

Two snd_pcm_pulse_t objects where? I would imagine that you don't have
to care about that - when you open both input and output in your
application, alsa will automatically create two pulse pcm objects behind
the scenes: one for input and one for output. I'm not really an alsa
expert, however, so it's possible that I'm wrong.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-07-02 Thread Amar Akshat
Thanks for the compilation details, it all compiled in the 1st go,

While modifying the code to accept source and sink parameter in the
asoundrc, is it advisable to have to 2
snd_pcm_pulse_t *pcm; objects ?

Like one for source and one for sink and initialize them the same way,
because I can't see any other way to do it. Correct me if I am wrong.

Amar.

On Sun, Jul 1, 2012 at 4:24 PM, Tanu Kaskinen  wrote:
> On Sun, 2012-07-01 at 09:49 +0300, Tanu Kaskinen wrote:
>> I tried the "./gitcompile --enable-pulseaudio" command myself, and had
>> this problem:
>>
>> Making all in pulse
>> make[2]: Entering directory `/home/tanu/dev/alsa-plugins/pulse'
>> /bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  
>>   -Wall -g -I/usr/include/alsa-D_REENTRANT -I/usr/local/include   
>> -D_GNU_SOURCE -g -O2 -MT ctl_pulse.lo -MD -MP -MF .deps/ctl_pulse.Tpo -c -o 
>> ctl_pulse.lo ctl_pulse.c
>> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -I/usr/include/alsa 
>> -D_REENTRANT -I/usr/local/include -D_GNU_SOURCE -g -O2 -MT ctl_pulse.lo -MD 
>> -MP -MF .deps/ctl_pulse.Tpo -c ctl_pulse.c  -fPIC -DPIC -o .libs/ctl_pulse.o
>> mv -f .deps/ctl_pulse.Tpo .deps/ctl_pulse.Plo
>> /bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  
>>   -Wall -g -I/usr/include/alsa-D_REENTRANT -I/usr/local/include   
>> -D_GNU_SOURCE -g -O2 -MT pulse.lo -MD -MP -MF .deps/pulse.Tpo -c -o pulse.lo 
>> pulse.c
>> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -I/usr/include/alsa 
>> -D_REENTRANT -I/usr/local/include -D_GNU_SOURCE -g -O2 -MT pulse.lo -MD -MP 
>> -MF .deps/pulse.Tpo -c pulse.c  -fPIC -DPIC -o .libs/pulse.o
>> mv -f .deps/pulse.Tpo .deps/pulse.Plo
>> /bin/bash ../libtool --tag=CC   --mode=link gcc -Wall -g -I/usr/include/alsa 
>>-D_REENTRANT -I/usr/local/include   -D_GNU_SOURCE -g -O2 -module 
>> -avoid-version -export-dynamic -no-undefined   -o 
>> libasound_module_ctl_pulse.la -rpath /usr/lib/alsa-lib ctl_pulse.lo pulse.lo 
>> -lasound-L/usr/local/lib -lpulse   -lasound
>> libtool: link: gcc -shared  -fPIC -DPIC  .libs/ctl_pulse.o .libs/pulse.o   
>> -L/usr/local/lib /usr/local/lib/libpulse.so -lasound  -O2   -pthread 
>> -Wl,-soname -Wl,libasound_module_ctl_pulse.so -o 
>> .libs/libasound_module_ctl_pulse.so
>> /bin/sed: can't read /usr/lib/x86_64-linux-gnu/libsndfile.la: No such file 
>> or directory
>> libtool: link: `/usr/lib/x86_64-linux-gnu/libsndfile.la' is not a valid 
>> libtool archive
>> make[2]: *** [libasound_module_ctl_pulse.la] Error 1
>> make[2]: Leaving directory `/home/tanu/dev/alsa-plugins/pulse'
>> make[1]: *** [all-recursive] Error 1
>> make[1]: Leaving directory `/home/tanu/dev/alsa-plugins'
>> make: *** [all] Error 2
>>
>> Debian doesn't ship libsndfile.la, so I tried installing libsndfile from
>> source. That didn't help at all. I eventually figured that since the
>> alsa build system doesn't reference libsndfile at all, libpulse must
>> somehow have a reference to /usr/lib/x86_64-linux-gnu/libsndfile.la
>> (even though my system has never had that file installed). I rebuilt
>> pulseaudio and installed it, and now it works (apparently because the
>> rebuilt version references the version of libsndfile that was built from
>> source, which includes libsndfile.la, instead of referencing the system
>> version of libsndfile).
>>
>> Does anyone know if the build system of alsa-plugins could be improved
>> so that it doesn't use any external .la files when linking?
>
> Update: now I'm unable to reproduce the problem, even after uninstalling
> the self-compiled libsndfile instance and rebuilding pulseaudio again...
> That means that I can't try any fixes, because there's nothing to fix.
> Sorry for the noise.
>
> --
> Tanu
>



-- 

Thank you...

Amar Akshat (アマール)

 "Walking on water and developing software from a specification are
easy if both are frozen."
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-07-01 Thread Tanu Kaskinen
On Sun, 2012-07-01 at 14:59 +0200, Rafał Mużyło wrote:
> > Does anyone know if the build system of alsa-plugins could be improved
> > so that it doesn't use any external .la files when linking?
> 
> You're asking the wrong question here.
> The build system works exactly like intended.
> It's the problem of la files that's bitten you. It's an annoying legacy
> quirk of libtool.
> If you i.e. pass '-lpulse' via libtool, the la file has priority over
> plain library.
> On modern systems, it's more of a bother than help, so most binary distros
> at this time remove la files even in their -devel packages.
> (though there are packages that actually use their la files, i.e.
> ImageMagick or mpg123, there aren't many of those - mostly just the ones
> using libltdl (and not even all of those))
> See some of the posts on http://blog.flameeyes.eu/tag/libtool on this
> subject.
> 
> Basically, your problem was that you've most likely done "make install"
> for pulseaudio and failed to remove installed la files. That in turn
> added reference to libsamplerate.

You're right: I have never removed the .la files. Now I'm just wondering
why the .la file doesn't anymore appear to have priority over the plain
library. Pulseaudio's .la files are certainly still installed.

> On an related note: "sudo make install" can be a very good advice on
> "how to break your system".

I guess that depends on what you're installing... At least pulseaudio
has been trouble-free for me, because the client library has always
remained backwards compatible, so existing applications keep working (on
version number bumps things tend to stop working, but one "sudo
ldconfig" invocation fixes that).

When I have had trouble with other software that I've installed with
"sudo make install", cleaning it out has been easy, since it's all
nicely separated under /usr/local. The real trouble starts when people
set the install prefix to /usr, overwriting the system files.

If you have better advice for testing self-modified alsa-plugins, I'm
all ears. I know it's possible to install to some random place, or even
avoid installing altogether and running from the source tree. But "make
&& sudo make install" is much simpler, and the worst case is that you
break alsa applications, which you should be able to fix by running
"sudo make uninstall".

... Now I actually tested what "sudo make install" does with
alsa-plugins. Against my assumptions, it didn't install its stuff
under /usr/local. Instead, the plugins were installed
in /usr/lib/alsa-lib, so I guess on most systems the default behavior is
to overwrite the system files... (On Debian it's not so, though, because
the system files are in /usr/lib/x86_64-linux-gnu/alsa-lib.)

I'm not sure if I should declare alsa-plugins broken, because it by
default overwrites the system files. Maybe plugins are a bit special in
this regard: the search path for plugins is not handled the same way as
for "normal" shared libraries. Instead, the plugin search path seems to
be hard-coded into alsa-lib (configurable only at build time), so in
order to test self-built alsa-plugins, you need to make sure that
alsa-lib and alsa-plugins have the same plugindir configured. Therefore,
in order to make "sudo make install" Just Work by default (on non-Debian
systems...), the alsa folks have decided that it's best to overwrite the
system files.

So yes, I probably should have told Amar to compile also alsa-lib from
source, and configure alsa-lib and alsa-plugins with
--with-plugindir=/usr/local/lib/alsa-lib or something like that. With
the advice that I gave, he will probably overwrite the system files, and
I can only hope that it won't cause too much trouble...

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-07-01 Thread Rafał Mużyło
> Does anyone know if the build system of alsa-plugins could be improved
> so that it doesn't use any external .la files when linking?

You're asking the wrong question here.
The build system works exactly like intended.
It's the problem of la files that's bitten you. It's an annoying legacy
quirk of libtool.
If you i.e. pass '-lpulse' via libtool, the la file has priority over
plain library.
On modern systems, it's more of a bother than help, so most binary distros
at this time remove la files even in their -devel packages.
(though there are packages that actually use their la files, i.e.
ImageMagick or mpg123, there aren't many of those - mostly just the ones
using libltdl (and not even all of those))
See some of the posts on http://blog.flameeyes.eu/tag/libtool on this
subject.

Basically, your problem was that you've most likely done "make install"
for pulseaudio and failed to remove installed la files. That in turn
added reference to libsamplerate.

On an related note: "sudo make install" can be a very good advice on
"how to break your system".

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-07-01 Thread Tanu Kaskinen
On Sun, 2012-07-01 at 09:49 +0300, Tanu Kaskinen wrote:
> I tried the "./gitcompile --enable-pulseaudio" command myself, and had
> this problem:
> 
> Making all in pulse
> make[2]: Entering directory `/home/tanu/dev/alsa-plugins/pulse'
> /bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   
>  -Wall -g -I/usr/include/alsa-D_REENTRANT -I/usr/local/include   
> -D_GNU_SOURCE -g -O2 -MT ctl_pulse.lo -MD -MP -MF .deps/ctl_pulse.Tpo -c -o 
> ctl_pulse.lo ctl_pulse.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -I/usr/include/alsa 
> -D_REENTRANT -I/usr/local/include -D_GNU_SOURCE -g -O2 -MT ctl_pulse.lo -MD 
> -MP -MF .deps/ctl_pulse.Tpo -c ctl_pulse.c  -fPIC -DPIC -o .libs/ctl_pulse.o
> mv -f .deps/ctl_pulse.Tpo .deps/ctl_pulse.Plo
> /bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   
>  -Wall -g -I/usr/include/alsa-D_REENTRANT -I/usr/local/include   
> -D_GNU_SOURCE -g -O2 -MT pulse.lo -MD -MP -MF .deps/pulse.Tpo -c -o pulse.lo 
> pulse.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -I/usr/include/alsa 
> -D_REENTRANT -I/usr/local/include -D_GNU_SOURCE -g -O2 -MT pulse.lo -MD -MP 
> -MF .deps/pulse.Tpo -c pulse.c  -fPIC -DPIC -o .libs/pulse.o
> mv -f .deps/pulse.Tpo .deps/pulse.Plo
> /bin/bash ../libtool --tag=CC   --mode=link gcc -Wall -g -I/usr/include/alsa  
>   -D_REENTRANT -I/usr/local/include   -D_GNU_SOURCE -g -O2 -module 
> -avoid-version -export-dynamic -no-undefined   -o 
> libasound_module_ctl_pulse.la -rpath /usr/lib/alsa-lib ctl_pulse.lo pulse.lo 
> -lasound-L/usr/local/lib -lpulse   -lasound 
> libtool: link: gcc -shared  -fPIC -DPIC  .libs/ctl_pulse.o .libs/pulse.o   
> -L/usr/local/lib /usr/local/lib/libpulse.so -lasound  -O2   -pthread 
> -Wl,-soname -Wl,libasound_module_ctl_pulse.so -o 
> .libs/libasound_module_ctl_pulse.so
> /bin/sed: can't read /usr/lib/x86_64-linux-gnu/libsndfile.la: No such file or 
> directory
> libtool: link: `/usr/lib/x86_64-linux-gnu/libsndfile.la' is not a valid 
> libtool archive
> make[2]: *** [libasound_module_ctl_pulse.la] Error 1
> make[2]: Leaving directory `/home/tanu/dev/alsa-plugins/pulse'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/tanu/dev/alsa-plugins'
> make: *** [all] Error 2
> 
> Debian doesn't ship libsndfile.la, so I tried installing libsndfile from
> source. That didn't help at all. I eventually figured that since the
> alsa build system doesn't reference libsndfile at all, libpulse must
> somehow have a reference to /usr/lib/x86_64-linux-gnu/libsndfile.la
> (even though my system has never had that file installed). I rebuilt
> pulseaudio and installed it, and now it works (apparently because the
> rebuilt version references the version of libsndfile that was built from
> source, which includes libsndfile.la, instead of referencing the system
> version of libsndfile).
> 
> Does anyone know if the build system of alsa-plugins could be improved
> so that it doesn't use any external .la files when linking?

Update: now I'm unable to reproduce the problem, even after uninstalling
the self-compiled libsndfile instance and rebuilding pulseaudio again...
That means that I can't try any fixes, because there's nothing to fix.
Sorry for the noise.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-30 Thread Tanu Kaskinen
(CC'ing alsa-devel, because I had problems with building alsa-plugins)

On Sun, 2012-07-01 at 14:16 +0900, Amar Akshat wrote:
> Help me here with two things,
> 
> 1) How do I fix this and test, as in should I clone the alsa-project,
> or download alsa code and fix and compile ? In case I have to clone
> it, can you also provide me the clone instructions.

git clone git://git.alsa-project.org/alsa-plugins.git alsa-plugins
cd alsa-plugins
./gitcompile --enable-pulseaudio

If the configure script complains about missing dependencies, you'll
need to install them.

After you have made your changes, I believe you should be able to test
them by running "make && sudo make install". I haven't tried that
myself.

I tried the "./gitcompile --enable-pulseaudio" command myself, and had
this problem:

Making all in pulse
make[2]: Entering directory `/home/tanu/dev/alsa-plugins/pulse'
/bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..
-Wall -g -I/usr/include/alsa-D_REENTRANT -I/usr/local/include   
-D_GNU_SOURCE -g -O2 -MT ctl_pulse.lo -MD -MP -MF .deps/ctl_pulse.Tpo -c -o 
ctl_pulse.lo ctl_pulse.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -I/usr/include/alsa 
-D_REENTRANT -I/usr/local/include -D_GNU_SOURCE -g -O2 -MT ctl_pulse.lo -MD -MP 
-MF .deps/ctl_pulse.Tpo -c ctl_pulse.c  -fPIC -DPIC -o .libs/ctl_pulse.o
mv -f .deps/ctl_pulse.Tpo .deps/ctl_pulse.Plo
/bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..
-Wall -g -I/usr/include/alsa-D_REENTRANT -I/usr/local/include   
-D_GNU_SOURCE -g -O2 -MT pulse.lo -MD -MP -MF .deps/pulse.Tpo -c -o pulse.lo 
pulse.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -I/usr/include/alsa 
-D_REENTRANT -I/usr/local/include -D_GNU_SOURCE -g -O2 -MT pulse.lo -MD -MP -MF 
.deps/pulse.Tpo -c pulse.c  -fPIC -DPIC -o .libs/pulse.o
mv -f .deps/pulse.Tpo .deps/pulse.Plo
/bin/bash ../libtool --tag=CC   --mode=link gcc -Wall -g -I/usr/include/alsa
-D_REENTRANT -I/usr/local/include   -D_GNU_SOURCE -g -O2 -module -avoid-version 
-export-dynamic -no-undefined   -o libasound_module_ctl_pulse.la -rpath 
/usr/lib/alsa-lib ctl_pulse.lo pulse.lo -lasound-L/usr/local/lib -lpulse   
-lasound 
libtool: link: gcc -shared  -fPIC -DPIC  .libs/ctl_pulse.o .libs/pulse.o   
-L/usr/local/lib /usr/local/lib/libpulse.so -lasound  -O2   -pthread 
-Wl,-soname -Wl,libasound_module_ctl_pulse.so -o 
.libs/libasound_module_ctl_pulse.so
/bin/sed: can't read /usr/lib/x86_64-linux-gnu/libsndfile.la: No such file or 
directory
libtool: link: `/usr/lib/x86_64-linux-gnu/libsndfile.la' is not a valid libtool 
archive
make[2]: *** [libasound_module_ctl_pulse.la] Error 1
make[2]: Leaving directory `/home/tanu/dev/alsa-plugins/pulse'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/tanu/dev/alsa-plugins'
make: *** [all] Error 2

Debian doesn't ship libsndfile.la, so I tried installing libsndfile from
source. That didn't help at all. I eventually figured that since the
alsa build system doesn't reference libsndfile at all, libpulse must
somehow have a reference to /usr/lib/x86_64-linux-gnu/libsndfile.la
(even though my system has never had that file installed). I rebuilt
pulseaudio and installed it, and now it works (apparently because the
rebuilt version references the version of libsndfile that was built from
source, which includes libsndfile.la, instead of referencing the system
version of libsndfile).

Does anyone know if the build system of alsa-plugins could be improved
so that it doesn't use any external .la files when linking?

> 2) and after my modifications, my config in asoundrc should look like this ?
> 
> pcm.pulse_dev1 {
>   type pulse
>   source alsa_input.pci-_00_1b.0.analog-stereo
>   sink alsa_output.pci-_00_1b.0.analog-mono
> }

Yes.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-30 Thread Amar Akshat
Help me here with two things,

1) How do I fix this and test, as in should I clone the alsa-project,
or download alsa code and fix and compile ? In case I have to clone
it, can you also provide me the clone instructions.

2) and after my modifications, my config in asoundrc should look like this ?

pcm.pulse_dev1 {
  type pulse
  source alsa_input.pci-_00_1b.0.analog-stereo
  sink alsa_output.pci-_00_1b.0.analog-mono
}



On Sat, Jun 30, 2012 at 5:38 PM, Tanu Kaskinen  wrote:
> On Sat, 2012-06-30 at 17:04 +0900, Amar Akshat wrote:
>> On Sat, Jun 30, 2012 at 4:47 PM, Tanu Kaskinen  wrote:
>> > Is the GUI in a different process than the sip stack? If yes, then the
>> > environment variables have to be set by the sip stack. Are you able to
>> > alter the sip stack, or are you only doing the GUI part?
>> >
>>
>> I only handle the GUI part - the sip-stack is a 3rd party software.
>
> You didn't answer my question about the process separation - do you use
> the sip stack as a library or is it a separate process?
>
> If it's a separate process, then the cleanest solution would certainly
> be to fix the pulse plugin. Would you be interested in doing that? It
> shouldn't be hard at all. The code can be seen here:
> git.alsa-project.org/?p=alsa-plugins.git;a=blob;f=pulse/pcm_pulse.c
>
> The "device" parameter is parsed in SND_PCM_PLUGIN_DEFINE_FUNC().
> Parsing "sink" and "source" can be done in the same way. The "device"
> parameter is used in pulse_prepare(). You would use the "sink" and
> "source" in the same place.
>
> --
> Tanu
>



-- 

Thank you...

Amar Akshat (アマール)

 "Walking on water and developing software from a specification are
easy if both are frozen."
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-30 Thread Tanu Kaskinen
On Sat, 2012-06-30 at 17:04 +0900, Amar Akshat wrote:
> On Sat, Jun 30, 2012 at 4:47 PM, Tanu Kaskinen  wrote:
> > Is the GUI in a different process than the sip stack? If yes, then the
> > environment variables have to be set by the sip stack. Are you able to
> > alter the sip stack, or are you only doing the GUI part?
> >
> 
> I only handle the GUI part - the sip-stack is a 3rd party software.

You didn't answer my question about the process separation - do you use
the sip stack as a library or is it a separate process?

If it's a separate process, then the cleanest solution would certainly
be to fix the pulse plugin. Would you be interested in doing that? It
shouldn't be hard at all. The code can be seen here:
git.alsa-project.org/?p=alsa-plugins.git;a=blob;f=pulse/pcm_pulse.c

The "device" parameter is parsed in SND_PCM_PLUGIN_DEFINE_FUNC().
Parsing "sink" and "source" can be done in the same way. The "device"
parameter is used in pulse_prepare(). You would use the "sink" and
"source" in the same place.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-30 Thread Amar Akshat
On Sat, Jun 30, 2012 at 4:47 PM, Tanu Kaskinen  wrote:
> On Sat, 2012-06-30 at 03:37 +0900, Amar Akshat wrote:
>> > Do you reopen the audio stream when the routing changes? I guess you
>> > have to do that, since ALSA doesn't provide a mechanism to move a live
>> > stream from one device to another. You could then set the PULSE_SINK and
>> > PULSE_SOURCE environment variables prior to opening a new stream - that
>> > way you could use just "default", and the routing would be controlled by
>> > those environment variables. I asked about reopening the streams,
>> > because the environment variables only have effect when you create a new
>> > stream.
>>
>> Thats true, my sip stack, reopens the audio stream when routing
>> changes, infact, my sip-stack creates audio stream for every call.
>> I have a doubt, when we pass "default"  as the sound device, does the
>> pulseaudio refer to PULSE_SINK and PULSE_SOURCE environment variables
>> internally to identify sink/source? If yes, then I guess setting these
>> variables can do the trick for me.
>
> Yes, libpulse uses those environment variables internally. libpulse is
> used by the "pulse" alsa plugin.
>
> Is the GUI in a different process than the sip stack? If yes, then the
> environment variables have to be set by the sip stack. Are you able to
> alter the sip stack, or are you only doing the GUI part?
>

I only handle the GUI part - the sip-stack is a 3rd party software.

> --
> Tanu
>



-- 

Thank you...

Amar Akshat (アマール)

 "Walking on water and developing software from a specification are
easy if both are frozen."
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-30 Thread Tanu Kaskinen
On Sat, 2012-06-30 at 03:37 +0900, Amar Akshat wrote:
> > Do you reopen the audio stream when the routing changes? I guess you
> > have to do that, since ALSA doesn't provide a mechanism to move a live
> > stream from one device to another. You could then set the PULSE_SINK and
> > PULSE_SOURCE environment variables prior to opening a new stream - that
> > way you could use just "default", and the routing would be controlled by
> > those environment variables. I asked about reopening the streams,
> > because the environment variables only have effect when you create a new
> > stream.
> 
> Thats true, my sip stack, reopens the audio stream when routing
> changes, infact, my sip-stack creates audio stream for every call.
> I have a doubt, when we pass "default"  as the sound device, does the
> pulseaudio refer to PULSE_SINK and PULSE_SOURCE environment variables
> internally to identify sink/source? If yes, then I guess setting these
> variables can do the trick for me.

Yes, libpulse uses those environment variables internally. libpulse is
used by the "pulse" alsa plugin.

Is the GUI in a different process than the sip stack? If yes, then the
environment variables have to be set by the sip stack. Are you able to
alter the sip stack, or are you only doing the GUI part?

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-29 Thread Amar Akshat
Hi,
I did not realize my messages were going in HTML, I ve changed it to
plain text now.




On Sat, Jun 30, 2012 at 2:57 AM, Tanu Kaskinen  wrote:
>
> Hi,
>
> Could you send your messages as plain text instead of HTML in the
> future? I hear Gmail has a setting for that. Quoting more than one level
> doesn't seem to work properly with HTML (and it's anyway against the
> mailing list etiquette to send HTML).
>
> On Sat, 2012-06-30 at 00:58 +0900, Amar Akshat wrote:
>
> > Let me explain, I am in the process of building an application ("my
> > program"), which allows user to switch sound cards (as in left usb
> > handset, right usb handset and oboard), and I am going to store
> > sound_cards, in variables like following,
> >
> >
> > onboard = "pulse_onboard"
> > right_handset = "pulse_right"
> > left_handset = "pulse_left"
> >
> >
> > Depending upon user's current state, I am going to marshal request to
> > my back-end program, which takes sound card as plain strings. So I
> > can't use default, I need to be able to specify the sound_card name
> > which can be any of the three (namely onboard, right and left).
>
> It's hard to imagine what your program does... I guess you can count on
> every user to have specific hardware (an onboard sound card and two USB
> handsets, whatever those are)? Is it out of question to require the user
> to use e.g. pavucontrol to change the routing? Is it out of question for
> you to use PulseAudio's native API to control the routing?

Yes, i am providing the hardware as well as the software. Actually,
user requirement is, he should be able to switch handsets on the press
of a button, Consider a device with two handsets and one main speaker,
and user having a graphical interface to control his calls. He can
switch between handsets and talk to several people at one time. The
telephony program is the back-end (sip-stack), which is passed a
sound_device, media flows through it.
Having said that, pavucontrol (I think) is out of picture, Using
PulseAudio's native API to control routing may be an approach, as long
as it can provide me exactly one "sound_device", to be used as source
and sink.

>
> Do you reopen the audio stream when the routing changes? I guess you
> have to do that, since ALSA doesn't provide a mechanism to move a live
> stream from one device to another. You could then set the PULSE_SINK and
> PULSE_SOURCE environment variables prior to opening a new stream - that
> way you could use just "default", and the routing would be controlled by
> those environment variables. I asked about reopening the streams,
> because the environment variables only have effect when you create a new
> stream.

Thats true, my sip stack, reopens the audio stream when routing
changes, infact, my sip-stack creates audio stream for every call.
I have a doubt, when we pass "default"  as the sound device, does the
pulseaudio refer to PULSE_SINK and PULSE_SOURCE environment variables
internally to identify sink/source? If yes, then I guess setting these
variables can do the trick for me.

>
> > Am I a bit clear this time ?
>
> Yes, your use case is becoming a bit clearer :)
>
> --
> Tanu
>



--


Thank you...

Amar Akshat (アマール)

 "Walking on water and developing software from a specification are easy if
both are frozen."
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-29 Thread Tanu Kaskinen
Hi,

Could you send your messages as plain text instead of HTML in the
future? I hear Gmail has a setting for that. Quoting more than one level
doesn't seem to work properly with HTML (and it's anyway against the
mailing list etiquette to send HTML).

On Sat, 2012-06-30 at 00:58 +0900, Amar Akshat wrote:

> Let me explain, I am in the process of building an application ("my
> program"), which allows user to switch sound cards (as in left usb
> handset, right usb handset and oboard), and I am going to store
> sound_cards, in variables like following, 
> 
> 
> onboard = "pulse_onboard"
> right_handset = "pulse_right"
> left_handset = "pulse_left"
> 
> 
> Depending upon user's current state, I am going to marshal request to
> my back-end program, which takes sound card as plain strings. So I
> can't use default, I need to be able to specify the sound_card name
> which can be any of the three (namely onboard, right and left).

It's hard to imagine what your program does... I guess you can count on
every user to have specific hardware (an onboard sound card and two USB
handsets, whatever those are)? Is it out of question to require the user
to use e.g. pavucontrol to change the routing? Is it out of question for
you to use PulseAudio's native API to control the routing?

Do you reopen the audio stream when the routing changes? I guess you
have to do that, since ALSA doesn't provide a mechanism to move a live
stream from one device to another. You could then set the PULSE_SINK and
PULSE_SOURCE environment variables prior to opening a new stream - that
way you could use just "default", and the routing would be controlled by
those environment variables. I asked about reopening the streams,
because the environment variables only have effect when you create a new
stream.

> Am I a bit clear this time ? 

Yes, your use case is becoming a bit clearer :)

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-29 Thread Amar Akshat
On Sat, Jun 30, 2012 at 12:27 AM, Tanu Kaskinen  wrote:

> On Fri, 2012-06-29 at 23:54 +0900, Amar Akshat wrote:
> > Well I understand what you mean, however the problem at my end is a
> > combination of two, in which automatic routing just can't work as far
> > as I can see.
> >
> >
> > 1). I need to be able to specify sound card "name", so that my program
> > can operate sound to/from that device.
>
> You're apparently using an alsa application. If it asks you a sound card
> name, tell it to use "default". That should then forward the sound to
> pulseaudio if alsa is set up correctly.
>

Let me explain, I am in the process of building an application ("my
program"), which allows user to switch sound cards (as in left usb handset,
right usb handset and oboard), and I am going to store sound_cards, in
variables like following,

onboard = "pulse_onboard"
right_handset = "pulse_right"
left_handset = "pulse_left"

Depending upon user's current state, I am going to marshal request to
my back-end program, which takes sound card as plain strings. So I can't
use default, I need to be able to specify the sound_card name which can be
any of the three (namely onboard, right and left).


>
> > 2). Multiple applications within my program shall be able to use the
> > same sound -card.
>
> I don't understand what you're trying to say here. What's the difference
> between "application" and "my program" here? If you tell all
> applications to use "default", then all applications will use the same
> sound card, and your problem is solved?
>
> As explained above I can't tell my program to use default, because user
may change his preference by the press of a button to switch the program,
when it is running.


> > Now, I can shoot item #2, by creating a virtual device in asoundrc,
> > but to shoot item# 1, I need sound_device name, which has to be same
> > for sink and source. By using tools (eg. pavucontrol), I can specify a
> > default behaviour, but can I specify name based sound routing ? I mean
> > is it possible that I specify a device there say, X - which can use
> > pulse_1 as sink and pulse_2 as source.
>
> With pavucontrol you can route each application where ever you want. I
> feel that I'm not understanding what you're asking...
>
> Am I a bit clear this time ?

> --
> Tanu
>
>
>


-- 


Thank you...

*Amar Akshat (アマール)*

 *"Walking on water and developing software from a specification are easy
if both are frozen."*
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-29 Thread Tanu Kaskinen
On Fri, 2012-06-29 at 23:54 +0900, Amar Akshat wrote:
> Well I understand what you mean, however the problem at my end is a
> combination of two, in which automatic routing just can't work as far
> as I can see.
> 
> 
> 1). I need to be able to specify sound card "name", so that my program
> can operate sound to/from that device.

You're apparently using an alsa application. If it asks you a sound card
name, tell it to use "default". That should then forward the sound to
pulseaudio if alsa is set up correctly.

> 2). Multiple applications within my program shall be able to use the
> same sound -card.

I don't understand what you're trying to say here. What's the difference
between "application" and "my program" here? If you tell all
applications to use "default", then all applications will use the same
sound card, and your problem is solved?

> Now, I can shoot item #2, by creating a virtual device in asoundrc,
> but to shoot item# 1, I need sound_device name, which has to be same
> for sink and source. By using tools (eg. pavucontrol), I can specify a
> default behaviour, but can I specify name based sound routing ? I mean
> is it possible that I specify a device there say, X - which can use
> pulse_1 as sink and pulse_2 as source.

With pavucontrol you can route each application where ever you want. I
feel that I'm not understanding what you're asking...

-- 
Tanu


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-29 Thread Amar Akshat
Well I understand what you mean, however the problem at my end is a
combination of two, in which automatic routing just can't work as far as I
can see.

1). I need to be able to specify sound card "name", so that my program can
operate sound to/from that device.
2). Multiple applications within my program shall be able to use the same
sound -card.

Now, I can shoot item #2, by creating a virtual device in asoundrc, but to
shoot item# 1, I need sound_device name, which has to be same for sink and
source. By using tools (eg. pavucontrol), I can specify a default
behaviour, but can I specify name based sound routing ? I mean is it
possible that I specify a device there say, X - which can use pulse_1 as
sink and pulse_2 as source.

Thanks in advance.

On Fri, Jun 29, 2012 at 10:45 PM, Tanu Kaskinen  wrote:

> On Fri, 2012-06-29 at 22:16 +0900, Amar Akshat wrote:
> > Hi,
> > I have a multiple sound cards connected to my pc, and I have input and
> > output configured as different virtual devices, like this,
> > pcm.pulse_i {
> > type pulse
> > device alsa_input.pci-_00_1b.0.analog-stereo
> > }
> > pcm.pulse_o {
> > type pulse
> > device alsa_output.pci-_00_1b.0.analog-mono
> > }
> > Can I combine both of them into one virtual device ? Since my application
> > requires specifying only sound card name for both operations. ?
> > Thanks in advance.
>
> It might be possible to combine the two devices into one with some alsa
> configuration magic. I don't know how to do that.
>
> It seems a bit stupid that the pulse plugin only has one "device"
> parameter. It should have separate "sink" and "source" parameters. Feel
> free to file a bug about this:
> https://bugs.freedesktop.org/enter_bug.cgi?product=PulseAudio
>
> That said, usually we recommend not to use a sound card selector in
> individual applications. Instead, use pavucontrol or similar to
> configure the routing. Let's say that you have this in your asoundrc:
>
> pcm.pulse {
>type pulse
> }
>
> When you use that, the routing is done by the pulseaudio daemon, instead
> of you hardcoding the sound card in the configuration file. If you're
> not happy with the automatic routing, you can move your application's
> streams with e.g. pavucontrol to the right sink/source.
>
> --
> Tanu
>
>


-- 


Thank you...

*Amar Akshat (アマール)*

 *"Walking on water and developing software from a specification are easy
if both are frozen."*
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-29 Thread Tanu Kaskinen
On Fri, 2012-06-29 at 22:16 +0900, Amar Akshat wrote:
> Hi,
> I have a multiple sound cards connected to my pc, and I have input and
> output configured as different virtual devices, like this,
> pcm.pulse_i {
> type pulse
> device alsa_input.pci-_00_1b.0.analog-stereo
> }
> pcm.pulse_o {
> type pulse
> device alsa_output.pci-_00_1b.0.analog-mono
> }
> Can I combine both of them into one virtual device ? Since my application
> requires specifying only sound card name for both operations. ?
> Thanks in advance.

It might be possible to combine the two devices into one with some alsa
configuration magic. I don't know how to do that.

It seems a bit stupid that the pulse plugin only has one "device"
parameter. It should have separate "sink" and "source" parameters. Feel
free to file a bug about this:
https://bugs.freedesktop.org/enter_bug.cgi?product=PulseAudio

That said, usually we recommend not to use a sound card selector in
individual applications. Instead, use pavucontrol or similar to
configure the routing. Let's say that you have this in your asoundrc:

pcm.pulse {
type pulse
}

When you use that, the routing is done by the pulseaudio daemon, instead
of you hardcoding the sound card in the configuration file. If you're
not happy with the automatic routing, you can move your application's
streams with e.g. pavucontrol to the right sink/source.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

2012-06-29 Thread Amar Akshat
Hi,
I have a multiple sound cards connected to my pc, and I have input and
output configured as different virtual devices, like this,
pcm.pulse_i {
type pulse
device alsa_input.pci-_00_1b.0.analog-stereo
}
pcm.pulse_o {
type pulse
device alsa_output.pci-_00_1b.0.analog-mono
}
Can I combine both of them into one virtual device ? Since my application
requires specifying only sound card name for both operations. ?
Thanks in advance.

-- 


Thank you...

*Amar Akshat (アマール)*

 *"Walking on water and developing software from a specification are easy
if both are frozen."*




-- 


Thank you...

*Amar Akshat (アマール)*

 *"Walking on water and developing software from a specification are easy
if both are frozen."*
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss