Skip to contentSkip to conversation

Quick question

DISCUSSION David Stuart 5 participants 7 messages Jun 2, 2003 – Jun 3, 2003

lore
Share & tools
lore
#0 lore raw

Does anyone have a short example of capturing from one device and doing a playback (of the captured data) on another?

Signature · 9 lines
David Stuart, SIPQuest
phone: 254-8886 x234 web: http://www.sipquest.com/



-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
#1 lore raw

Apparently the ALSA community is too busy to answer my little questions, this is the sadly the 3rd or 4th time I has posted to this list with no answer. :(

I don't think my question is too difficult. All I'm asking for is a little help! Either a small snippet or a pointer to some other information.. Maybe my question is too newbie-ish, but you can't develop new experts without said experts being newbies at one time.

Quoted 2 lines · David Stuart

Does anyone have a short example of capturing from one device and doing a playback (of the captured data) on another?

Signature · 9 lines
David Stuart, SIPQuest
phone: 254-8886 x234 web: http://www.sipquest.com/



-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
#2 lore raw
Quoted 4 lines · David Stuart

Apparently the ALSA community is too busy to answer my little questions, this is the sadly the 3rd or 4th time I has posted to this list with no answer. :(

Quoted 12 lines

I don't think my question is too difficult. All I'm asking for is a little help! Either a small snippet or a pointer to some other information.. Maybe my question is too newbie-ish, but you can't develop new experts without said experts being newbies at one time.

Quoted 2 lines · David Stuart

Does anyone have a short example of capturing from one device and doing a playback (of the captured data) on another?

Check out ecasound. It can do this quite easily apparently.

Signature · 16 lines
Patrick Shirkey - Boost Hardware Ltd.
Http://www.boosthardware.com
Http://www.djcj.org - The Linux Audio Users guide
========================================

Being on stage with the band in front of crowds shouting, "Get off! No! We want normal music!", I think that was more like acting than anything I've ever done.

Goldie, 8 Nov, 2002
The Scotsman



-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
#3 lore raw
In reply to David Stuart
Quoted 4 lines

I don't think my question is too difficult. All I'm asking for is a little help! Either a small snippet or a pointer to some other information.. Maybe my question is too newbie-ish, but you can't develop new experts without said experts being newbies at one time.

its not a little question. its something that is not done very often at all. in fact, i don't know of a single piece of code that does it, although theoretically the most recent version of JACK could do so, since it allows different PCM device names for playback and capture. its hardly a "simple example" however.

its also very unclear what you want help with. there is nothing particularly different about capture and playback on 2 devices compared to doing it on just 1.

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5

#4 lore raw
In reply to David Stuart

Well, I would have answered your question, but I personally don't have the answers you seek. For starters, I wouldn't use alsa for doing such things. I'd use Jack. <http://jackit.sf.net/> It's so much more flexible, powerful and easier to code for than straight alsa.

Having said that, your question involved using TWO devices, which I believe jack doesn't really support unless you're "bonding" them a la your .asoundrc file. (and even then, you'd really want to syncronize their clocks which most, if not all, consumer products don't support.) Assuming you don't care about clock synchronization, you could follow the examples at <http://www.suse.de/~mana/alsa090_howto.html>. Just open up one device for capture and the other for playback. When you receive data from one, pass it to the other.

(and reading Paul's recent post on jack, apparently you can do what you want to do with jack.)

d!

Quoted 13 lines · David Stuart

Apparently the ALSA community is too busy to answer my little questions, this is the sadly the 3rd or 4th time I has posted to this list with no answer. :(

I don't think my question is too difficult. All I'm asking for is a little help! Either a small snippet or a pointer to some other information.. Maybe my question is too newbie-ish, but you can't develop new experts without said experts being newbies at one time.

Quoted 2 lines · David Stuart

Does anyone have a short example of capturing from one device and doing a playback (of the captured data) on another?

#5 lore raw

Ah! I do exist! :)

Perhaps a better description of what I'm trying to do is in order. I don't know if anyone here is familiar with JMF (java media framework), but I would like to create an ALSA capture plugin on Linux very similar to the "direct sound" one that's available on the Windows platform.

When I said that I would like to capture and then playback on TWO devices, in reality they will probably be always the SAME device (in full duplex mode). Hopefully that makes the problem easier. This small test program was my way of getting started.

I realize that JACK is probably the wave of the future in this respect, but I was thinking of using ALSA because:

1) It's relatively easy to install (from rpms anyway)
2) One does not have to tinker too much with a default RedHat (our "tested" distro) installation to use ALSA.
3) It has good full-duplex support, as opposed to the default OSS setup.
4) JACK is the future, but not yet the present (seems to me)

Although I admittedly haven't tried JACK yet, I was suspecting that using ALSA directly would require our customers to do less customization of their default RedHat installation than installing ALSA + JACK. I need to keep the procedure simple because we will have to support them.

Quoted 8 lines · David E. Storey

Having said that, your question involved using TWO devices, which I believe jack doesn't really support unless you're "bonding" them a la your .asoundrc file. (and even then, you'd really want to syncronize their clocks which most, if not all, consumer products don't support.) Assuming you don't care about clock synchronization, you could follow the examples at <http://www.suse.de/~mana/alsa090_howto.html>. Just open up one device for capture and the other for playback. When you receive data from one, pass it to the other.

Hmm .. I did find this HOWTO once before (and a few others), and tried to follow them, but I must be doing something wrong because I can't get more than a few pops out of my playback device. I was hoping that someone could either tell me what I was doing wrong in my program, or provide a small working example that I could use to learn from..

Signature · 9 lines
David Stuart, SIPQuest
phone: 254-8886 x234 web: http://www.sipquest.com/



-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
#6 lore raw
Quoted 13 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of David Stuart
Sent: Tuesday, June 03, 2003 6:53 AM
To: David E. Storey
Cc: alsa
Subject: Re: [Alsa-devel] Quick question

Ah! I do exist! :)

<SNIP>

Quoted 6 lines

1) It's relatively easy to install (from rpms anyway)
2) One does not have to tinker too much with a default RedHat (our "tested" distro) installation to use ALSA.
3) It has good full-duplex support, as opposed to the default OSS setup.
4) JACK is the future, but not yet the present (seems to me)

<SNIP>

Hi,
Since you're on Redhat, you can install Alsa and Jack very easily using the PlanetCCRMA flow in less than an hour. Check it out if you're interested.

Cheers,
Mark

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5