Bug 180071 - stk1160 audio channels periodically swapped
Summary: stk1160 audio channels periodically swapped
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: v4l-other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-23 15:43 UTC by mahasler
Modified: 2016-10-27 10:24 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.8.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Screenshot of normalized recording with noise (23.99 KB, image/png)
2016-10-23 15:43 UTC, mahasler
Details
Recording of noise showing cross-talk (468.92 KB, audio/flac)
2016-10-23 15:44 UTC, mahasler
Details
Normalized recording showing byte grouping (815.78 KB, audio/flac)
2016-10-23 16:12 UTC, mahasler
Details
Patch that fixes this bug (1.51 KB, patch)
2016-10-26 22:50 UTC, mahasler
Details | Diff

Description mahasler 2016-10-23 15:43:09 UTC
Created attachment 242351 [details]
Screenshot of normalized recording with noise

When capturing audio from my video grabber there's a constant noise in the background. From looking at a normalized recording (see attached screenshot) it's obvious there is some kind of cross-talk from a digital line in the device. This doesn't happen under Windows. I tried playing with the mixer controls and also checked the stk1160 datasheet but couldn't find any clue as to what might be causing this or what kind of signal is being transmitted. As can be seen from the attached recording the signal consists of transmissions of six bytes each, but I can't see any pattern in the data.

My device is a stk1160 based grabber with AC97 chip, labeled 'mumbi'.
Comment 1 mahasler 2016-10-23 15:44:06 UTC
Created attachment 242361 [details]
Recording of noise showing cross-talk
Comment 2 mahasler 2016-10-23 15:54:49 UTC
Actually the six-byte grouping is no longer visible, however it was there for a while. After every six bytes both channels would show a common mode drop. I'll try if can reproduce this.
Comment 3 mahasler 2016-10-23 16:12:27 UTC
Created attachment 242371 [details]
Normalized recording showing byte grouping

This byte-grouping may depend on the kernel version. I was running 4.7.x when I first noticed this but had upgraded to 4.8.x before making the other recording. I just created this new recording on another machine running a 4.4.x kernel. Here the grouping is clearly visible.
Comment 4 mahasler 2016-10-24 12:27:37 UTC
Actually the grouping also appears on 4.8.x. Also, on closer inspection the data is being transmitted as 16-bit words.

I compared USB traces taken on Windows and Linux, hoping to find some clue, and also tried disabling all functionality from the driver not related to audio, but I can't get rid of the noise. I'm beginning to suspect the problem to be somewhere in snd-usb-audio.
Comment 5 mahasler 2016-10-26 22:50:31 UTC
Created attachment 242861 [details]
Patch that fixes this bug

Turns out I was completely mistaken about the nature of this bug. It really looked like some digital signal, but actually was the same issue that had already been reported on the mailing list a long time ago (http://marc.info/?l=linux-sound&m=139223599126215&w=2). After closer investigation of the USB traces I tracked this down to a problem in snd-usb-audio for which a workaround/quirk already exists. This patch applies the quirk to the stk1160 chip.
Comment 6 mahasler 2016-10-27 10:24:03 UTC
Patch has been applied, therefore this bug can be closed.

Note You need to log in before you can comment on or make changes to this bug.