Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(numberOfChannels): AudioDestinationNode.numberOfChannels #112

Closed
olivierthereaux opened this issue Sep 11, 2013 · 8 comments
Closed

(numberOfChannels): AudioDestinationNode.numberOfChannels #112

olivierthereaux opened this issue Sep 11, 2013 · 8 comments

Comments

@olivierthereaux
Copy link
Contributor

Originally reported on W3C Bugzilla ISSUE-17396 Tue, 05 Jun 2012 12:17:06 GMT
Reported by Michael[tm] Smith
Assigned to

Audio-ISSUE-33 (numberOfChannels): AudioDestinationNode.numberOfChannels [Web Audio API]

http://www.w3.org/2011/audio/track/issues/33

Raised by: Philip Jägenstedt
On product: Web Audio API

It's not defined what numberOfChannels means, is it a constant value that depends on the underlying hardware or the maximum number of channels of all the inputs?

More importantly, what is the use case for exposing this information?

@olivierthereaux
Copy link
Contributor Author

Original comment by Olivier Thereaux on W3C Bugzilla. Thu, 07 Jun 2012 08:17:21 GMT

[admin] Assigning items currently being worked on by editor.

@olivierthereaux
Copy link
Contributor Author

Original comment by Olivier Thereaux on W3C Bugzilla. Thu, 07 Jun 2012 14:20:33 GMT

From the Editor: Change Set: https://dvcs.w3.org/hg/audio/rev/90e55985e260

Feedback given in http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0430.html
«
As Marcus pointed out in http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0355.html, maxNumberOfChannels doesn't seem to really work and an array of values would make more sense.

We don't think that setting numberOfChannels to a configuration that isn't supported should throw an exception, since that's likely to result in unhandled exceptions when authors have only tested with one speaker configuration. For example, it's to be expected that authors will set numberOfChannels to 2 without checking maxNumberOfChannels, which will fail on smartphones with a single speaker. Instead, we think that the requested number of channels should be used and mixing should be applied if the hardware doesn't support it.

Note also the typo in "If this value is 0, then this indicates that maxNumberOfChannels" which should be numberOfChannels.
»

@olivierthereaux
Copy link
Contributor Author

Original comment by Olivier Thereaux on W3C Bugzilla. Wed, 24 Oct 2012 09:03:39 GMT

(In reply to comment #2)

As Marcus pointed out in
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0355.html,
maxNumberOfChannels doesn't seem to really work and an array of values would
make more sense.

Would the proposed resolution of Bug #17379 resolve this as well?
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17379#c2

@olivierthereaux
Copy link
Contributor Author

Original comment by Wei James on W3C Bugzilla. Wed, 24 Oct 2012 10:20:56 GMT

(In reply to comment #3)

(In reply to comment #2)

As Marcus pointed out in
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0355.html,
maxNumberOfChannels doesn't seem to really work and an array of values would
make more sense.

Would the proposed resolution of Bug #17379 resolve this as well?
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17379#c2

the proposal in Bug #17379 seems only resolve the naming issue of channel layout.
there are still two issues here:

  1. using maxNumberOfChannel or using an array of layout. I think current spec using maxNumberOfChannel is reasonable.
  2. Exception handling. (automatic down/up mixing or throw exception?). I prefer to automatic mixing.

@olivierthereaux
Copy link
Contributor Author

Original comment by Marcus Geelnard (Opera) on W3C Bugzilla. Wed, 24 Oct 2012 14:32:12 GMT

(In reply to comment #4)

  1. using maxNumberOfChannel or using an array of layout. I think current
    spec using maxNumberOfChannel is reasonable.

As long as the specification is clearer about what should happen when setting numberOfChannels to an unsupported number of channels. For instance: if the supported channel counts are 2 and 6, then maxNumberOfChannels should return 6, but what must happen if you set numberOfChannels to 1, 3, 4 or 5?

And I still believe that there must be a better way to signal "read only" than to have '0' as a magic constant. In fact, "read only" only means that there is a single allowed configuration (e.g. 2 for a stereo only context).

  1. Exception handling. (automatic down/up mixing or throw exception?). I
    prefer to automatic mixing.

Dito.

@olivierthereaux
Copy link
Contributor Author

Original comment by Ralph Giles on W3C Bugzilla. Wed, 16 Jan 2013 01:01:01 GMT

I'm also really unclear on this. The current draft includes some downmix matricies, but doesn't say when they are to be used.

Mapping to a smaller number of output channels inside an AudioDestinationNode is the only obvious place I see, but this is difficult to apply consistently since surround playback is often supported on systems without multichannel playback hardware, with the OS doing its own downmixing. In other words, when "downmixing should be supported" which software layer should be doing the supporting?

If setting numberOfChannels asks AudioDestinationNode to up/down mix to a particular number of output channels (ignoring what the lower layers might do with this) how do we set it pass-through?

Should maxNumberOfChannels change in response to configuration changes?

@olivierthereaux
Copy link
Contributor Author

Original comment by Chris Rogers on W3C Bugzilla. Wed, 16 Jan 2013 01:11:57 GMT

(In reply to comment #6)

I'm also really unclear on this. The current draft includes some downmix
matricies, but doesn't say when they are to be used.

Mapping to a smaller number of output channels inside an
AudioDestinationNode is the only obvious place I see, but this is difficult
to apply consistently since surround playback is often supported on systems
without multichannel playback hardware, with the OS doing its own
downmixing. In other words, when "downmixing should be supported" which
software layer should be doing the supporting?

If setting numberOfChannels asks AudioDestinationNode to up/down mix to a
particular number of output channels (ignoring what the lower layers might
do with this) how do we set it pass-through?

Should maxNumberOfChannels change in response to configuration changes?

(for what it's worth this hasn't yet been implemented in WebKit)

Robert and I have been discussing this but don't have all the answers yet. Robert suggests that the up/down mixing would be a property of each node, which could make sense. We've also discussed the idea of a way to query the AudioContext for the hardware channel layout, in addition to just the raw number of channels (.maxNumberOfChannels). Then we would allow the JS code to configure the up/down mixing behavior as it wishes, perhaps using the hardware channel layout information. Robert, can jump in if I've misunderstood.

@cwilso
Copy link
Contributor

cwilso commented Oct 29, 2014

I believe this is now well-defined by the upmixing/downmixing section.

@cwilso cwilso closed this as completed Oct 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants