All of lore.kernel.org
 help / color / mirror / Atom feed
* [ISSUE] crackles and clicks
@ 2014-01-13  8:34 Eric F
  2014-01-13 12:11 ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Eric F @ 2014-01-13  8:34 UTC (permalink / raw)
  To: alsa-devel

Hello,

I tried my DAC (Tenor TE8802 chipset) in USB on Archlinux (LTS 3.10.26).
I can hear regularly crackles ans clicks.

I've tried all available USB ports, other kernels (3.12.6, 3.12.7), other
distro (ubuntu), without luck...

The DAC is Teac UD-H01.

here is lsusb verbose : http://ix.io/9Q4

Feel free to ask for more precisions, I'll give you all you need.

I thank you very much.

Eric

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

* Re: [ISSUE] crackles and clicks
  2014-01-13  8:34 [ISSUE] crackles and clicks Eric F
@ 2014-01-13 12:11 ` Takashi Iwai
  2014-01-13 16:32   ` LANGLOIS Olivier PIS -EXT
  0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2014-01-13 12:11 UTC (permalink / raw)
  To: Eric F; +Cc: alsa-devel

At Mon, 13 Jan 2014 09:34:04 +0100,
Eric F wrote:
> 
> Hello,
> 
> I tried my DAC (Tenor TE8802 chipset) in USB on Archlinux (LTS 3.10.26).
> I can hear regularly crackles ans clicks.
> 
> I've tried all available USB ports, other kernels (3.12.6, 3.12.7), other
> distro (ubuntu), without luck...
> 
> The DAC is Teac UD-H01.
> 
> here is lsusb verbose : http://ix.io/9Q4
> 
> Feel free to ask for more precisions, I'll give you all you need.

Which program / sound backend did you test?  Do the crackles happen
with the plain "aplay -Dplughw foo.wav", too?


Takashi

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

* Re: [ISSUE] crackles and clicks
  2014-01-13 12:11 ` Takashi Iwai
@ 2014-01-13 16:32   ` LANGLOIS Olivier PIS -EXT
  2014-01-14 14:42     ` Daniel Mack
  0 siblings, 1 reply; 8+ messages in thread
From: LANGLOIS Olivier PIS -EXT @ 2014-01-13 16:32 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

>
> At Mon, 13 Jan 2014 09:34:04 +0100,
> Eric F wrote:
> >
> > Hello,
> >
> > I tried my DAC (Tenor TE8802 chipset) in USB on Archlinux (LTS 3.10.26).
> > I can hear regularly crackles ans clicks.
> >
> > I've tried all available USB ports, other kernels (3.12.6, 3.12.7),
> > other distro (ubuntu), without luck...
> >
> > The DAC is Teac UD-H01.
> >
> > here is lsusb verbose : http://ix.io/9Q4
> >
> > Feel free to ask for more precisions, I'll give you all you need.
>
> Which program / sound backend did you test?  Do the crackles happen with
> the plain "aplay -Dplughw foo.wav", too?
>
>
> Takashi

If this can help in the investigation of your problem, I can experience crackles and clicks during pcm playback on my small hpmini notebook. I have kinda nailed down the source of the crackles and clicks.

It turns out that when my Wifi card is on but not connected, I have the crackles and clicks. If I connect to a Wifi network or close the Wifi, the crackles and clicks go away. I have not had the time check the Wifi driver code yet but my explanation of the behavior is that in that specific state, some wifi IRQ handler is taking too much time and stop my sound device irqs to be timely serviced.

My advice, is try to unload as much as possible kernel driver modules that may interfere with your audio playback and see if your crackles and clicks go away. For reference, here is my HW, in case you have the same Wifi Adapter....

00:1b.0 Audio device [0403]: Intel Corporation NM10/ICH7 Family High Definition Audio Controller [8086:27d8] (rev 02)
  Subsystem: Hewlett-Packard Company Device [103c:1584]
  Flags: bus master, fast devsel, latency 0, IRQ 45
  Memory at 96200000 (64-bit, non-prefetchable) [size=16K]
  Capabilities: [50] Power Management version 2
  Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
  Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
  Capabilities: [100] Virtual Channel
  Capabilities: [130] Root Complex Link
  Kernel driver in use: snd_hda_intel
  Kernel modules: snd_hda_intel

01:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter [10ec:8176] (rev 01)
  Subsystem: Hewlett-Packard Company Device [103c:1629]
  Flags: bus master, fast devsel, latency 0, IRQ 16
  I/O ports at 3000 [size=256]
  Memory at 95000000 (64-bit, non-prefetchable) [size=16K]
  Capabilities: [40] Power Management version 3
  Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
  Capabilities: [70] Express Endpoint, MSI 00
  Capabilities: [100] Advanced Error Reporting
  Capabilities: [140] Virtual Channel
  Capabilities: [160] Device Serial Number 01-91-81-fe-ff-4c-e0-00
  Kernel driver in use: rtl8192ce
  Kernel modules: rtl8192ce

________________________________
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

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

* Re: [ISSUE] crackles and clicks
  2014-01-13 16:32   ` LANGLOIS Olivier PIS -EXT
@ 2014-01-14 14:42     ` Daniel Mack
  2014-01-14 15:59       ` LANGLOIS Olivier PIS -EXT
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Mack @ 2014-01-14 14:42 UTC (permalink / raw)
  To: LANGLOIS Olivier PIS -EXT; +Cc: alsa-devel@alsa-project.org

On Mon, Jan 13, 2014 at 04:32:30PM +0000, LANGLOIS Olivier PIS -EXT wrote:
> > At Mon, 13 Jan 2014 09:34:04 +0100,
> > Eric F wrote:
> > >
> > > Hello,
> > >
> > > I tried my DAC (Tenor TE8802 chipset) in USB on Archlinux (LTS 3.10.26).
> > > I can hear regularly crackles ans clicks.
> > >
> > > I've tried all available USB ports, other kernels (3.12.6, 3.12.7),
> > > other distro (ubuntu), without luck...
> > >
> > > The DAC is Teac UD-H01.
> > >
> > > here is lsusb verbose : http://ix.io/9Q4
> > >
> > > Feel free to ask for more precisions, I'll give you all you need.
> >
> > Which program / sound backend did you test?  Do the crackles happen with
> > the plain "aplay -Dplughw foo.wav", too?
> >
> >
> > Takashi
> 
> If this can help in the investigation of your problem, I can experience crackles and clicks during pcm playback on my small hpmini notebook. I have kinda nailed down the source of the crackles and clicks.
> 
> It turns out that when my Wifi card is on but not connected, I have the crackles and clicks. If I connect to a Wifi network or close the Wifi, the crackles and clicks go away. I have not had the time check the Wifi driver code yet but my explanation of the behavior is that in that specific state, some wifi IRQ handler is taking too much time and stop my sound device irqs to be timely serviced.
> 
> My advice, is try to unload as much as possible kernel driver modules that may interfere with your audio playback and see if your crackles and clicks go away. For reference, here is my HW, in case you have the same Wifi Adapter....
> 

I'm not sure whether you're on the right track here.

Which program are you using for this? How are the buffer sizes
configured? Are you seeing XRUNs?

And are you sure the audio distortion doesn't relate to bad USB power?
Please check with a different PC as well, and for tests, put a
powered(!) USB hub inbetween your PC and the DAC.



Daniel

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

* [ISSUE] crackles and clicks
@ 2014-01-14 14:59 Eric F
  0 siblings, 0 replies; 8+ messages in thread
From: Eric F @ 2014-01-14 14:59 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

Please never do the following things on public mailing lists:

1. Take the mailing list address out of Cc. ALWAYS(!) use "reply to all"
2. Top-post. Please quote your reposonse properly, as everyone else does
3. Send HTML-Email. Please use plain-text only.


As for your problem, please refer to the the reply I posted to you
earlier mail. I'm really having trouble understanding your problem.
Please follow the three basic rules above when replying :)

I use Gmail, haven't seen a reply to all option...

I'm not used to this, pplease excuse me...

HERE IS WHAT I SAID :

Hello,

There is no distortion ! only crackles and clicks.

When using it with Jack, no xruns at all.

But for testing purpose, I have disabled Jack, mpd,  I use only aplay.
Dunno if there is a way for buffer stuff with it.

Gonna buy a powered USB Hub.

Thanks !

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

* Re: [ISSUE] crackles and clicks
  2014-01-14 14:42     ` Daniel Mack
@ 2014-01-14 15:59       ` LANGLOIS Olivier PIS -EXT
  2014-01-14 16:08         ` Daniel Mack
  2014-01-21 23:59         ` LANGLOIS Olivier PIS -EXT
  0 siblings, 2 replies; 8+ messages in thread
From: LANGLOIS Olivier PIS -EXT @ 2014-01-14 15:59 UTC (permalink / raw)
  To: Daniel Mack, alsa-devel@alsa-project.org

Hi Daniel,

> -----Original Message-----
> From: Daniel Mack [mailto:daniel@zonque.org]
> Sent: Tuesday, January 14, 2014 9:42 AM
> > If this can help in the investigation of your problem, I can experience
> crackles and clicks during pcm playback on my small hpmini notebook. I have
> kinda nailed down the source of the crackles and clicks.
> >
> > It turns out that when my Wifi card is on but not connected, I have the
> crackles and clicks. If I connect to a Wifi network or close the Wifi, the
> crackles and clicks go away. I have not had the time check the Wifi driver
> code yet but my explanation of the behavior is that in that specific state,
> some wifi IRQ handler is taking too much time and stop my sound device irqs
> to be timely serviced.
> >
> > My advice, is try to unload as much as possible kernel driver modules that
> may interfere with your audio playback and see if your crackles and clicks go
> away. For reference, here is my HW, in case you have the same Wifi
> Adapter....
> >
>
> I'm not sure whether you're on the right track here.
>
> Which program are you using for this? How are the buffer sizes configured?
> Are you seeing XRUNs?
>
> And are you sure the audio distortion doesn't relate to bad USB power?
> Please check with a different PC as well, and for tests, put a
> powered(!) USB hub inbetween your PC and the DAC.
>
>
>
> Daniel

I experience the audible clicks with VLC but I have reproduced it with aplay as well. The clicks that I hear corresponds to underruns. For the records, this is not happening with a USB device. I have a Intel HDA sound card. I did chime in the discussion to point out that the problem could come from something else than ALSA or the sound card driver. Here is the output of my aplay session. This makes me doubt my hypothesis. I'll check the cpu usage while the Wifi is on but not connected or see if running aplay in real-time prio makes things any better.

Note that the underrun duration printed in the output sound fishy...

underrun!!! (at least 1856093977.967 ms long)

lano1106@hpmini ~/Music $ aplay -v -c1 sine.wav
Playing WAVE 'sine.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Plug PCM: Rate conversion PCM (48000, sformat=S32_LE)
Converter: linear-interpolation
Protocol version: 10002
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 15052
  period_size  : 940
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 940
  period_event : 0
  start_threshold  : 15052
  stop_threshold   : 15052
  silence_threshold: 0
  silence_size : 0
  boundary     : 986447872
Slave: Soft volume PCM
Control: PCM Playback Volume
min_dB: -51
max_dB: 0
resolution: 256
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
Slave: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
Hardware PCM card 0 'HDA Intel' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 1073741824
  silence_threshold: 0
  silence_size : 1073741824
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 40810501
underrun!!! (at least 1856093977.967 ms long)


________________________________
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

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

* Re: [ISSUE] crackles and clicks
  2014-01-14 15:59       ` LANGLOIS Olivier PIS -EXT
@ 2014-01-14 16:08         ` Daniel Mack
  2014-01-21 23:59         ` LANGLOIS Olivier PIS -EXT
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Mack @ 2014-01-14 16:08 UTC (permalink / raw)
  To: LANGLOIS Olivier PIS -EXT, alsa-devel@alsa-project.org

On 01/14/2014 04:59 PM, LANGLOIS Olivier PIS -EXT wrote:
> I experience the audible clicks with VLC but I have reproduced it 
> with aplay as well. The clicks that I hear corresponds to underruns.
>  For the records, this is not happening with a USB device. I have a 
> Intel HDA sound card.

Ok, sorry. I missed that detail.

> I did chime in the discussion to point out that
> the problem could come from something else than ALSA or the sound
> card driver. Here is the output of my aplay session. This makes me
> doubt my hypothesis. I'll check the cpu usage while the Wifi is on
> but not connected or see if running aplay in real-time prio makes 
> things any better.

I see, and I'd say that's a sign that the wifi driver is holding off the
system way too long somewhere, rather than a problem with the sound driver.

Could you repost your findings from the earlier mail and send them to
Larry.Finger@lwfinger.net and linux-wireless@vger.kernel.org? The
wireless people might have an idea what's going on.


Daniel

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

* Re: [ISSUE] crackles and clicks
  2014-01-14 15:59       ` LANGLOIS Olivier PIS -EXT
  2014-01-14 16:08         ` Daniel Mack
@ 2014-01-21 23:59         ` LANGLOIS Olivier PIS -EXT
  1 sibling, 0 replies; 8+ messages in thread
From: LANGLOIS Olivier PIS -EXT @ 2014-01-21 23:59 UTC (permalink / raw)
  To: Daniel Mack, alsa-devel@alsa-project.org

Hi, I have redone the small aplay experiment but this time by using the master git version which gives some more info about my underruns.

I have also modded it so it prints now with:

@@ -1507,9 +1507,10 @@ static void xrun(void)
                        clock_gettime(CLOCK_MONOTONIC, &now);
                        snd_pcm_status_get_trigger_htstamp(status, &tstamp);
                        timermsub(&now, &tstamp, &diff);
-                       fprintf(stderr, _("%s!!! (at least %.3f ms long)\n"),
+                       fprintf(stderr, _("%s!!! (at least %.3f ms long) now  %ld.%09ld\n"),
                                stream == SND_PCM_STREAM_PLAYBACK ? _("underrun") : _("overrun"),
-                               diff.tv_sec * 1000 + diff.tv_nsec / 1000000.0);
+                               diff.tv_sec * 1000 + diff.tv_nsec / 1000000.0,
+                               now.tv_sec, now.tv_nsec);
 #else
                        fprintf(stderr, "%s !!!\n", _("underrun"));
 #endif

./aplay -v ~/Music/sine.wav

on kernel v3.12.7 with

Codec: IDT 92HD81B1X5
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x111d7605
Subsystem Id: 0x103c1585
Revision Id: 0x100402

which gives

underrun!!! (at least 1248687948.256 ms long) now  27046.672739254
Status:
  state       : XRUN
  trigger_time: 1390347762.628483000
  tstamp      : 1390347766.184350000
  delay       : -635
  avail       : 15687
  avail_max   : 15675
underrun!!! (at least 1248690502.759 ms long) now  27052.789215213
Status:
  state       : XRUN
  trigger_time: 1390347766.190456000
  tstamp      : 1390347772.300830000
  delay       : -1333
  avail       : 16385
  avail_max   : 16373

is there someone that could give me some investigation advices on this one?
Would enabling xrun_debug be helpful?

thank you,


>
> I experience the audible clicks with VLC but I have reproduced it with aplay as
> well. The clicks that I hear corresponds to underruns. For the records, this is
> not happening with a USB device. I have a Intel HDA sound card. I did chime
> in the discussion to point out that the problem could come from something
> else than ALSA or the sound card driver. Here is the output of my aplay
> session. This makes me doubt my hypothesis. I'll check the cpu usage while
> the Wifi is on but not connected or see if running aplay in real-time prio
> makes things any better.
>
> Note that the underrun duration printed in the output sound fishy...
>
> underrun!!! (at least 1856093977.967 ms long)
>
> lano1106@hpmini ~/Music $ aplay -v -c1 sine.wav Playing WAVE 'sine.wav' :
> Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Plug PCM: Rate conversion
> PCM (48000, sformat=S32_LE)
> Converter: linear-interpolation
> Protocol version: 10002
> Its setup is:
>   stream       : PLAYBACK
>   access       : RW_INTERLEAVED
>   format       : S16_LE
>   subformat    : STD
>   channels     : 2
>   rate         : 44100
>   exact rate   : 44100 (44100/1)
>   msbits       : 16
>   buffer_size  : 15052
>   period_size  : 940
>   period_time  : 21333
>   tstamp_mode  : NONE
>   period_step  : 1
>   avail_min    : 940
>   period_event : 0
>   start_threshold  : 15052
>   stop_threshold   : 15052
>   silence_threshold: 0
>   silence_size : 0
>   boundary     : 986447872
> Slave: Soft volume PCM
> Control: PCM Playback Volume
> min_dB: -51
> max_dB: 0
> resolution: 256
> Its setup is:
>   stream       : PLAYBACK
>   access       : MMAP_INTERLEAVED
>   format       : S32_LE
>   subformat    : STD
>   channels     : 2
>   rate         : 48000
>   exact rate   : 48000 (48000/1)
>   msbits       : 32
>   buffer_size  : 16384
>   period_size  : 1024
>   period_time  : 21333
>   tstamp_mode  : NONE
>   period_step  : 1
>   avail_min    : 1024
>   period_event : 0
>   start_threshold  : 16384
>   stop_threshold   : 16384
>   silence_threshold: 0
>   silence_size : 0
>   boundary     : 1073741824
> Slave: Direct Stream Mixing PCM
> Its setup is:
>   stream       : PLAYBACK
>   access       : MMAP_INTERLEAVED
>   format       : S32_LE
>   subformat    : STD
>   channels     : 2
>   rate         : 48000
>   exact rate   : 48000 (48000/1)
>   msbits       : 32
>   buffer_size  : 16384
>   period_size  : 1024
>   period_time  : 21333
>   tstamp_mode  : NONE
>   period_step  : 1
>   avail_min    : 1024
>   period_event : 0
>   start_threshold  : 16384
>   stop_threshold   : 16384
>   silence_threshold: 0
>   silence_size : 0
>   boundary     : 1073741824
> Hardware PCM card 0 'HDA Intel' device 0 subdevice 0 Its setup is:
>   stream       : PLAYBACK
>   access       : MMAP_INTERLEAVED
>   format       : S32_LE
>   subformat    : STD
>   channels     : 2
>   rate         : 48000
>   exact rate   : 48000 (48000/1)
>   msbits       : 32
>   buffer_size  : 16384
>   period_size  : 1024
>   period_time  : 21333
>   tstamp_mode  : ENABLE
>   period_step  : 1
>   avail_min    : 1024
>   period_event : 0
>   start_threshold  : 1
>   stop_threshold   : 1073741824
>   silence_threshold: 0
>   silence_size : 1073741824
>   boundary     : 1073741824
>   appl_ptr     : 0
>   hw_ptr       : 40810501
> underrun!!! (at least 1856093977.967 ms long)
>
>
> ________________________________
> CONFIDENTIALITY : This e-mail and any attachments are confidential and may
> be privileged. If you are not a named recipient, please notify the sender
> immediately and do not disclose the contents to another person, use it for
> any purpose or store or copy the information in any medium.
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

________________________________
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

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

end of thread, other threads:[~2014-01-21 23:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13  8:34 [ISSUE] crackles and clicks Eric F
2014-01-13 12:11 ` Takashi Iwai
2014-01-13 16:32   ` LANGLOIS Olivier PIS -EXT
2014-01-14 14:42     ` Daniel Mack
2014-01-14 15:59       ` LANGLOIS Olivier PIS -EXT
2014-01-14 16:08         ` Daniel Mack
2014-01-21 23:59         ` LANGLOIS Olivier PIS -EXT
  -- strict thread matches above, loose matches on Subject: below --
2014-01-14 14:59 Eric F

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.