Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757481Ab0BXSS5 (ORCPT ); Wed, 24 Feb 2010 13:18:57 -0500 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:59076 "EHLO akado.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756794Ab0BXSS4 (ORCPT ); Wed, 24 Feb 2010 13:18:56 -0500 X-Greylist: delayed 3605 seconds by postgrey-1.27 at vger.kernel.org; Wed, 24 Feb 2010 13:18:55 EST From: Arseniy Lartsev To: linux-kernel@vger.kernel.org Subject: PROBLEM: Wrong bitrate when capturing sound from Creative webcam Date: Wed, 24 Feb 2010 20:18:38 +0300 User-Agent: KMail/1.12.2 (Linux/2.6.33-rc8-git1-0.1-default; KDE/4.3.1; i686; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2099756.2KiTkYslXu"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201002242018.45592.ars3n@yandex.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9836 Lines: 274 --nextPart2099756.2KiTkYslXu Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, I've got an USB webcam (Creative VF0470 Live Cam Notebook). The problem is that sound from it's microphone is captured with wrong bitrate. Apparently it reports 16000 Hz while it should actually be 8000 (so the sound is 2x faster). The following patch works for me: =2D-- linux-2.6.33-rc8/sound/usb/usbaudio.c +++ linux-2.6.33-rc8-new/sound/usb/usbaudio.c @@ -2513,6 +2513,8 @@ static int parse_audio_format_rates(stru chip->usb_id =3D=3D USB_ID(0x0d8c, 0x0102)) && fp->altsetting =3D=3D 5 && fp->maxpacksize =3D=3D 392) rate =3D 96000; + if ((rate =3D=3D 16000) && (chip->usb_id =3D USB_ID(0x041e, 0x4068))) + rate =3D 8000; fp->rate_table[fp->nr_rates] =3D rate; if (!fp->rate_min || rate < fp->rate_min) fp->rate_min =3D rate; I'm not sure if this is correct, maybe there should be more conditions to identify this particular camera. Here is output of lsusb -v: Bus 002 Device 002: ID 041e:4068 Creative Technology, Ltd Webcam Live! Note= book Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0=20 bDeviceProtocol 0=20 bMaxPacketSize0 8 idVendor 0x041e Creative Technology, Ltd idProduct 0x4068 Webcam Live! Notebook bcdDevice 1.00 iManufacturer 1 Creative Labs iProduct 2 VF0470 Live! Cam Notebook iSerial 0=20 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 180 bNumInterfaces 3 bConfigurationValue 1 iConfiguration 0=20 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0=20 bInterfaceProtocol 0=20 iInterface 0=20 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0000 1x 0 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0=20 bInterfaceProtocol 0=20 iInterface 0=20 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0180 1x 384 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0=20 bInterfaceProtocol 0=20 iInterface 0=20 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 3 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0=20 bInterfaceProtocol 0=20 iInterface 0=20 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0300 1x 768 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 4 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0=20 bInterfaceProtocol 0=20 iInterface 0=20 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0380 1x 896 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 1 Control Device bInterfaceProtocol 0=20 iInterface 0=20 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bcdADC 1.00 wTotalLength 30 bInCollection 1 baInterfaceNr( 0) 2 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0201 Microphone bAssocTerminal 0 bNrChannels 1 wChannelConfig 0x0000 iChannelNames 0=20 iTerminal 0=20 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 2 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID 1 iTerminal 0=20 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0=20 iInterface 0=20 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0=20 iInterface 0=20 AudioStreaming Interface Descriptor: bLength 7 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 2 bDelay 1 frames wFormatTag 1 PCM AudioStreaming Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 1 bSubframeSize 2 bBitResolution 16 bSamFreqType 1 Discrete tSamFreq[ 0] 16000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0028 1x 40 bytes bInterval 1 bRefresh 0 bSynchAddress 0 AudioControl Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x00 bLockDelayUnits 0 Undefined wLockDelay 0 Undefined Device Status: 0x0000 (Bus Powered) --nextPart2099756.2KiTkYslXu Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iJwEAAECAAYFAkuFX3UACgkQIHDkq2F9exa9nAP/RdwIaJFmjjtB5KayfuZoRTfY Q1V6ug2MG+24Aw0/zVerkFIURccoeuLSrEYkCJwTDHUxhfcRFUCV2TBS/wX1r0+A +3460esbGjdbgT3oDR3mQPLE27Q0DIb62sffYOO4SiCICxcNPe4iDTi8ZsWykQhz grkyOakNmJ7m8gJkBts= =C+Zl -----END PGP SIGNATURE----- --nextPart2099756.2KiTkYslXu-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/