* questions about card detection
@ 2003-08-29 9:04 Joshua Haberman
2003-08-29 9:37 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Joshua Haberman @ 2003-08-29 9:04 UTC (permalink / raw)
To: alsa-devel
Two questions.
First: Is it possible to determine the maximum number of channels for a
sound card that is in use by another application? My method for
detecting the number of channels is:
- open the pcm
- use the hw_params API to determine the number of channels
But if another application has the sound card open, it cannot be opened
again and therefore the hw_params API cannot be used!
Second question: what is the meaning and intended use of the
card,device,subdevice design of ALSA? I thought this would become clear
to be once I bought a multichannel card, but now I own an Audiophile
2496 and it's still a mystery.
"Card" I understand -- I can hold a card in my hand. But what is a
"device" and a "subdevice?" When are they ever used, and how?
Josh
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: questions about card detection
2003-08-29 9:04 questions about card detection Joshua Haberman
@ 2003-08-29 9:37 ` Takashi Iwai
2003-08-29 10:31 ` holborn
0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2003-08-29 9:37 UTC (permalink / raw)
To: Joshua Haberman; +Cc: alsa-devel
At 29 Aug 2003 02:04:24 -0700,
Joshua Haberman wrote:
>
> Two questions.
>
> First: Is it possible to determine the maximum number of channels for a
> sound card that is in use by another application? My method for
> detecting the number of channels is:
>
> - open the pcm
> - use the hw_params API to determine the number of channels
>
> But if another application has the sound card open, it cannot be opened
> again and therefore the hw_params API cannot be used!
hmm, i think there is no "safe" way about this.
maybe it would be nice to have a read-only query functions.
> Second question: what is the meaning and intended use of the
> card,device,subdevice design of ALSA? I thought this would become clear
> to be once I bought a multichannel card, but now I own an Audiophile
> 2496 and it's still a mystery.
>
> "Card" I understand -- I can hold a card in my hand. But what is a
> "device" and a "subdevice?" When are they ever used, and how?
"device" corresponds to a gate-way to access to the card.
in the driver level, each device has a device file (pcmCxDx[pc]).
usually each device reprenents different type of PCM streams.
a device contains one or more subdevices.
"sub-device" is the lowest level of PCM abstration.
an actual PCM stream is always assigned to a sub-stream.
the sub-device is introduced to represent the cases like
multi-playback function. for example, SB Live can play 32 stereo
streams at the same time. in the ALSA, the driver assigns 32
sub-devices (sub-streams) to a playback device.
in the case of envy24, there are only one subdevice, because it's a
multi-channel card but not a multi-stream card.
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: questions about card detection
2003-08-29 9:37 ` Takashi Iwai
@ 2003-08-29 10:31 ` holborn
2003-08-29 11:13 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: holborn @ 2003-08-29 10:31 UTC (permalink / raw)
To: alsa-devel
On Viernes, 29 de Agosto de 2003 10:37, Takashi Iwai wrote:
Hi!
> "sub-device" is the lowest level of PCM abstration.
> an actual PCM stream is always assigned to a sub-stream.
>
> the sub-device is introduced to represent the cases like
> multi-playback function. for example, SB Live can play 32 stereo
> streams at the same time. in the ALSA, the driver assigns 32
> sub-devices (sub-streams) to a playback device.
Are this sub-devices used by the internal SB Live synthesizer?
Or if that is not true, anyway to assign the sound of the different Midi
Channels to that sub-devices in a way to apply LADSPA effects?
Thanks
Josep
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: questions about card detection
2003-08-29 10:31 ` holborn
@ 2003-08-29 11:13 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2003-08-29 11:13 UTC (permalink / raw)
To: holborn; +Cc: alsa-devel
At Fri, 29 Aug 2003 11:31:35 +0100,
holborn wrote:
>
> On Viernes, 29 de Agosto de 2003 10:37, Takashi Iwai wrote:
>
> Hi!
>
>
> > "sub-device" is the lowest level of PCM abstration.
> > an actual PCM stream is always assigned to a sub-stream.
> >
> > the sub-device is introduced to represent the cases like
> > multi-playback function. for example, SB Live can play 32 stereo
> > streams at the same time. in the ALSA, the driver assigns 32
> > sub-devices (sub-streams) to a playback device.
>
> Are this sub-devices used by the internal SB Live synthesizer?
well, not directly.
on emu10k1, PCM streams and WaveTable synth voices are identical.
(so, indeed, you can even change the pitch, apply LFO, lowpass filter,
etc. to PCM streams in real-time (in theory :) )
WaveTable synth allocates the voices dynamically. it looks for an
empty (hardware) stream and assigns it for the MIDI voice. after the
voice is released (i.e. tone is finished), the stream is released
again for free.
usually, PCM looks for the empty pair of stereo slots to assign the
PCM substream automatically. thus, using WaveTable at the same time
would influence on the substream number to be assigned at the open
time.
note that the WaveTable has lower priority than PCM. if all hardware
streams are in use, PCM tries to stop WaveTable voices until a pair of
stereo streams becomes available.
> Or if that is not true, anyway to assign the sound of the different Midi
> Channels to that sub-devices in a way to apply LADSPA effects?
no. the MIDI wavetable is hardware only. there is no feedback to
apply effects on the fly.
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-08-29 11:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-29 9:04 questions about card detection Joshua Haberman
2003-08-29 9:37 ` Takashi Iwai
2003-08-29 10:31 ` holborn
2003-08-29 11:13 ` Takashi Iwai
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.