Distorted Captured Analog Stereo Audio with Hauppauge HVR-950Q

Bug #495745 reported by John S. Gruber on 2009-12-12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
John S. Gruber

Bug Description

About 12 times a second the captured analog audio switches channels. The resulting noise depends upon how much separation there happens to be in the source channels. There are further channel switches happening as well, usually lasting 48 audio samples (1 millisecond). The device samples audio a rate of 48000 (LE16 stereo).

The easiest way to hear this is to use TV input 1 (composite--v4l2-ctl -i 1) and disconnect one of the audio channels.

I was able to see the channel switch with Audacity against captured audio.

I tracked this problem down with a usb trace to the fact that the device is sending urb's each millisecond, and they split the left and right channels between urb's simultaneous to when the channels switch, including regular 1/12 second intervals.

sound/usb/usbaudio.c is coded to expect the urb's data to contain an integral number of audio slots (each containing both left and right channel samples). This current driver behaviour is helpful to recovery where data is damaged during transit over the bus, but violation of the assumption by the device causes the loss of one channels sample, and therefore loss of left/right synchronization between the device and the driver.

ProblemType: Bug
 **** List of PLAYBACK Hardware Devices ****
 card 0: SB [HDA ATI SB], device 0: ALC268 Analog [ALC268 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
Architecture: i386
 /dev/snd/controlC1: gruber 2116 F.... pulseaudio
 /dev/snd/controlC0: gruber 2116 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
 Card hw:0 'SB'/'HDA ATI SB at 0xce400000 irq 16'
   Mixer name : 'Realtek ALC268'
   Components : 'HDA:11c11040,11790001,00100200 HDA:10ec0268,1179ff68,00100003'
   Controls : 17
   Simple ctrls : 11
 Card hw:1 'U0x20400x7200'/'USB Device 0x2040:0x7200 at usb-0000:00:13.5-2, high speed'
   Mixer name : 'USB Mixer'
   Components : 'USB2040:7200'
   Controls : 1
   Simple ctrls : 1
 Simple mixer control 'PCM',0
   Capabilities: cswitch cswitch-joined
   Capture channels: Mono
   Mono: Capture [on]
Date: Fri Dec 11 21:36:10 2009
DistroRelease: Ubuntu 9.10
HibernationDevice: RESUME=UUID=14b4ed98-22c8-4708-96e3-c1a23a289650
MachineType: TOSHIBA Satellite L355D
Package: linux-image-2.6.31-15-generic 2.6.31-15.50
ProcCmdLine: root=/dev/sda9 ro
 PATH=(custom, no user)
ProcVersionSignature: Ubuntu 2.6.31-15.50-generic
 linux-backports-modules-2.6.31-15-generic N/A
 linux-firmware 1.25
 0: phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: no
SourcePackage: linux
Uname: Linux 2.6.31-15-generic i686
 (gnome-settings-daemon:2129): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (gnome-settings-daemon:2129): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (nautilus:2164): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
 (polkit-gnome-authentication-agent-1:2193): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
dmi.bios.date: 09/16/2008
dmi.bios.vendor: Insyde Corp.
dmi.bios.version: 1.70
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.vendor: TOSHIBA
dmi.board.version: Base Board Version
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: Chassis Manufacturer
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnInsydeCorp.:bvr1.70:bd09/16/2008:svnTOSHIBA:pnSatelliteL355D:pvrPSLE0U-01000R:rvnTOSHIBA:rn:rvrBaseBoardVersion:cvnChassisManufacturer:ct10:cvrChassisVersion:
dmi.product.name: Satellite L355D
dmi.product.version: PSLE0U-01000R
dmi.sys.vendor: TOSHIBA

John S. Gruber (jsjgruber) wrote :
Changed in linux (Ubuntu):
assignee: nobody → John S. Gruber (jsjgruber)
Andy Whitcroft (apw) on 2009-12-15
tags: added: karmic
Jeremy Foshee (jeremyfoshee) wrote :

Hi John,

This bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? Can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you run the following command from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux 495745

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

    [This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: kernel-sound
tags: added: needs-kernel-logs
tags: added: needs-upstream-testing
tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
John S. Gruber (jsjgruber) wrote :

The bug still exists in 2.6.32 (with Lucid) and should be fixed in 2.6.33 for the HVR-950Q I have (usbid 2040:7200). (I tested 2.6.33-rc6 under Lucid and the problem is gone there for my device). The kernel patch for this problem includes quirks and it appears I made a mistake creating the quirk for the HVR-850, and possibly other 950's. (Someone with an 850 wrote me). I'll be checking this and will submit corrections to the ALSA list for inclusion in a future kernel version.

Thanks for your help in keeping the bug reporting system up to date.

Changed in linux (Ubuntu):
status: Incomplete → In Progress
tags: added: lucid
removed: kj-triage needs-kernel-logs needs-upstream-testing
Andy Whitcroft (apw) on 2010-06-18
Changed in linux (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers