From: Daniel Svensson Subject: Problems with Hercules DJ Console and the usb-audio driver Date: Mon, 12 Sep 2005 20:27:16 +0200 Message-ID: <20050912182716.GA26327@nittionio.nu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Hi I'm trying to add support for the Hercules DJ Console. It's a USB 5.1 soundcard with a MIDI-interface and some MIDI controllers. From looking inside the box I found the following components: Asahi Kasei, AKM AK4529VQ. A high performance multi-channel audio codec. http://www.akm.com/datasheets/ek4529.pdf Texas Instruments, TUSB3200AC. A USB Streaming Controller. http://focus.ti.com/docs/prod/folders/print/tusb3200.html Cirrus Logic, CS8427. A stereo digital audio transceiver. http://www.cirrus.com/en/products/pro/detail/P51.html With ALSA 1.0.9 MIDI worked well. I could access both the MIDI controllers on the device and the keyboard I connected to the device aswell. There were more issues though, so I updated to latest cvs and now MIDI doesn't work anylonger. When loading snd-usb-audio I get the message: ALSA /home/nano/devel/alsa/alsa-driver/usb/usbmidi.c:1600: invalid quirk type 2 snd-usb-audio: probe of 1-1:1.3 failed with error -5 I've looked at the diffs but I haven't found out what change since 1.0.9 broke the MIDI support. Output from MIDI in 1.0.9: Client 64 : "Hercules DJ Console" [Kernel] Port 0 : "Hercules DJ Console MIDI 1" (RWeX) Port 1 : "Hercules DJ Console MIDI 2" (RWeX) The rest of the device doesn't work either. The mixer fails because the mixer element "Delay Control" cannot be read. lsusb: bmaControls( 0) 0x80 Delay When trying to load the mixer the driver fails at: usb/usbmixer.c (linenumbers might have changed, but somewhere there) 666 if (get_ctl_value(cval, GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 || 667 get_ctl_value(cval, GET_MIN, (cval->control << 8) |minchn, &cval->min) < 0) { 668 snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n", 669 cval->id, cval->mixer->ctrlif, cval->control,cval->id); 670 return -EINVAL; 671 } and (same file) 742 /* master channel */ 743 err = get_cur_mix_value(cval, 0, &val); 744 if (err < 0) { 745 if (cval->mixer->ignore_ctl_error) { 746 ucontrol->value.integer.value[0] = cval->min; 747 return 0; 748 } 749 snd_printd(KERN_ERR "cannot get current value for control %d master ch: err = %d\n", cval->control, err); 750 return err; 751 } With the error message: ALSA /home/.../usb/usbmixer.c:669: 2:0: cannot get min/max values for control 8 (id 2) ALSA /home/.../usb/usbmixer.c:749: cannot get current value for control 8 master ch: err = -22 $ alsamixer alsamixer: function snd_mixer_load failed: Invalid argument $ amixer controls numid=1,iface=MIXER,name='PCM Playback Switch' numid=2,iface=MIXER,name='PCM Playback Volume' numid=3,iface=MIXER,name='Delay Control' $ amixer cget numid=3 numid=3,iface=MIXER,name='Delay Control' ; type=INTEGER,access=rw---,values=1,min=0,max=1,step=0 amixer: Control default element read error: Invalid argument When trying to feed audio data to the card the driver fails at: usb/usbaudio.c: 802 if ((err = usb_submit_urb(subs->dataurb[i].urb, GFP_ATOMIC)) < 0) { 803 snd_printk(KERN_ERR "cannot submit datapipe for urb %d, err = %d \n", i, err); 804 goto __error; 805 } With the error message: ALSA /home/.../usb/usbaudio.c:803: cannot submit datapipe for urb 1, err = -28 ALSA /home/.../usb/usbaudio.c:803: cannot submit datapipe for urb 0, err = -22 What does work is that the proc dir gets populated and jack correctly assumes the card to be a 5.1 card (6 connectable devices). Here is the output of lsusb -v: Bus 001 Device 003: ID 06f8:d002 Guillemot Corp. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x06f8 Guillemot Corp. idProduct 0xd002 bcdDevice 1.00 iManufacturer 1 iProduct 2 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 316 bNumInterfaces 4 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 MaxPower 300mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 1 Control Device bInterfaceProtocol 0 iInterface 0 AudioControl Interface Descriptor: bLength 10 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bcdADC 1.00 wTotalLength 88 bInCollection 2 baInterfaceNr( 0) 1 baInterfaceNr( 1) 2 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 5 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bNrChannels 6 wChannelConfig 0x003f Left Front (L) Right Front (R) Center Front (C) Low Freqency Enhancement (LFE) Left Surround (LS) Right Surround (RS) iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 14 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 6 bSourceID 5 bControlSize 1 bmaControls( 0) 0x00 bmaControls( 1) 0x03 Mute Volume bmaControls( 2) 0x03 Mute Volume bmaControls( 3) 0x03 Mute Volume bmaControls( 4) 0x03 Mute Volume bmaControls( 5) 0x03 Mute Volume bmaControls( 6) 0x03 Mute Volume iFeature 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 7 wTerminalType 0x0301 Speaker bAssocTerminal 0 bSourceID 6 iTerminal 0 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0603 Line Connector bAssocTerminal 0 bNrChannels 2 wChannelConfig 0x0003 Left Front (L) Right Front (R) iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 10 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 2 bSourceID 1 bControlSize 1 bmaControls( 0) 0x80 Delay bmaControls( 1) 0x00 bmaControls( 2) 0x00 iFeature 0 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 4 (MIXER_UNIT) bUnitID 3 bNrInPins 1 baSourceID( 0) 2 bNrChannels 2 wChannelConfig 0x0003 Left Front (L) Right Front (R) iChannelNames 0 bmControls 0x00 iMixer 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 4 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID 3 iTerminal 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 AudioStreaming Interface Descriptor: bLength 7 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 5 bDelay 1 frames wFormatTag 1 PCM AudioStreaming Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 6 bSubframeSize 2 bBitResolution 16 bSamFreqType 1 Discrete tSamFreq[ 0] 48000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 9 Transfer Type Isochronous Synch Type Adaptive Usage Type Data wMaxPacketSize 0x0240 1x 576 bytes bInterval 1 bRefresh 0 bSynchAddress 0 AudioControl Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x01 Sampling Frequency bLockDelayUnits 0 Undefined wLockDelay 0 Undefined Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 AudioStreaming Interface Descriptor: bLength 7 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 4 bDelay 1 frames wFormatTag 1 PCM AudioStreaming Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 2 bSubframeSize 2 bBitResolution 16 bSamFreqType 1 Discrete tSamFreq[ 0] 48000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 13 Transfer Type Isochronous Synch Type Synchronous Usage Type Data wMaxPacketSize 0x00c0 1x 192 bytes bInterval 1 bRefresh 0 bSynchAddress 0 AudioControl Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x01 Sampling Frequency bLockDelayUnits 0 Undefined wLockDelay 0 Undefined Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 1 Audio bInterfaceSubClass 3 MIDI Streaming bInterfaceProtocol 0 iInterface 0 MIDIStreaming Interface Descriptor: bLength 7 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bcdADC 1.00 wTotalLength 97 MIDIStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 2 (MIDI_IN_JACK) bJackType 2 External bJackID 2 iJack 0 MIDIStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 2 (MIDI_IN_JACK) bJackType 1 Embedded bJackID 1 iJack 0 MIDIStreaming Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (MIDI_OUT_JACK) bJackType 1 Embedded bJackID 0 bNrInputPins 1 baSourceID( 0) 2 BaSourcePin( 0) 1 iJack 0 MIDIStreaming Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (MIDI_OUT_JACK) bJackType 2 External bJackID 8 bNrInputPins 1 baSourceID( 0) 1 BaSourcePin( 0) 1 iJack 0 MIDIStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 2 (MIDI_IN_JACK) bJackType 2 External bJackID 6 iJack 0 MIDIStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 2 (MIDI_IN_JACK) bJackType 1 Embedded bJackID 1 iJack 0 MIDIStreaming Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (MIDI_OUT_JACK) bJackType 1 Embedded bJackID 1 bNrInputPins 1 baSourceID( 0) 6 BaSourcePin( 0) 1 iJack 0 MIDIStreaming Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (MIDI_OUT_JACK) bJackType 2 External bJackID 8 bNrInputPins 1 baSourceID( 0) 1 BaSourcePin( 0) 1 iJack 0 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0004 1x 4 bytes bInterval 0 bRefresh 0 bSynchAddress 0 MIDIStreaming Endpoint Descriptor: bLength 6 bDescriptorType 37 bDescriptorSubtype 1 (GENERAL) bNumEmbMIDIJack 2 baAssocJackID( 0) 0 baAssocJackID( 1) 1 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0004 1x 4 bytes bInterval 0 bRefresh 0 bSynchAddress 0 MIDIStreaming Endpoint Descriptor: bLength 6 bDescriptorType 37 bDescriptorSubtype 1 (GENERAL) bNumEmbMIDIJack 2 baAssocJackID( 0) 0 baAssocJackID( 1) 1 So I ask for some help to put me in the right direction. What code to read and any thoughts about what can be wrong at the moment. The MIDI part seems like a good thing to start with as it recently worked. If there is more information I need to provide please tell and I'll see what I can do about it. -- Daniel Svensson ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf