You are not logged in.

#1 2013-10-05 12:47:53

Psylver
Member
From: Germany
Registered: 2010-06-10
Posts: 43

[SOLVED] Crackling sound with pulseaudio

Hello,
since I did my arch installation a few days ago, I'm unable to play from multiple audio sources without having the lastly added audio source crackling. As this only occurs when having multiple things play, this must be an issue with pulseaudio. I already tried using:

load-module module-udev-detect tsched=0

in my /etc/pulse/default.pa but this does not seem to have any effect.

Hope you can help me..

Last edited by Psylver (2013-10-05 18:38:15)

Offline

#2 2013-10-05 15:20:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,743

Re: [SOLVED] Crackling sound with pulseaudio

I've no suggestions, but you might want to tell us a bit about your hardware. 
Which audio chipset.
Which Codecs.
Analog or Digital Audio.
Stereo or Surround?
Built in speakers on a laptop?
HDMI?
What audio sources?  Flash? Mplayer?  Alsaplay?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#3 2013-10-05 15:39:30

Psylver
Member
From: Germany
Registered: 2010-06-10
Posts: 43

Re: [SOLVED] Crackling sound with pulseaudio

My sound-card is listed as "HDA Intel PCH" and the Chip as "Realtek ALC892".
Codecs.. I got most of the common ones installed, if that is what you want to know.
I'm talking about a laptop with built in speakers, but this also occurs when I got external speakers plugged in.

I've noticed this, when I was playing some Video on youtube and a gnome notification appeared.. instead of the usual tone, there was this ugly crackling. This also happens when I'm playing an audio file on some player and the gnome notification appears.. If I'm trying the gnome speaker testing thing while playing something, it also results in a crackling noise.
I just noticed that it does NOT happen, when I play something on youtube and an audio file at the same time.

Offline

#4 2013-10-05 15:43:46

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,743

Re: [SOLVED] Crackling sound with pulseaudio

Psylver wrote:

Codecs.. I got most of the common ones installed, if that is what you want to know.

Not quite. I meant hardware codecs.
What is the output of aplay -lL    (that is a lower case L followed by an upper case L)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#5 2013-10-05 15:49:27

Psylver
Member
From: Germany
Registered: 2010-06-10
Posts: 43

Re: [SOLVED] Crackling sound with pulseaudio

This is the output, I'm getting:

null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=PCH
    HDA Intel PCH, ALC892 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    Front speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    HDMI Audio Output
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Last edited by Psylver (2013-10-05 15:49:38)

Offline

#6 2013-10-05 15:59:21

xpander
Member
Registered: 2013-01-23
Posts: 56

Re: [SOLVED] Crackling sound with pulseaudio

can you try pulseaudio's simultaneous output.

pacman -S paprefs

open paprefs, go to Simultanous Output tab and enable it
then go to your volume control and change the output to Simultaneous and check if the sounds still crackling

also would be nice if you post your /etc/pulse/daemon.conf

Offline

#7 2013-10-05 16:00:17

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,743

Re: [SOLVED] Crackling sound with pulseaudio

That all looks rational.  Next, I would fire up pavucontrol and ensure that all the input sources are muted (like microphones).  Flip over to the configuration tab and try some different configurations.

You might also post the output of pulseaudio --dump-conf and I'll compare it to mine.

Again, I've no solid ideas, I am still just probing.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#8 2013-10-05 16:37:36

Psylver
Member
From: Germany
Registered: 2010-06-10
Posts: 43

Re: [SOLVED] Crackling sound with pulseaudio

xpander wrote:

can you try pulseaudio's simultaneous output.

pacman -S paprefs

open paprefs, go to Simultanous Output tab and enable it
then go to your volume control and change the output to Simultaneous and check if the sounds still crackling

also would be nice if you post your /etc/pulse/daemon.conf

I tried paprefs with the simultaneous output enabled and it was still doing that.

These are the contents of my daemon.conf:

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

exit-idle-time=0
; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

resample-method=src-sinc-best-quality
; resample-method=speex-float-0
; resample-method = speex-float-3
; enable-remixing = yes
; enable-lfe-remixing = no

; flat-volumes = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 1000000

; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

; default-fragments = 4
; default-fragment-size-msec = 25

; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0
ewaller wrote:

That all looks rational.  Next, I would fire up pavucontrol and ensure that all the input sources are muted (like microphones).  Flip over to the configuration tab and try some different configurations.

You might also post the output of pulseaudio --dump-conf and I'll compare it to mine.

Again, I've no solid ideas, I am still just probing.

I did not have pavucontrol installed.. I did so, muted the mic and tried some different settings.. but I still got no success.
As far as I saw, that output is the content of my daemon.conf which I postet above in this post.

No problem.. I'm glad you're trying to help. smile

Offline

#9 2013-10-05 18:02:33

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Crackling sound with pulseaudio

Try changing the resample method, you have changed it from the default so try with the default first.

https://bbs.archlinux.org/viewtopic.php?pid=1288881

Last edited by R00KIE (2013-10-05 18:04:40)


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#10 2013-10-05 18:37:57

Psylver
Member
From: Germany
Registered: 2010-06-10
Posts: 43

Re: [SOLVED] Crackling sound with pulseaudio

R00KIE wrote:

Try changing the resample method, you have changed it from the default so try with the default first.

https://bbs.archlinux.org/viewtopic.php?pid=1288881

Thanks to all of you.
This one fixed it.. Changing resample-method back to 

resample-method=speex-float-0

did the trick!

Offline

#11 2013-10-05 20:02:24

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Crackling sound with pulseaudio

Just be warned that speex-float-0 is the fastest and lowest quality from the speex-float-? resamplers. The default is speex-float-1 and I'd say that you could probably go a little higher with little cpu usage increase. Right now I'm using the default(1).

My problem with skype on the other thread turned out to be related to something else than the resampler but that was the workaround I found at the time. The problem was that PULSE_LATENCY_MSEC had to be set, that seems to be a known bug upstream, however it might also apply to other apps that output to pulse directly.

(1) Now I can't detect any artifacts when pulse needs to resample audio (maybe also because pulse can now switch to an alternate sampling rate) but a (long) while ago the default resampler (some speex-float) introduced quite noticeable artifacts, going to a speex-float resampler that was ok required too much cpu time, so I fiddled with the resampler and found that ffmpeg was a nice compromise. Since you had src-sinc-best-quality as the resampler you probably care about quality so do try other resamplers and see what works best for you.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#12 2013-10-06 13:52:50

Psylver
Member
From: Germany
Registered: 2010-06-10
Posts: 43

Re: [SOLVED] Crackling sound with pulseaudio

R00KIE wrote:

Just be warned that speex-float-0 is the fastest and lowest quality from the speex-float-? resamplers. The default is speex-float-1 and I'd say that you could probably go a little higher with little cpu usage increase. Right now I'm using the default(1).

My problem with skype on the other thread turned out to be related to something else than the resampler but that was the workaround I found at the time. The problem was that PULSE_LATENCY_MSEC had to be set, that seems to be a known bug upstream, however it might also apply to other apps that output to pulse directly.

(1) Now I can't detect any artifacts when pulse needs to resample audio (maybe also because pulse can now switch to an alternate sampling rate) but a (long) while ago the default resampler (some speex-float) introduced quite noticeable artifacts, going to a speex-float resampler that was ok required too much cpu time, so I fiddled with the resampler and found that ffmpeg was a nice compromise. Since you had src-sinc-best-quality as the resampler you probably care about quality so do try other resamplers and see what works best for you.

You are right. Since I've got decent speakers (and prefer using FLAC over mp3), I try to achieve good quality. I think, I'll stick to speex-float-7 for now.
Thank you

Offline

#13 2013-10-06 15:09:02

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Crackling sound with pulseaudio

Do note that pulse may not always resample, sometime ago it gainned the ability to just "copy" the stream as is when the input parameters match the default (or alternate) output settings, so it means that in some cases there can't be any quality loss and there isn't much cpu usage since it is not actually doing any resampling. Check the output of 'pactl list sink-inputs' and see for each stream if it is being resampled or just copied.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB