Skip to contentSkip to conversation

Does it need full-duplex to use snd_pcm_link ?

DISCUSSION Junji Umeno 2 participants 4 messages Sep 15, 2006 – Sep 20, 2006

lore
Share & tools
lore
#0 lore raw

I failed to record with the example code 'latency.c' written in the doxygen manual. When it plays back and records at the same time, using snd_pcm_link, should the hardware be implemented as full-duplex of i/o?
As previous comments pointed in this lists,
some buffer length data are written into a playback handler,
and then reading starts.
They said, it should be needed to have 4096 bytes written in the write buffer. But in my case,
'writei' continues to return EAGAIN if more than 64byte are to be written.

Any comment is welcom.

Signature · 8 lines
UMENO, Junji
ElmicWescom, Inc.

-------------------------------------------------------------------------
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
Quoted 10 lines · On Fri, 15 Sep 2006 14:54:00 +0900 Junji Umeno <[email protected]> wrote:

I failed to record with the example code 'latency.c' written in the doxygen manual. When it plays back and records at the same time, using snd_pcm_link, should the hardware be implemented as full-duplex of i/o?
As previous comments pointed in this lists,
some buffer length data are written into a playback handler,
and then reading starts.
They said, it should be needed to have 4096 bytes written in the write buffer. But in my case,
'writei' continues to return EAGAIN if more than 64byte are to be written.

Quoted 5 lines

Any comment is welcom.

Signature · 2 lines
UMENO, Junji
ElmicWescom, Inc.

Does it depend on the device's read/write buffer size, wchich is set by 'snd_pcm_hw_params_set_rate' ?

Signature · 8 lines
UMENO, Junji
ElmicWescom, Inc.

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

At Fri, 15 Sep 2006 16:33:08 +0900,

Quoted 16 lines · Junji Umeno
Quoted 10 lines · On Fri, 15 Sep 2006 14:54:00 +0900 Junji Umeno <[email protected]> wrote:

I failed to record with the example code 'latency.c' written in the doxygen manual. When it plays back and records at the same time, using snd_pcm_link, should the hardware be implemented as full-duplex of i/o?
As previous comments pointed in this lists,
some buffer length data are written into a playback handler,
and then reading starts.
They said, it should be needed to have 4096 bytes written in the write buffer. But in my case,
'writei' continues to return EAGAIN if more than 64byte are to be written.

Quoted 8 lines
Quoted 5 lines

Any comment is welcom.

Signature · 2 lines
UMENO, Junji
ElmicWescom, Inc.

Does it depend on the device's read/write buffer size, wchich is set by 'snd_pcm_hw_params_set_rate' ?

You man snd_pcm_hw_params_set_buffer_size() ?
Yes, the behavior is releated with buffer and period sizes.

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#3 lore raw
In reply to Junji Umeno

At Fri, 15 Sep 2006 14:54:00 +0900,

Quoted 4 lines · Junji Umeno

I failed to record with the example code 'latency.c' written in the doxygen manual. When it plays back and records at the same time, using snd_pcm_link, should the hardware be implemented as full-duplex of i/o?

snd_pcm_link() itself has nothing to do with full-duplexity. It's a command to link multiple streams. Here, "link" means the streams are triggered at the same time, and take the same clock if possible. For example, you can link two or more playback streams to achieve multi-channels (acatually PCM multi plugin does this internally).

Quoted 6 lines

As previous comments pointed in this lists,
some buffer length data are written into a playback handler,
and then reading starts.
They said, it should be needed to have 4096 bytes written in the write buffer. But in my case,
'writei' continues to return EAGAIN if more than 64byte are to be written.

When EAGAIN is returned, the buffer is still full. It appears to be right behavior to me...

More explanation or code snippet please?

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV