2005-01-26 17:10:14

by Ben Pezzei

[permalink] [raw]
Subject: [Bluez-devel] partly OT: pipe sound from Headset to soundcard

Hi again,

Apologies if my question is a bit OT, but no one on the alsa
list had an answer for this one:

I try to pipe the sound from the headset to line in of the
soundcard. something like:
/dev/snd/pcmC1D0c -> /dev/snd/pcmC0D0p
and vice versa:
/dev/snd/pcmC0D0c -> /dev/snd/pcmC1D0p

So everything which comes through the soundcard mic should
be "forwarded" to the headset earphone, and everything
which comes from the headset mic should land at the
soundcards line in.

is there a way to accomplish this?

any hint would be great

greetings
ben



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2005-01-27 12:51:15

by Lars Grunewaldt

[permalink] [raw]
Subject: Re: [Bluez-devel] partly OT: pipe sound from Headset to soundcard

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ben Pezzei wrote:
| Hi Brad,
|
| Brad Midgley schrieb:
|
|> I had the same thought.
|>
|> We have a way to send line in to a stereo headset but there is a
|> delay. (see bluetooth-alsa.sf.net)
|
|
| Yeah, but this covers A2DP only, right?
|
| Right now, I was trying to accomplish this via asound.conf:
| something like:
| pcm.foo {
| type multi
| <map soundcard>
| <map headset>
| }
| pcm.bar {
| type route
| slave.pcm "bar"
| <map channels card out -> hs in>
| <map channels card in -> hs out>
| }
|
| hope the idea is understandable
|
|
http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html#pcm_plugins_route

|
|
| but I guess this won't work
|

why not, it looks as it should. But I don't know much about alsa routing...

|> You could write something similar that runs in userspace and copies
|> audio streams around using sco.
|
| C hacking? ;) well, if there is really no other way, i could
| try it. Are there some docs around to dig in or just the btsco
| sources?

I think the btsco kernel module does nearly what you are looking for
(only in kernelspace). It takes an sco socket, reads the data and writes
it to the alsa buffer and vice versa. Of course you would write it to an
alsa device, not the internal buffer :)

Should be possible to rip it apart and run it as a userspace program,
dropping all kernel stuff and keeping mostly the thread that does the
copy stuff.

You can also have a look at the btsco command line daemon that does the
connection handling. A combination of both should do what you want.
Maybe *g*

good luck, and make sure to re-destribute your sources, as it will be
quite interesting for us I think :)

best regards,
~ Lars

- --
Lars Grunewaldt
* software development
* multimedia design
skills: C/C++/Java/PHP/(X)HTML/Flash/audio/video
web: http://www.dark-reality.de
mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB+OPCQWC6DTWkDAoRAp2zAJ9HE8vvVjbySeMS8UogZWmzMrnOeACfTugy
P/hZxd03QggSTK5mOBDUPHo=
=73yZ
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-01-28 02:47:40

by Collin R. Mulliner

[permalink] [raw]
Subject: Re: [Bluez-devel] partly OT: pipe sound from Headset to soundcard

Hi,

I just pipe the output of arecord (alsa recorder) to aplay (alsa
player) ... works ok.

arecord -B 1000000 -D plughw:Headset - | aplay

... Collin

PS: I know this is a very ugly hack :)

On Thu, 27 Jan 2005 22:32:44 +0100
Ben Pezzei <[email protected]> wrote:

> Hi Brad,
>
> Brad Midgley schrieb:
>
> > Your program would be an alsa client, copying from one alsa device
> > to another. No btsco changes at all.
>
> yup, I have written some "prove of concept" proggy which copies
> the mic - stream from the soundcard to the headset-earphone.
> Bad, bad style, but it works (ALSA-API only).
>
> But: To finally manage the other way round (Headset mic to
> soundcard playback) the code should work in some sort of
> Duplex mode.
>
> Since I still think, this whole thing can be accomplished via
> asound.conf and/or jackd (or even some sort of pipe-system),
> I'll ask around if someone has already done this kind of
> setup.
>
> greetings
> ben
>
> PS Is there a problem with mail delivery on this list?
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive
> Reporting Tool for open source databases. Create drag-&-drop reports.
> Save time by over 75%! Publish reports on the web. Export to DOC, XLS,
> RTF, etc. Download a FREE copy at
> http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Bluez-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-devel


--
Collin R. Mulliner <[email protected]>
BETAVERSiON Systems [http://www.betaversion.net]
info/pgp: finger [email protected]
It's a hardware problem!


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-01-27 21:32:44

by Ben Pezzei

[permalink] [raw]
Subject: Re: [Bluez-devel] partly OT: pipe sound from Headset to soundcard

Hi Brad,

Brad Midgley schrieb:

> Your program would be an alsa client, copying from one alsa device to
> another. No btsco changes at all.

yup, I have written some "prove of concept" proggy which copies
the mic - stream from the soundcard to the headset-earphone.
Bad, bad style, but it works (ALSA-API only).

But: To finally manage the other way round (Headset mic to
soundcard playback) the code should work in some sort of
Duplex mode.

Since I still think, this whole thing can be accomplished via
asound.conf and/or jackd (or even some sort of pipe-system),
I'll ask around if someone has already done this kind of
setup.

greetings
ben

PS Is there a problem with mail delivery on this list?




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-01-27 16:17:36

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] partly OT: pipe sound from Headset to soundcard

Your program would be an alsa client, copying from one alsa device to
another. No btsco changes at all.

I don't know enough about how alsa works to know if you could just do it
in asound.conf

Ben Pezzei wrote:
> Hi Brad,
>
> Brad Midgley schrieb:
>
>> I had the same thought.
>>
>> We have a way to send line in to a stereo headset but there is a
>> delay. (see bluetooth-alsa.sf.net)
>
>
> Yeah, but this covers A2DP only, right?
>
> Right now, I was trying to accomplish this via asound.conf:
> something like:
> pcm.foo {
> type multi
> <map soundcard>
> <map headset>
> }
> pcm.bar {
> type route
> slave.pcm "bar"
> <map channels card out -> hs in>
> <map channels card in -> hs out>
> }
>
> hope the idea is understandable
>
> http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html#pcm_plugins_route
>
>
> but I guess this won't work
>
>> You could write something similar that runs in userspace and copies
>> audio streams around using sco.
>
>
> C hacking? ;) well, if there is really no other way, i could
> try it. Are there some docs around to dig in or just the btsco
> sources?
>
> greetings
> ben
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Bluez-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-devel


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-01-26 23:54:17

by Ben Pezzei

[permalink] [raw]
Subject: Re: [Bluez-devel] partly OT: pipe sound from Headset to soundcard

Hi Brad,

Brad Midgley schrieb:
> I had the same thought.
>
> We have a way to send line in to a stereo headset but there is a delay.
> (see bluetooth-alsa.sf.net)

Yeah, but this covers A2DP only, right?

Right now, I was trying to accomplish this via asound.conf:
something like:
pcm.foo {
type multi
<map soundcard>
<map headset>
}
pcm.bar {
type route
slave.pcm "bar"
<map channels card out -> hs in>
<map channels card in -> hs out>
}

hope the idea is understandable

http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html#pcm_plugins_route

but I guess this won't work

> You could write something similar that runs in userspace and copies
> audio streams around using sco.

C hacking? ;) well, if there is really no other way, i could
try it. Are there some docs around to dig in or just the btsco
sources?

greetings
ben






-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-01-26 17:25:08

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] partly OT: pipe sound from Headset to soundcard

Ben

I had the same thought.

We have a way to send line in to a stereo headset but there is a delay.
(see bluetooth-alsa.sf.net)

You could write something similar that runs in userspace and copies
audio streams around using sco.

Brad

Ben Pezzei wrote:
> Hi again,
>
> Apologies if my question is a bit OT, but no one on the alsa
> list had an answer for this one:
>
> I try to pipe the sound from the headset to line in of the
> soundcard. something like:
> /dev/snd/pcmC1D0c -> /dev/snd/pcmC0D0p
> and vice versa:
> /dev/snd/pcmC0D0c -> /dev/snd/pcmC1D0p
>
> So everything which comes through the soundcard mic should
> be "forwarded" to the headset earphone, and everything
> which comes from the headset mic should land at the
> soundcards line in.
>
> is there a way to accomplish this?
>
> any hint would be great
>
> greetings
> ben
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Bluez-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-devel


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel