All of lore.kernel.org
 help / color / mirror / Atom feed
* Fixed sampling freq UAC2 doubt
@ 2011-01-21  8:35 Jassi Brar
  2011-01-24 13:21 ` Takashi Iwai
  2011-01-27  8:14 ` Clemens Ladisch
  0 siblings, 2 replies; 4+ messages in thread
From: Jassi Brar @ 2011-01-21  8:35 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai

Hi,

 While testing my under-development generic USB Audio Class 2.0 _gadget_ driver
with ALSA's USB Audio Class driver, I came across an apparent discrepency.
Or so do I think.

Page-98 Section 5.2.5.1.1 of 'Audio 20 final.pdf' specifies :-
[In many cases, the Clock Source Entity represents a crystal
oscillator based generator
 with a single fixed frequency. In that case, the Set request is not supported.]

Here 'not supported' means setup requests for CUR/RANGE CS_SAM_FREQ_CONTROL
should stall. Right ?

The snd_usb_hw_params in sound/usb/pcm.c apparently attempts to do that with
disregard to Clock-Frequency-Control bitmask in bmControls field of the
Clock Source Descriptor.

The confusion is, subs->cur_rate is initialized only if snd_usb_init_sample_rate
succeeds. Which does SET control tranfer, albeit with the supported frequency.
Couldn't a fixed sampling freq UAC2 compliant device refuse to work in
that case,
thereby failing any attempt to use the USB card?

Could someone please point where I got it wrong and/or if such a card
works with ALSA
USB?

Thanks.

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

* Re: Fixed sampling freq UAC2 doubt
  2011-01-21  8:35 Fixed sampling freq UAC2 doubt Jassi Brar
@ 2011-01-24 13:21 ` Takashi Iwai
  2011-01-27  8:14 ` Clemens Ladisch
  1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2011-01-24 13:21 UTC (permalink / raw)
  To: Jassi Brar; +Cc: alsa-devel, Clemens Ladisch, Daniel Mack

Added relevant guys to Cc....

At Fri, 21 Jan 2011 17:35:52 +0900,
Jassi Brar wrote:
> 
> Hi,
> 
>  While testing my under-development generic USB Audio Class 2.0 _gadget_ driver
> with ALSA's USB Audio Class driver, I came across an apparent discrepency.
> Or so do I think.
> 
> Page-98 Section 5.2.5.1.1 of 'Audio 20 final.pdf' specifies :-
> [In many cases, the Clock Source Entity represents a crystal
> oscillator based generator
>  with a single fixed frequency. In that case, the Set request is not supported.]
> 
> Here 'not supported' means setup requests for CUR/RANGE CS_SAM_FREQ_CONTROL
> should stall. Right ?
> 
> The snd_usb_hw_params in sound/usb/pcm.c apparently attempts to do that with
> disregard to Clock-Frequency-Control bitmask in bmControls field of the
> Clock Source Descriptor.
> 
> The confusion is, subs->cur_rate is initialized only if snd_usb_init_sample_rate
> succeeds. Which does SET control tranfer, albeit with the supported frequency.
> Couldn't a fixed sampling freq UAC2 compliant device refuse to work in
> that case,
> thereby failing any attempt to use the USB card?
> 
> Could someone please point where I got it wrong and/or if such a card
> works with ALSA
> USB?
> 
> Thanks.
> 

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

* Re: Fixed sampling freq UAC2 doubt
  2011-01-21  8:35 Fixed sampling freq UAC2 doubt Jassi Brar
  2011-01-24 13:21 ` Takashi Iwai
@ 2011-01-27  8:14 ` Clemens Ladisch
  2011-01-29 11:29   ` Jassi Brar
  1 sibling, 1 reply; 4+ messages in thread
From: Clemens Ladisch @ 2011-01-27  8:14 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Takashi Iwai, alsa-devel, Daniel Mack

Jassi Brar wrote:
>  While testing my under-development generic USB Audio Class 2.0 _gadget_ driver
> with ALSA's USB Audio Class driver, I came across an apparent discrepency.
> Or so do I think.
> 
> Page-98 Section 5.2.5.1.1 of 'Audio 20 final.pdf' specifies :-
> [In many cases, the Clock Source Entity represents a crystal
> oscillator based generator
>  with a single fixed frequency. In that case, the Set request is not supported.]
> 
> Here 'not supported' means setup requests for CUR/RANGE CS_SAM_FREQ_CONTROL
> should stall. Right ?

Strictly speaking, "is not" (instead of "might not be") implies that the
device _must_ stall.

> The snd_usb_hw_params in sound/usb/pcm.c apparently attempts to do that with
> disregard to Clock-Frequency-Control bitmask in bmControls field of the
> Clock Source Descriptor.
> 
> The confusion is, subs->cur_rate is initialized only if snd_usb_init_sample_rate
> succeeds. Which does SET control tranfer, albeit with the supported frequency.
> Couldn't a fixed sampling freq UAC2 compliant device refuse to work in
> that case, thereby failing any attempt to use the USB card?

Yes, it will fail.  This is a bug in the driver.


Regards,
Clemens

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

* Re: Fixed sampling freq UAC2 doubt
  2011-01-27  8:14 ` Clemens Ladisch
@ 2011-01-29 11:29   ` Jassi Brar
  0 siblings, 0 replies; 4+ messages in thread
From: Jassi Brar @ 2011-01-29 11:29 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: Takashi Iwai, alsa-devel, Daniel Mack

On Thu, Jan 27, 2011 at 5:14 PM, Clemens Ladisch <clemens@ladisch.de> wrote:
> Jassi Brar wrote:
>>  While testing my under-development generic USB Audio Class 2.0 _gadget_ driver
>> with ALSA's USB Audio Class driver, I came across an apparent discrepency.
>> Or so do I think.
>>
>> Page-98 Section 5.2.5.1.1 of 'Audio 20 final.pdf' specifies :-
>> [In many cases, the Clock Source Entity represents a crystal
>> oscillator based generator
>>  with a single fixed frequency. In that case, the Set request is not supported.]
>>
>> Here 'not supported' means setup requests for CUR/RANGE CS_SAM_FREQ_CONTROL
>> should stall. Right ?
>
> Strictly speaking, "is not" (instead of "might not be") implies that the
> device _must_ stall.

Ok, though I am still going to allow for 0 and the 'supported' freq to
be SET, because
mine is going to be a virtual 'utility' gadget driver and there is not
much point being too
a purist in such a trivial case.


>> The snd_usb_hw_params in sound/usb/pcm.c apparently attempts to do that with
>> disregard to Clock-Frequency-Control bitmask in bmControls field of the
>> Clock Source Descriptor.
>>
>> The confusion is, subs->cur_rate is initialized only if snd_usb_init_sample_rate
>> succeeds. Which does SET control tranfer, albeit with the supported frequency.
>> Couldn't a fixed sampling freq UAC2 compliant device refuse to work in
>> that case, thereby failing any attempt to use the USB card?
>
> Yes, it will fail.  This is a bug in the driver.

There seems more such situations where the specs are 'overlooked'. I mean
not many fields of the UAC2 descriptors are found to be used.
My employer willing, I would love to work on the UAC-2 host-class
driver as well.

Thanks
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2011-01-29 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-21  8:35 Fixed sampling freq UAC2 doubt Jassi Brar
2011-01-24 13:21 ` Takashi Iwai
2011-01-27  8:14 ` Clemens Ladisch
2011-01-29 11:29   ` Jassi Brar

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.