All of lore.kernel.org
 help / color / mirror / Atom feed
* pcm parameters, digital output ...
@ 2006-03-29 11:34 Johannes Berg
  2006-03-30 14:51 ` Jaroslav Kysela
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2006-03-29 11:34 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 3207 bytes --]

On Mon, 2006-03-27 at 17:37 +0200, Takashi Iwai wrote:

> It's hard to restrict parameters on demands (although theoretically
> it's possible).  We usually provide two different devices, one for
> the normal i/o and another for the digital i/o, to avoid such
> conflicts.
> 
> The apps that send to the digital data would choose "spdif" or
> whatever appropriate PCM name, and the system will reroute it.

I thought about this a bit more now...

Just FYI, the codec chip I'm working against is capable of generating
digital out and analog out at the same time, so I'd rather not create
two PCMs because then you'd have the problem that for one, only one of
the two can be active at the same time, and secondly, when the analog
output is active, the same data can also go out of the spdif port. Which
is a bit icky, and definitely hard to understand. Hence, I'd rather not
create extra streams for this.

I've been browsing the source for this and have a few questions:

What is the point in having "Con Mask", "Pro Mask" and just "Mask"?
Doesn't "Mask" subsume the other two, and in the "Pro Mask" the consumer
mode bit cannot be set (which ac97 seems to still allow...)? Just has me
puzzled.
Anyway, that isn't really the point.

Looking at the ac97 api, it specifies the SPDIF controls as part of the
mixer. Shouldn't those rather be tied to a specific PCM?

I think that there isn't much we can do without breaking everything. I
think it'd probably be best to add a new "pcm" format for the compressed
data. The current ac3play is using 16bit signed little endian pcm data
(SND_PCM_FORMAT_S16_LE), which is not really what it is sending, it
isn't sending PCM data at all.
Something like SND_PCM_FORMAT_SPDIF_NONPCM would be fine. Then
applications would use that to announce that they're sending non-pcm
data down the 'pcm' device...

Now note that there's a problem with old applications: using
SND_PCM_FORMAT_S16_LE they would, after adding
SND_PCM_FORMAT_SPDIF_NONPCM, assert that they are indeed sending PCM
data, which my driver would actually allow the user o play on the analog
output then, if it relies on he application telling the truth using
SND_PCM_FORMAT_SPDIF_NONPCM. But I don't think there's any better
choice.

If I were to rewrite this (as you hinted an another mail), I'd rename
the 'pcm' devices to 'datapump' devices and make the format parameter
actually two related parameters: data type (pcm/non-pcm), and data
format (word size etc.), where the data format is a sub-type of the data
type so to speak.
Note that currently, the only non-pcm data types would be U16_LE and
U16_BE (if the hardware does byteswaps), so it might be sufficient to
define SND_DATA_FORMAT_NONPCM_16_LE and SND_DATA_FORMAT_NONPCM_16_BE
(signedness isn't relevant in this case), and keep the current
SND_PCM_FORMAT_S16_LE as SND_DATA_FORMAT_PCM_S16_LE in the same format
parameter.

However, then the space in the 64 bits of 'format' would be nearing
being used up once some more non-pcm formats are defined, though that
should only be relevant for future hardware since the spdif bitstream is
defined via the spdif mask controls.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

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

end of thread, other threads:[~2006-03-31 11:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-29 11:34 pcm parameters, digital output Johannes Berg
2006-03-30 14:51 ` Jaroslav Kysela
2006-03-30 15:06   ` Johannes Berg
2006-03-31 10:47     ` Jaroslav Kysela
2006-03-31 10:55       ` Johannes Berg
2006-03-31 11:38         ` Jaroslav Kysela
2006-03-31 11:45           ` Johannes Berg

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.