All of lore.kernel.org
 help / color / mirror / Atom feed
* trigger commands
@ 2003-03-23 18:31 Giuliano Pochini
  2003-03-24  9:55 ` Takashi Iwai
  0 siblings, 1 reply; 11+ messages in thread
From: Giuliano Pochini @ 2003-03-23 18:31 UTC (permalink / raw)
  To: alsa-devel

What are PUSH, RELEASE, SUSPEND, RESUME trigger commands supposed to do
?


Bye.




-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trigger commands
  2003-03-23 18:31 trigger commands Giuliano Pochini
@ 2003-03-24  9:55 ` Takashi Iwai
  2003-03-24 10:48   ` Giuliano Pochini
  2003-03-25 17:24   ` pcm interfaces questions Giuliano Pochini
  0 siblings, 2 replies; 11+ messages in thread
From: Takashi Iwai @ 2003-03-24  9:55 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: alsa-devel

At 23 Mar 2003 18:31:04 +0000,
Giuliano Pochini wrote:
> 
> What are PUSH, RELEASE, SUSPEND, RESUME trigger commands supposed to do
> ?

* pcm stream pausing
imagine the pause-button is pushed and released.
these commands are issued only when SNDRV_PCM_INFO_PAUSE is set to
info field of snd_pcm_hardware_t.

- PAUSE_PUSH
	pause the stream
- PAUSE_RELEASE
	restart the paused stream

* power-management
called when the power-management status is changed.
these commands are issued only when SNDRV_PCM_INFO_RESUME is set to
info field of snd_pcm_hardware_t (and of course pm is supported).

- SUSPEND
	suspend the streams; usually identical with STOP command
- RESUME
	resume the streams; usually identical with START command


Takashi


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trigger commands
  2003-03-24  9:55 ` Takashi Iwai
@ 2003-03-24 10:48   ` Giuliano Pochini
  2003-03-24 11:00     ` Takashi Iwai
  2003-03-25 17:24   ` pcm interfaces questions Giuliano Pochini
  1 sibling, 1 reply; 11+ messages in thread
From: Giuliano Pochini @ 2003-03-24 10:48 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel


>> What are PUSH, RELEASE, SUSPEND, RESUME trigger commands supposed to do
>> ?
>
> * pcm stream pausing
> imagine the pause-button is pushed and released.
> these commands are issued only when SNDRV_PCM_INFO_PAUSE is set to
> info field of snd_pcm_hardware_t.
>
> - PAUSE_PUSH
>       pause the stream
> - PAUSE_RELEASE
>       restart the paused stream

Ok, PAUSE_PUSH-->stop() and TRIGGER_STOP-->stop()-and-reset dma
pointer. In my case RELEASE and START are the same thing.


> * power-management
> called when the power-management status is changed.
> these commands are issued only when SNDRV_PCM_INFO_RESUME is set to
> info field of snd_pcm_hardware_t (and of course pm is supported).
>
> - SUSPEND
>       suspend the streams; usually identical with STOP command
> - RESUME
>       resume the streams; usually identical with START command

Way down on the TODO list :)


Tnx.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trigger commands
  2003-03-24 10:48   ` Giuliano Pochini
@ 2003-03-24 11:00     ` Takashi Iwai
  2003-03-24 16:10       ` Giuliano Pochini
  0 siblings, 1 reply; 11+ messages in thread
From: Takashi Iwai @ 2003-03-24 11:00 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: alsa-devel

At Mon, 24 Mar 2003 11:48:50 +0100 (CET),
Giuliano Pochini wrote:
> 
> 
> >> What are PUSH, RELEASE, SUSPEND, RESUME trigger commands supposed to do
> >> ?
> >
> > * pcm stream pausing
> > imagine the pause-button is pushed and released.
> > these commands are issued only when SNDRV_PCM_INFO_PAUSE is set to
> > info field of snd_pcm_hardware_t.
> >
> > - PAUSE_PUSH
> >       pause the stream
> > - PAUSE_RELEASE
> >       restart the paused stream
> 
> Ok, PAUSE_PUSH-->stop() and TRIGGER_STOP-->stop()-and-reset dma
> pointer. In my case RELEASE and START are the same thing.

note that resetting the dma pointer wouldn't be necessary in STOP
trigger (although it may be safer), since the dma pointer will be
reprogrammed anyway by the succeeding call or prepare callback from
the ALSA middle layer.


Takashi


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trigger commands
  2003-03-24 11:00     ` Takashi Iwai
