Skip to contentSkip to conversation

Configuration Spaces

DISCUSSION Chuck Winters 2 participants 8 messages Sep 16, 2002 – Sep 17, 2002

lore
Share & tools
lore
#0 lore raw

Hello,
I am trying to get a good understanding of how the alsa-lib works, and I had
a couple of questions:
1) Is the configuration space specific to each device, or each opened stream?
2) Maybe it's terminology I'm stuck on, but could someone explain the use of masks?

Thanks for the time,
Chuck

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#1 lore raw
Quoted 2 lines

1) Is the configuration space specific to each device, or each opened s
tream?

each open stream. obviously, its related to the underlying physical device, but you're semantically operation on one stream.

--p

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#2 lore raw

Thanks.

One other question. This may be stupid, but here goes.

My knowledge of signals is that the period is the time it takes a signal to complete 1 cycle. So what is the snd_pcm_hw_params_set_period used for? Is the "period" a property of the signal, or an arbitrary property set by the programmer for performance, fidelity, etc.

Thanks,
Chuck

Quoted 11 lines · Paul Davis
Quoted 2 lines

1) Is the configuration space specific to each device, or each opened s
tream?

each open stream. obviously, its related to the underlying physical device, but you're semantically operation on one stream.

--p

Quoted 8 lines

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

-------------------------------------------------------
Sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664 http://www.developwithamd.com/developerlab

#3 lore raw
Quoted 4 lines

My knowledge of signals is that the period is the time it takes a signal to complete 1 cycle. So what is the snd_pcm_hw_params_set_period used for? Is the "period" a property of the signal, or an arbitrary property set by the programmer for performance, fidelity, etc.

no, a period in ALSA is, put relatively simply, the interval between interrupts from the audio interface. it defines the latency for audio handling.

if you set the buffer size to 256 frames, and the period size to 64 frames, there will be 4 interrupts per iteration over the buffer:
every time the card has 64 frames of audio or space in the buffer, it will interrupt the CPU.

for background on how an audio interface works and some perspectives on programming with ALSA, check out

    http://www.op.net/~pbd/alsa-audio.html

--p

-------------------------------------------------------
Sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664 http://www.developwithamd.com/developerlab

#4 lore raw

Thanks for the great reply. I got my test pgms working for capture and playback.

I am now trying to get working with full duplex. There seem to be many problems with it though. Do you have any tips/tricks on programming with full duplex operation?

Thanks Again,
Chuck

Quoted 22 lines · Paul Davis
Quoted 4 lines

My knowledge of signals is that the period is the time it takes a signal to complete 1 cycle. So what is the snd_pcm_hw_params_set_period used for? Is the "period" a property of the signal, or an arbitrary property set by the programmer for performance, fidelity, etc.

no, a period in ALSA is, put relatively simply, the interval between interrupts from the audio interface. it defines the latency for audio handling.

if you set the buffer size to 256 frames, and the period size to 64 frames, there will be 4 interrupts per iteration over the buffer:
every time the card has 64 frames of audio or space in the buffer, it will interrupt the CPU.

for background on how an audio interface works and some perspectives on programming with ALSA, check out

    http://www.op.net/~pbd/alsa-audio.html

--p

Quoted 8 lines

-------------------------------------------------------
Sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664 http://www.developwithamd.com/developerlab
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab

#5 lore raw
Quoted 7 lines

Thanks for the great reply. I got my test pgms working for capture and playba ck.

I am now trying to get working with full duplex. There seem to be many proble ms
with it though. Do you have any tips/tricks on programming with full duplex operation?

the examples in the URL i included both work.

personally, as i've said over and over again, i don't see any point in people trying to do this over and over again. why not just use JACK? JACK represents everything i (and a few other people) know about ALSA programming. its complex, efficient, and useful.

--p

-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab

#6 lore raw
Quoted 11 lines
Quoted 1 line

Thanks for the great reply. I got my test pgms working for capture and playb

a

Quoted 3 lines

ck.

I am now trying to get working with full duplex. There seem to be many probl

e

Quoted 3 lines

ms
with it though. Do you have any tips/tricks on programming with full duplex operation?

the examples in the URL i included both work.

oops. sorry. i forget that i removed the non-interrupt driven full duplex example in the last iteration of the document.

--p

-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab

#7 lore raw
In reply to Paul Davis

Thanks,

Quoted 8 lines · Paul Davis
Quoted 7 lines

Thanks for the great reply. I got my test pgms working for capture and playba ck.

I am now trying to get working with full duplex. There seem to be many proble ms
with it though. Do you have any tips/tricks on programming with full duplex operation?

Quoted 4 lines

the examples in the URL i included both work.

personally, as i've said over and over again, i don't see any point in people trying to do this over and over again. why not just use JACK?

to learn :)

Quoted 6 lines

JACK represents everything i (and a few other people) know about ALSA programming. its complex, efficient, and useful.

--p

Quoted 9 lines

-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Chuck

-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts on Hammer Technology! Open Source & Linux Developers, register now for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab