[pulseaudio-discuss] Forwarding bluetooth sink to alsa source and bluetooth source to alsa sink

Colin Guthrie gmane at colin.guthr.ie
Sat Jul 11 03:35:34 PDT 2009


Hi,

'Twas brillig, and Peter Kornatowski at 10/07/09 17:51 did gyre and gimble:
> I have a following problem: I have a debian lenny system with a
> PCMCIA voicecard (Sierra Wireless, to which I can directly connect a
> wired headset) with a 2G SIM card. Making calls to other phones works
> fine. But I want to use my bluetooth headset (Jabra BT530) for the
> calls. I connect the headset through Pulseaudio (with
> module-bluetooth-device). Making SIP-calls with it (with Twinkle, not
> over the voicecard) works fine. I have a cable for the voicecard so I
> can connect it to the line in and line out of the soundcard. Now I
> would have to somehow route the bluetooth headset source to the
> soundcard (alsa) sink and the alsa source to the headset sink, so
> that I could "speak" to the voicecard and get speech from it to the
> bluetooth headset. I tried move-sink-input, but this just moves the
> output of a sink to another sink. Also all other commands and modules
> of Pulseaudio seem like they would not do the trick. Does someone of
> you have any ideas? Do I have to use another program? If yes, which
> one?

Do you know I think this is probably the very first real world example 
of where connecting sources->sinks (and vice versa) is desirable!

The problem comes with differing clocks. The two devices you're 
connecting together cannot be directly connected as their clocks will 
not be perfectly in sync. It's the same problem you'd get if you tried 
to join two car engines together and drive the same wheels! The 
different speeds of the engines would eventually break your drive system.

So you really need an active process that will be able to dynamically 
resample (drop samples or synthesize new ones) the data to ensure that 
two devices stay in sync.

Now pulseaudio does have some of the code to do that already in the form 
of module-compbine-sink. It is able to create a virtual sink and which 
really outputs to multiple real sinks. In order to do that it has to 
take care of all that resampling jiggery pokery.

But the sort answer is that, "no" there is no way to connect 
sinks->sources or sources->sinks in this way as things stand. It will 
likely happen at some point in the future, but I'm not sure if there is 
a solid plan.

In the mean time, there is a very dodgy and hacky thing you can do which 
is to to use "parec | pacat" (with appropriate arguments to select 
source/sink) and a corresponding "pacat | parec".

This does not handle any of the clock stuff so will likely yield 
unsatisfactory results, but it may allow you to play a bit for now.

Cheers

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list