@ 2003-03-24 16:10       ` Giuliano Pochini
  0 siblings, 0 replies; 11+ messages in thread
From: Giuliano Pochini @ 2003-03-24 16:10 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel


On 24-Mar-2003 Takashi Iwai wrote:
>> Ok, PAUSE_PUSH-->stop() and TRIGGER_STOP-->stop()-and-reset dma
>> pointer. In my case RELEASE and START are the same thing.
>
> note that resetting the dma pointer wouldn't be necessary in STOP
> trigger (although it may be safer), since the dma pointer will be
> reprogrammed anyway by the succeeding call or prepare callback from
> the ALSA middle layer.

I didn't know that prepare callback had to reset the dma pointer. That
could explain why sometimes the sound "jerks" when I change track with
xmms and stop/start/prepare are called 2-3 times in a very short time.


Bye.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* pcm interfaces questions
  2003-03-24  9:55 ` Takashi Iwai
  2003-03-24 10:48   ` Giuliano Pochini
@ 2003-03-25 17:24   ` Giuliano Pochini
  2003-03-25 17:51     ` Paul Davis
  2003-03-26  9:32     ` Takashi Iwai
  1 sibling, 2 replies; 11+ messages in thread
From: Giuliano Pochini @ 2003-03-25 17:24 UTC (permalink / raw)
  To: alsa-devel



snd_pcm_new() has two parameters for the number of substreams
for playback and capture. Yes, but what does it mean ? If I
have N playback substreams, can I service N applications that
use one stream ? Can channels be allocated on demand, to allow
the user to use 4 xmms or 1 xmms and a dvd player (5.1) at the
same time ? :)) It's quite useless... I'm just curious.
Also snd_pcm_new() can create multiple pcm interfaces. SP/DIF
and ADAT i/o need a pcm instance too, isn't it ?


Bye.



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: pcm interfaces questions
  2003-03-25 17:24   ` pcm interfaces questions Giuliano Pochini
@ 2003-03-25 17:51     ` Paul Davis
  2003-03-26  9:32     ` Takashi Iwai
  1 sibling, 0 replies; 11+ messages in thread
From: Paul Davis @ 2003-03-25 17:51 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: alsa-devel

>snd_pcm_new() has two parameters for the number of substreams
>for playback and capture. 

its a language problem. its not the number of substreams as in "the
quantity of substreams". rather, it means "the ID of the substream".

>			   Yes, but what does it mean ? If I
>have N playback substreams, can I service N applications that
>use one stream ? Can channels be allocated on demand, to allow
>the user to use 4 xmms or 1 xmms and a dvd player (5.1) at the
>same time ? :))

this depends on (1) whether the underlying hardware supports it and
(2) whether you use a "dmix" PCM device rather than a "hw" PCM
device. the "hw" PCM device only offers the capabilities of the
hardware, nothing more.



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: pcm interfaces questions
  2003-03-25 17:24   ` pcm interfaces questions Giuliano Pochini
  2003-03-25 17:51     ` Paul Davis
@ 2003-03-26  9:32     ` Takashi Iwai
  2003-03-26 14:18       ` Giuliano Pochini
  1 sibling, 1 reply; 11+ messages in thread
From: Takashi Iwai @ 2003-03-26  9:32 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: alsa-devel

At Tue, 25 Mar 2003 18:24:13 +0100 (CET),
Giuliano Pochini wrote:
> 
> snd_pcm_new() has two parameters for the number of substreams
> for playback and capture. Yes, but what does it mean ? If I
> have N playback substreams, can I service N applications that
> use one stream ? Can channels be allocated on demand, to allow
> the user to use 4 xmms or 1 xmms and a dvd player (5.1) at the
> same time ? :)) It's quite useless... I'm just curious.
> Also snd_pcm_new() can create multiple pcm interfaces. SP/DIF
> and ADAT i/o need a pcm instance too, isn't it ?

well, the term "stream" is a bit confusing.

in ALSA, the term "pcm stream" defines the direction of pcm, either
playback or capture.  hence, there are at most two streams per pcm
instance.

the "pcm substreams" belong to each pcm stream.  when you open a pcm
device, one pcm substream will be used at each time.
snd_pcm_new() takes the argument how many pcm substreams are created
for each pcm stream.  you can give more than one here only if the
hardware supports multiple-playback/capture, such as emu10k1.
otherwise, these arguments must be 1 or 0.

for the multiple-playback/capture, each created substream is numbered
from 0 to (N-1).  if you open the pcm without specifying the substream
number, the empty substream is searched and assigned to be opened.  if
you specify the substream number (e.g. "hw:0,0,2"), the specified
substream is tried for open (the substream #2 in the example).

again, if the HARDWARE supports the multiple open, you can play 4 xmms
simultaneously.  if it doesn't, dmix plugin is your friend.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: pcm interfaces questions
  2003-03-26  9:32     ` Takashi Iwai
