* Converting OSS ioctl's to ALSA API
@ 2005-09-06 0:49 Bob Ingraham
2005-09-06 7:53 ` Clemens Ladisch
0 siblings, 1 reply; 5+ messages in thread
From: Bob Ingraham @ 2005-09-06 0:49 UTC (permalink / raw)
To: alsa-devel
Hello,
I'm converting the audio subroutines of a video-conferencing application
from using OSS to using ALSA. This app uses the blocking-read/write
model.
I've read through all of the documentation I could find, but am not sure
how to convert some of the more "advanced" OSS ioctl's directly to ALSA
Library API calls.
For example, what would be the equivalent of the OSS SNDCTL_DSP_SYNC
ioctl? The previous programmer used this to wait for playback completion.
Another example would be the equivalent of the SNDCLT_DSP_GETOSPACE,
SNDCTL_DSP_GETISPACE and SNDCTL_DSP_SETFRAGMENT ioctls.
BTW, in case anyone mentions it, we don't want to use the OSS emulation
mode, as it hasn't worked-out for us.
Any help would be most appreciated.
Thanks,
Bob
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Converting OSS ioctl's to ALSA API
2005-09-06 0:49 Converting OSS ioctl's to ALSA API Bob Ingraham
@ 2005-09-06 7:53 ` Clemens Ladisch
2005-09-07 17:09 ` Bob Ingraham
0 siblings, 1 reply; 5+ messages in thread
From: Clemens Ladisch @ 2005-09-06 7:53 UTC (permalink / raw)
To: Bob Ingraham; +Cc: alsa-devel
Bob Ingraham wrote:
> what would be the equivalent of the OSS SNDCTL_DSP_SYNC ioctl?
snd_pcm_drain()
> SNDCTL_DSP_SETFRAGMENT
snd_pcm_hw_params_set_period_size()
snd_pcm_hw_params_set_periods()
> SNDCLT_DSP_GETOSPACE, SNDCTL_DSP_GETISPACE
snd_pcm_avail_update()
HTH
Clemens
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Converting OSS ioctl's to ALSA API
2005-09-06 7:53 ` Clemens Ladisch
@ 2005-09-07 17:09 ` Bob Ingraham
2005-09-07 22:29 ` James Courtier-Dutton
0 siblings, 1 reply; 5+ messages in thread
From: Bob Ingraham @ 2005-09-07 17:09 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: alsa-devel
Thank-you so much for ioctl mapping!
May I ask one other architectural question?
This video-conferencing app expected to use two half-duplex devices for
simultaneous record-playback:
/dev/dsp0 and /dev/dsp1 - these were expected to be configured as the
separate playback and record channels of a single soundcard.
However, on all of our target platforms (all running
SuSE/Novell-Linux-Desktop,) there only appears to be a single, full-duplex
device to use (plugwh:0,0) for both record and playback.
So the (three-part) question is:
1. Do I:
(a) Try to re-write this app to use full-duplex? or,
(b) Can I re-configure ALSA to split the default device (plughw:0,0)
into two separate, half-duplex sub-devices (one for playback and one for
record?
2. Which approach makes more sense (i.e., more stable, reliable, etc.)?
3. If 1a is the way to go, is there a tutorial or sample-doc on how to
properly program full-duplex (simultaneous record & playback) operation
under ALSA?
Thanks,
Bob
> Bob Ingraham wrote:
>> what would be the equivalent of the OSS SNDCTL_DSP_SYNC ioctl?
>
> snd_pcm_drain()
>
>> SNDCTL_DSP_SETFRAGMENT
>
> snd_pcm_hw_params_set_period_size()
> snd_pcm_hw_params_set_periods()
>
>> SNDCLT_DSP_GETOSPACE, SNDCTL_DSP_GETISPACE
>
> snd_pcm_avail_update()
>
>
> HTH
> Clemens
>
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Converting OSS ioctl's to ALSA API
2005-09-07 17:09 ` Bob Ingraham
@ 2005-09-07 22:29 ` James Courtier-Dutton
2005-09-08 12:54 ` Clemens Ladisch
0 siblings, 1 reply; 5+ messages in thread
From: James Courtier-Dutton @ 2005-09-07 22:29 UTC (permalink / raw)
To: Bob Ingraham; +Cc: Clemens Ladisch, alsa-devel
Bob Ingraham wrote:
>Thank-you so much for ioctl mapping!
>
>May I ask one other architectural question?
>
>This video-conferencing app expected to use two half-duplex devices for
>simultaneous record-playback:
>
>/dev/dsp0 and /dev/dsp1 - these were expected to be configured as the
>separate playback and record channels of a single soundcard.
>
>However, on all of our target platforms (all running
>SuSE/Novell-Linux-Desktop,) there only appears to be a single, full-duplex
>device to use (plugwh:0,0) for both record and playback.
>
>So the (three-part) question is:
>
>1. Do I:
>
> (a) Try to re-write this app to use full-duplex? or,
>
> (b) Can I re-configure ALSA to split the default device (plughw:0,0)
>into two separate, half-duplex sub-devices (one for playback and one for
>record?
>
>
>2. Which approach makes more sense (i.e., more stable, reliable, etc.)?
>
>
>3. If 1a is the way to go, is there a tutorial or sample-doc on how to
>properly program full-duplex (simultaneous record & playback) operation
>under ALSA?
>
>
>Thanks,
>Bob
>
>
ALSA provides an abstraction layer.
If you open plughw:0,0 for only playback, and then again for only
capture it should work.
So, although the device name looks the same, device names for playback
and capture are in fact in a different name space.
alsa-lib does all the difficult work for you.
Another alternative could be to use jackd. It is ideal for low latency
applications, and VoIP is certainly ideal for that.
James
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Converting OSS ioctl's to ALSA API
2005-09-07 22:29 ` James Courtier-Dutton
@ 2005-09-08 12:54 ` Clemens Ladisch
0 siblings, 0 replies; 5+ messages in thread
From: Clemens Ladisch @ 2005-09-08 12:54 UTC (permalink / raw)
To: James Courtier-Dutton; +Cc: Bob Ingraham, alsa-devel
James Courtier-Dutton wrote:
> If you open plughw:0,0 for only playback, and then again for only
> capture it should work.
It should be noted that this is the _only_ way you can use such a
device, as snd_pcm_open() opens only one direction at a time.
Your application just shouldn't care if the playback and capture
devices happen to have the same name.
HTH
Clemens
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-09-08 12:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-06 0:49 Converting OSS ioctl's to ALSA API Bob Ingraham
2005-09-06 7:53 ` Clemens Ladisch
2005-09-07 17:09 ` Bob Ingraham
2005-09-07 22:29 ` James Courtier-Dutton
2005-09-08 12:54 ` Clemens Ladisch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.