All of lore.kernel.org
 help / color / mirror / Atom feed
* Tenor TE8802, USB : clics and crackles during music play
@ 2014-01-12 15:36 Eric F
  2014-01-12 15:43 ` Eric F
  0 siblings, 1 reply; 13+ messages in thread
From: Eric F @ 2014-01-12 15:36 UTC (permalink / raw)
  To: alsa-devel

Hello,

Been searching for days on Internet for this issue, without luck :(

I own a Teac UD-H01 : when connected via USB => crackles and clicks

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-01-12 15:36 Tenor TE8802, USB : clics and crackles during music play Eric F
@ 2014-01-12 15:43 ` Eric F
  2014-01-13  7:05   ` Eric F
  2014-01-14 14:34   ` Daniel Mack
  0 siblings, 2 replies; 13+ messages in thread
From: Eric F @ 2014-01-12 15:43 UTC (permalink / raw)
  To: alsa-devel

Hello,

Been searching for days on Internet for this issue, without luck :(

I own a Teac UD-H01 : when connected via USB => crackles and clicks

optical => no problem
I want to use it as USB because it's asynchronous, so only a few jitter

I've tried many kernels (3.12.7, 3.12.6) and the LTS that I use normally
(3.10.25, 3.10.26) : not solved

I've tried on a fresh ArchLinux install : no way
I've tried Xubuntu : not better (plus they use pulseaudio)
I've tried on my desktop's Arch Linux

I'd like to know if any of you have a patch or a fix for the Tead UD-H01
DAC when used via USB

Thanks

P.S. I've tried all availavle USB ports on my Arch, not better

2014/1/12 Eric F <3rik.gm@gmail.com>

> Hello,
>
> Been searching for days on Internet for this issue, without luck :(
>
> I own a Teac UD-H01 : when connected via USB => crackles and clicks
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-01-12 15:43 ` Eric F
@ 2014-01-13  7:05   ` Eric F
  2014-01-13  7:09     ` Eric F
  2014-01-14 14:34   ` Daniel Mack
  1 sibling, 1 reply; 13+ messages in thread
From: Eric F @ 2014-01-13  7:05 UTC (permalink / raw)
  To: alsa-devel

Please don't let down... Feel free to ask whatever you need...

Yours sincerely,

Eric


2014/1/12 Eric F <3rik.gm@gmail.com>

> Hello,
>
> Been searching for days on Internet for this issue, without luck :(
>
> I own a Teac UD-H01 : when connected via USB => crackles and clicks
>
> optical => no problem
> I want to use it as USB because it's asynchronous, so only a few jitter
>
> I've tried many kernels (3.12.7, 3.12.6) and the LTS that I use normally
> (3.10.25, 3.10.26) : not solved
>
> I've tried on a fresh ArchLinux install : no way
> I've tried Xubuntu : not better (plus they use pulseaudio)
> I've tried on my desktop's Arch Linux
>
> I'd like to know if any of you have a patch or a fix for the Tead UD-H01
> DAC when used via USB
>
> Thanks
>
> P.S. I've tried all availavle USB ports on my Arch, not better
>
> 2014/1/12 Eric F <3rik.gm@gmail.com>
>
>> Hello,
>>
>> Been searching for days on Internet for this issue, without luck :(
>>
>> I own a Teac UD-H01 : when connected via USB => crackles and clicks
>>
>>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-01-13  7:05   ` Eric F
@ 2014-01-13  7:09     ` Eric F
  0 siblings, 0 replies; 13+ messages in thread
From: Eric F @ 2014-01-13  7:09 UTC (permalink / raw)
  To: alsa-devel

One thing that could help you : lsusb verbose :

http://ix.io/9Q4

Thank you in advance :)


2014/1/13 Eric F <3rik.gm@gmail.com>

> Please don't let down... Feel free to ask whatever you need...
>
> Yours sincerely,
>
> Eric
>
>
> 2014/1/12 Eric F <3rik.gm@gmail.com>
>
>> Hello,
>>
>> Been searching for days on Internet for this issue, without luck :(
>>
>> I own a Teac UD-H01 : when connected via USB => crackles and clicks
>>
>> optical => no problem
>> I want to use it as USB because it's asynchronous, so only a few jitter
>>
>> I've tried many kernels (3.12.7, 3.12.6) and the LTS that I use normally
>> (3.10.25, 3.10.26) : not solved
>>
>> I've tried on a fresh ArchLinux install : no way
>> I've tried Xubuntu : not better (plus they use pulseaudio)
>> I've tried on my desktop's Arch Linux
>>
>> I'd like to know if any of you have a patch or a fix for the Tead UD-H01
>> DAC when used via USB
>>
>> Thanks
>>
>> P.S. I've tried all availavle USB ports on my Arch, not better
>>
>> 2014/1/12 Eric F <3rik.gm@gmail.com>
>>
>>> Hello,
>>>
>>> Been searching for days on Internet for this issue, without luck :(
>>>
>>> I own a Teac UD-H01 : when connected via USB => crackles and clicks
>>>
>>>
>>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-01-12 15:43 ` Eric F
  2014-01-13  7:05   ` Eric F
@ 2014-01-14 14:34   ` Daniel Mack
  2014-04-04 15:01     ` Mick
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel Mack @ 2014-01-14 14:34 UTC (permalink / raw)
  To: Eric F; +Cc: alsa-devel

On Sun, Jan 12, 2014 at 04:43:06PM +0100, Eric F wrote:
> Been searching for days on Internet for this issue, without luck :(
> 
> I own a Teac UD-H01 : when connected via USB => crackles and clicks

Which tool are you using in userspace to test this? Did you try aplay?

> optical => no problem

I'm confused. According to

  http://www.teac.com/product/ud-h01/

there is no optical output. Are you saying things only work if you
connect an optical input?

Are you absolutely sure that you're not dealing with analog audio
distortion? IOW: did you try the very same setup with a different OS?

> I want to use it as USB because it's asynchronous, so only a few jitter

I don't follow. According to the device specs, USB is the only option to
connect this thing?

> I've tried many kernels (3.12.7, 3.12.6) and the LTS that I use normally
> (3.10.25, 3.10.26) : not solved
> 
> I've tried on a fresh ArchLinux install : no way
> I've tried Xubuntu : not better (plus they use pulseaudio)
> I've tried on my desktop's Arch Linux
> 
> I'd like to know if any of you have a patch or a fix for the Tead UD-H01
> DAC when used via USB

The device exposes itself as USB audio v2 interface, so it should work
out-of-the-box. What's interesting is that there are two clock sources,
but only one is connected in the topology (bCSourceID = 12), and there
is no clock selector. Crackles could be related to wrong clocking, but
that's just guessing.

Please check whether the device works under Windows or Mac OS X.


Daniel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-01-14 14:34   ` Daniel Mack
@ 2014-04-04 15:01     ` Mick
  2014-04-04 15:26       ` Clemens Ladisch
  0 siblings, 1 reply; 13+ messages in thread
From: Mick @ 2014-04-04 15:01 UTC (permalink / raw)
  To: alsa-devel

Hi,

if this isn't solved yet, I think I know the fix.
It is an issue of the TE8802 but can be fixed by a driver patch as discussed
here:
http://www.head-fi.org/t/609062/te8802-asynchronous-dacs-on-linux-and-squeezebox-touch-supported-with-triodes-app-for-the-sbt/15

It worked for me in OpenSuse + XMBC.
I'd be interested to know if this patch could make it into the regular Linux
sources.
If any, please cc me direct in reply.

Mick

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-04-04 15:01     ` Mick
@ 2014-04-04 15:26       ` Clemens Ladisch
  2014-04-07 14:43         ` mick
  0 siblings, 1 reply; 13+ messages in thread
From: Clemens Ladisch @ 2014-04-04 15:26 UTC (permalink / raw)
  To: Mick, alsa-devel

Mick wrote:
> It is an issue of the TE8802 but can be fixed by a driver patch as discussed here:
> http://www.head-fi.org/t/609062/te8802-asynchronous-dacs-on-linux-and-squeezebox-touch-supported-with-triodes-app-for-the-sbt/15

What patch?  As far as I can see, that page discusses a firmware upgrade.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-04-04 15:26       ` Clemens Ladisch
@ 2014-04-07 14:43         ` mick
       [not found]           ` <534305F1.8040805@ladisch.de>
  0 siblings, 1 reply; 13+ messages in thread
From: mick @ 2014-04-07 14:43 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

Sorry, I thought there was a link to the patch somewhere in this thread  
but some links are dead now.
It can still be found at the bottom of the page here:  
http://forums.slimdevices.com/showthread.php?93310-Async-USB-Dac-Experiments-testers-wanted/page30
If this is not enough for you I can dig out the patched source I am  
running.

Regards,
Mick



On Fri, 04 Apr 2014 17:26:52 +0200, Clemens Ladisch <clemens@ladisch.de>  
wrote:

> Mick wrote:
>> It is an issue of the TE8802 but can be fixed by a driver patch as  
>> discussed here:
>> http://www.head-fi.org/t/609062/te8802-asynchronous-dacs-on-linux-and-squeezebox-touch-supported-with-triodes-app-for-the-sbt/15
>
> What patch?  As far as I can see, that page discusses a firmware upgrade.
>
>
> Regards,
> Clemens

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
       [not found]           ` <534305F1.8040805@ladisch.de>
@ 2014-04-08  8:13             ` mick
  2014-04-08 10:29               ` Clemens Ladisch
  0 siblings, 1 reply; 13+ messages in thread
From: mick @ 2014-04-08  8:13 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

Clemens,

please help me out: are you asking me personally to test or is this a  
general call for the group?
If you need me to test, what version of kernel sources do I patch? I am  
probably not running the latest. Forgive the questions, I do not routinely  
do these things.
Also: Your patch looks quite different from the solution I pointed out.  
Why? Did you test it yourself? In particular the assertion:
> +		 * The TEAC UD-H01 firmware sometimes changes the feedback value
> +		 * by +/- 0x1.0000.
is quite different from the assertion
"the 3rd byte of the feadback value is getting corrupted and probably  
changing when it should not "
 from  
http://forums.slimdevices.com/showthread.php?93310-Async-USB-Dac-Experiments-testers-wanted/page30.
Also, you made it quite explicit for the TEAC UD-H01 but I think it should  
be more general. I have the Teac A-H01 and it also has the problem. As far  
as I gather from the various discussions on the Web it probably is a  
general Tenor 8802 issue. For instance with Nuforce DAC-9 here:
http://www.spinics.net/linux/fedora/alsa-user/msg11387.html

Mick



On Mon, 07 Apr 2014 22:09:21 +0200, Clemens Ladisch <clemens@ladisch.de>  
wrote:

> Please test this patch:
>
> --8<----------------------------------------------------------------->8--
> ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data
>
> The TEAC UD-H01 firmware sends wrong feedback frequency values, thus
> causing the PC to send the samples at a wrong rate, which results in
> clicks and crackles in the output.
>
> Add a workaround to detect and fix the corruption.
>
> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
> Tested-by: Mick <mick37@gmx.de>
> Cc: <stable@vger.kernel.org>
> ---
>  sound/usb/card.h     |    1 +
>  sound/usb/endpoint.c |   15 ++++++++++++++-
>  2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/sound/usb/card.h b/sound/usb/card.h
> index 9867ab8..97acb90 100644
> --- a/sound/usb/card.h
> +++ b/sound/usb/card.h
> @@ -92,6 +92,7 @@ struct snd_usb_endpoint {
>  	unsigned int curframesize;      /* current packet size in frames (for  
> capture) */
>  	unsigned int syncmaxsize;	/* sync endpoint packet size */
>  	unsigned int fill_max:1;	/* fill max packet size always */
> +	unsigned int udh01_fb_quirk:1;	/* corrupted feedback data */
>  	unsigned int datainterval;      /* log_2 of data packet interval */
>  	unsigned int syncinterval;	/* P for adaptive mode, 0 otherwise */
>  	unsigned char silence_value;
> diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
> index e70a87e..7b400eb 100644
> --- a/sound/usb/endpoint.c
> +++ b/sound/usb/endpoint.c
> @@ -471,6 +471,10 @@ struct snd_usb_endpoint  
> *snd_usb_add_endpoint(struct snd_usb_audio *chip,
>  			ep->syncinterval = 3;
>
>  		ep->syncmaxsize = le16_to_cpu(get_endpoint(alts, 1)->wMaxPacketSize);
> +
> +		if (chip->usb_id == USB_ID(0x0644, 0x8038) /* TEAC UD-H01 */ &&
> +		    ep->syncmaxsize == 4)
> +			ep->udh01_fb_quirk = 1;
>  	}
>
>  	list_add_tail(&ep->list, &chip->ep_list);
> @@ -1105,7 +1109,16 @@ void snd_usb_handle_sync_urb(struct  
> snd_usb_endpoint *ep,
>  	if (f == 0)
>  		return;
>
> -	if (unlikely(ep->freqshift == INT_MIN)) {
> +	if (unlikely(ep->udh01_fb_quirk)) {
> +		/*
> +		 * The TEAC UD-H01 firmware sometimes changes the feedback value
> +		 * by +/- 0x1.0000.
> +		 */
> +		if (f < ep->freqn - 0x8000)
> +			f += 0x10000;
> +		else if (f > ep->freqn + 0x8000)
> +			f -= 0x10000;
> +	} else if (unlikely(ep->freqshift == INT_MIN)) {
>  		/*
>  		 * The first time we see a feedback value, determine its format
>  		 * by shifting it left or right until it matches the nominal


-- 
Erstellt mit Operas E-Mail-Modul: http://www.opera.com/mail/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-04-08  8:13             ` mick
@ 2014-04-08 10:29               ` Clemens Ladisch
       [not found]                 ` <op.xd3dibs3wx6sbz@ws00534.pq>
  0 siblings, 1 reply; 13+ messages in thread
From: Clemens Ladisch @ 2014-04-08 10:29 UTC (permalink / raw)
  To: mick; +Cc: alsa-devel

mick wrote:
> are you asking me personally to test or is this a general call for the
> group?

Both.  I cannot apply this patch before it is tested by somebody.

> If you need me to test, what version of kernel sources do I patch?

Any more-or-less recent version should work.

> Your patch looks quite different from the solution I pointed out. Why?

That patch did some inefficient and superfluous things, and anonymous
patches cannot go into the kernel.

> In particular the assertion:
>> +         * The TEAC UD-H01 firmware sometimes changes the feedback value
>> +         * by +/- 0x1.0000.
> is quite different from the assertion
> "the 3rd byte of the feadback value is getting corrupted and probably
> changing when it should not "

These two assertions describe the same change.

> Also, you made it quite explicit for the TEAC UD-H01 but I think it
> should be more general. I have the Teac A-H01 and it also has the
> problem. As far as I gather from the various discussions on the Web it
> probably is a general Tenor 8802 issue.

I was not aware of these other devices.  What are the vendor/device IDs
of the A-H01?


Regards,
Clemens

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
       [not found]                 ` <op.xd3dibs3wx6sbz@ws00534.pq>
@ 2014-04-10  9:23                   ` Clemens Ladisch
  2014-04-14 10:44                     ` mick
  0 siblings, 1 reply; 13+ messages in thread
From: Clemens Ladisch @ 2014-04-10  9:23 UTC (permalink / raw)
  To: mick; +Cc: alsa-devel

mick wrote:
> I tried the patch but it does not help. Still crackles.

Do you get changing values, and any out-of-range values, when you execute
this while it's playing?

  (while sleep 0.123; do grep 'Momentary freq' /proc/asound/card*/stream0; done) | uniq


Regards,
Clemens

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-04-10  9:23                   ` Clemens Ladisch
@ 2014-04-14 10:44                     ` mick
  2014-04-17  7:27                       ` Daniel Mack
  0 siblings, 1 reply; 13+ messages in thread
From: mick @ 2014-04-14 10:44 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

Clemens,

I figured out what the problem is.
When I said the quirk code gets called I made a mistake. It did not.
What happens is this:
You are setting udh01_fb_quirk in the sync endpoint but at the line where
you query it you are asking the data endpoint. So the patch of the patch  
is:

-	if (unlikely(ep->udh01_fb_quirk)) {
+	if (unlikely(sender->udh01_fb_quirk)) {

With this change everything works fine with my TEAC A-H01.
The crackle is gone and grep for the momentary frequency shows no jumps  
anymore.

Regards,
Mick

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Tenor TE8802, USB : clics and crackles during music play
  2014-04-14 10:44                     ` mick
@ 2014-04-17  7:27                       ` Daniel Mack
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Mack @ 2014-04-17  7:27 UTC (permalink / raw)
  To: mick, Clemens Ladisch; +Cc: alsa-devel, Andrea Messa

On 04/14/2014 12:44 PM, mick wrote:
> I figured out what the problem is.
> When I said the quirk code gets called I made a mistake. It did not.
> What happens is this:
> You are setting udh01_fb_quirk in the sync endpoint but at the line where
> you query it you are asking the data endpoint. So the patch of the patch  
> is:
> 
> -	if (unlikely(ep->udh01_fb_quirk)) {
> +	if (unlikely(sender->udh01_fb_quirk)) {
> 
> With this change everything works fine with my TEAC A-H01.
> The crackle is gone and grep for the momentary frequency shows no jumps  
> anymore.

Nice catch. Clemens, with the above correction of the patch, Andrea
Messa reported success as well (had some private conversation on this).

When respinning the patch, you can add

  Tested-by: Andrea Messa <andr.messa@tiscali.it>


Many thanks, everyone!

Daniel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-04-17  7:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-12 15:36 Tenor TE8802, USB : clics and crackles during music play Eric F
2014-01-12 15:43 ` Eric F
2014-01-13  7:05   ` Eric F
2014-01-13  7:09     ` Eric F
2014-01-14 14:34   ` Daniel Mack
2014-04-04 15:01     ` Mick
2014-04-04 15:26       ` Clemens Ladisch
2014-04-07 14:43         ` mick
     [not found]           ` <534305F1.8040805@ladisch.de>
2014-04-08  8:13             ` mick
2014-04-08 10:29               ` Clemens Ladisch
     [not found]                 ` <op.xd3dibs3wx6sbz@ws00534.pq>
2014-04-10  9:23                   ` Clemens Ladisch
2014-04-14 10:44                     ` mick
2014-04-17  7:27                       ` Daniel Mack

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.