@ 2003-03-26 14:18       ` Giuliano Pochini
  2003-03-26 15:48         ` Paul Davis
  2003-03-26 20:32         ` Jaroslav Kysela
  0 siblings, 2 replies; 11+ messages in thread
From: Giuliano Pochini @ 2003-03-26 14:18 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel


On 26-Mar-2003 Takashi Iwai wrote:
> the "pcm substreams" belong to each pcm stream.  when you open a pcm
> device, one pcm substream will be used at each time.
> snd_pcm_new() takes the argument how many pcm substreams are created
> for each pcm stream.  you can give more than one here only if the
> hardware supports multiple-playback/capture, such as emu10k1.
> otherwise, these arguments must be 1 or 0.

The hw supports it. My cards has 8 analog outputs that can be used
indipendently or grouped. From inside hw_params callback I have no
way to know which channels the user wants to use. My idea is to tell
snd_pcm_new() to create 8 playback substreams. When an app opens
substream N, C channels wide, I use substream N, and I make
substreams from N+1 to N+C-1 not available.


Bye.



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: pcm interfaces questions
  2003-03-26 14:18       ` Giuliano Pochini
@ 2003-03-26 15:48         ` Paul Davis
  2003-03-26 20:32         ` Jaroslav Kysela
  1 sibling, 0 replies; 11+ messages in thread
From: Paul Davis @ 2003-03-26 15:48 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Takashi Iwai, alsa-devel

>> the "pcm substreams" belong to each pcm stream.  when you open a pcm
>> device, one pcm substream will be used at each time.
>> snd_pcm_new() takes the argument how many pcm substreams are created
>> for each pcm stream.  you can give more than one here only if the
>> hardware supports multiple-playback/capture, such as emu10k1.
>> otherwise, these arguments must be 1 or 0.
>
>The hw supports it. My cards has 8 analog outputs that can be used
>indipendently or grouped. From inside hw_params callback I have no
>way to know which channels the user wants to use. My idea is to tell
>snd_pcm_new() to create 8 playback substreams. When an app opens
>substream N, C channels wide, I use substream N, and I make
>substreams from N+1 to N+C-1 not available.

sorry, i misread your original question. i thought you were asking
about the user of the user-space snd_pcm_open() call, not a driver
side function.

i am not sure this is the best way to do this. i used this approach
with the original hammerfall driver (26 channels), and it got very
unworkable. i found it much better (and more efficient) to create 1
device with the capability to handle up to 26 channels.

your description is a bit confusing as well. when you say the h/w
supports 8 analog outputs, do you mean 8 independent audio streams, or
do you mean 8 synced channels of output? these are very different
things. 

--p


-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: pcm interfaces questions
  2003-03-26 14:18       ` Giuliano Pochini
  2003-03-26 15:48         ` Paul Davis
@ 2003-03-26 20:32         ` Jaroslav Kysela
  1 sibling, 0 replies; 11+ messages in thread
From: Jaroslav Kysela @ 2003-03-26 20:32 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Takashi Iwai, alsa-devel

On Wed, 26 Mar 2003, Giuliano Pochini wrote:

> 
> On 26-Mar-2003 Takashi Iwai wrote:
> > the "pcm substreams" belong to each pcm stream.  when you open a pcm
> > device, one pcm substream will be used at each time.
> > snd_pcm_new() takes the argument how many pcm substreams are created
> > for each pcm stream.  you can give more than one here only if the
> > hardware supports multiple-playback/capture, such as emu10k1.
> > otherwise, these arguments must be 1 or 0.
> 
> The hw supports it. My cards has 8 analog outputs that can be used
> indipendently or grouped. From inside hw_params callback I have no
> way to know which channels the user wants to use. My idea is to tell
> snd_pcm_new() to create 8 playback substreams. When an app opens
> substream N, C channels wide, I use substream N, and I make
> substreams from N+1 to N+C-1 not available.

It's a bit tricky. I'd prefer to allocate different PCM devices for this 
behaviour:

#0 - four stereo substreams
#1 - one 8-channel substream
#2 - eight mono substreams

So the user has always equal substreams.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-03-26 20:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-23 18:31 trigger commands Giuliano Pochini
2003-03-24  9:55 ` Takashi Iwai
2003-03-24 10:48   ` Giuliano Pochini
2003-03-24 11:00     ` Takashi Iwai
2003-03-24 16:10       ` Giuliano Pochini
2003-03-25 17:24   ` pcm interfaces questions Giuliano Pochini
2003-03-25 17:51     ` Paul Davis
2003-03-26  9:32     ` Takashi Iwai
2003-03-26 14:18       ` Giuliano Pochini
2003-03-26 15:48         ` Paul Davis
2003-03-26 20:32         ` Jaroslav Kysela

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.