Re: re Zoom R16

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A few things:

First, many of my original posts to the mailing list did not actually end up
on the mailing list!  You can go back through here to see the full history
of how we got to where we are:

http://linux-audio.4202.n7.nabble.com/re-Zoom-R16-td87487.html


Second, we should all be aware that kernels 3.11 and greater have support
for the "ANY INTERFACE" and "AUTODETECT" tags.   For the R16, this means
that this quirk (yes that is the whole thing!) will work for capture only.

/* ZOOM R16 in USB 2.0 mode */
{
        .match_flags = USB_DEVICE_ID_MATCH_VENDOR |
                       USB_DEVICE_ID_MATCH_INT_CLASS,
        .idVendor = 0x1686,
        .bInterfaceClass = USB_CLASS_VENDOR_SPEC,
        .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
                .ifnum = QUIRK_ANY_INTERFACE,
                .type = QUIRK_AUTODETECT
        }
},

If you are after capture only, and are on a kernel >3.11, this is your
quirk.


Third, the problem with playback is (I believe) narrowed down to ALSA not
being able to set set the bit rate.  Until we are able to figure out how to
make ALSA see the R16 as 24-bit integer, everything else is irrelevant.


millerthegorilla wrote
> Notice that I have put a bunch of sample formats so that the correct one
> can be selected.

The R16 does not support 8, 16 or 32... it is only 24 (in interface mode). 
The problem is that none of the 24 bit formats I am aware of WORK.  ALSA has
some kind of problem with the R16 when it comes to initializig it, and
always sets it to 32 bit (or technically 24 in 32) which it does not
support.  It is 24 bit INTEGER meaning exactly 24 bits.  Again, until we can
find a .format that will set the R16 to 24 bits, it will not support
playback.


Fourth, on the subject of  ifnums and ifaces:


millerthegorilla wrote
> Hmm, I have been compiling my kernel for a couple of days now and no joy.
> I have the information from lsusb -vv, cat /proc/asound/R16/stream0 / 1,
> etc but I'm a little confused about the terminology of quirks-table.h.
> What is the difference between .ifnum and .iface?    is the first (ifnum)
> a
> reference to the usb bus?

.ifnum is the hardware interface number, it can be derived from the variable
"bInterfaceNumber" in the output of lsusb -v

Here is the problem....  there is NO interface #4 despite the quirk working
as such.  When I initially was testing quirks for the R16, I just added that
(and #5) as a placeholders on top of the standard audio quirk!  I was as
surprised as everyone when #4 enabled capture.  It is a working hack, but it
is accidental.   To my knowledge, these are the correct interface numbers
and functions:

The correct interfaces are:

0 - device (hardware comm)
1 - PLAYBACK 
2 - CAPTURE
3 - MIDI

If you move your .ifnum=4 section into the .ifnum=2 section (and delete #4)
it will work, and will be in the right place for further testing. 

Similarly, .iface correlates with the iInterface variable that you can also
view in the output of lsusb.  The correct setting is zero, like this:

 .iface = 0,'

I noticed you also changed .attributes to USB_ENDPOINT_XFER_ISOC... any
reason for that?


And finally, here is the THEORETICAL quirk that *should* work for playback,
capture and MIDI.   By all accounts, this *should* work... BUT IT DOES NOT.   
My best guess is that this is indeed the right quirk, but that the .formats
setting of 24 bits is not accepted and ALSA defaults to 32 (or 24 packed in
32).  

{ 
        /* ZOOM R16 in USB 2.0 mode */ 
        USB_DEVICE(0x1686, 0x00dd), 
        .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk)
{ 
                .ifnum = QUIRK_ANY_INTERFACE, 
                .type = QUIRK_COMPOSITE, 
                .data = (const struct snd_usb_audio_quirk[]) { 
                       
                        { 
                                .ifnum = 0, 
                                .type = QUIRK_IGNORE_INTERFACE 
                        }, 

                       { 
                                .ifnum = 1,  /*PLAYBACK*/ 
                                .type = QUIRK_AUDIO_FIXED_ENDPOINT, 
                                .data = & (const struct audioformat) { 
                                .formats = SNDRV_PCM_FMTBIT_S24_LE, 
                                .channels = 2, 
                                .iface = 0, 
                                .altsetting = 1, 
                                 altset_idx = 1, 
                                .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE, 
                                .endpoint = 0x03, 
                                .ep_attr = 9,               
                                .rates = SNDRV_PCM_RATE_44100 | 
                   	                   SNDRV_PCM_RATE_48000 | 
                   	                   SNDRV_PCM_RATE_88200 | 
                   	                   SNDRV_PCM_RATE_96000, 
                               .rate_min = 44100, 
                               .rate_max = 96000, 
                               .nr_rates = 4, 
                               .rate_table = (unsigned int[]) { 
                                44100, 48000, 88200, 96000 
                                 } 
                              } 
                           }, 

                        { 
                               .ifnum = 2,  /*CAPTURE*/ 
                              .type = QUIRK_AUDIO_FIXED_ENDPOINT, 
                              .data = & (const struct audioformat) { 
                                 .formats = SNDRV_PCM_FMTBIT_S24_LE, 
                                 .channels = 8, 
                                 .iface = 0, 
                                 .altsetting = 1, 
                                 .altset_idx = 1, 
                                 .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE, 
                                  .endpoint = 0x84, 
                                  .ep_attr = 13,               
                                  .rates = SNDRV_PCM_RATE_44100 | 
                                     	     SNDRV_PCM_RATE_48000 | 
                                    	     SNDRV_PCM_RATE_88200 | 
                                             SNDRV_PCM_RATE_96000, 
                                .rate_min = 44100, 
                                 .rate_max = 96000, 
                                 .nr_rates = 4, 
                                 .rate_table = (unsigned int[]) { 
                                       44100, 48000, 88200, 96000 
                                 } 
                              } 
                           }, 

                        { 
                                .ifnum = 3, 
                                .type = QUIRK_MIDI_STANDARD_INTERFACE 
                        }, 


                        { 
                                .ifnum = .1 
                        }, 
             	

                        } 

       	 } 

}, 










--
View this message in context: http://linux-audio.4202.n7.nabble.com/re-Zoom-R16-tp87487p89773.html
Sent from the linux-audio-user mailing list archive at Nabble.com.
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/listinfo/linux-audio-user




[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux