OpenELEC Forum
Crackling Sound ALSA on RPi2 (external USB card) - Printable Version

+- OpenELEC Forum (https://forum.openelec.tv)
+-- Forum: Generic Forum (https://forum.openelec.tv/forumdisplay.php?fid=5)
+--- Forum: AUDIO (https://forum.openelec.tv/forumdisplay.php?fid=53)
+--- Thread: Crackling Sound ALSA on RPi2 (external USB card) (/showthread.php?tid=75741)

Pages: 1 2


Crackling Sound ALSA on RPi2 (external USB card) - cpetry - 03-03-2015

Hi there!

I got some troubles with alsa audio. The sound heavily crackles and is running very slow.
When using Pi:HDMI everything is ok (but then I don't have 5.1 sound)...

Also I got two different settings I can choose:
- ALSA: USB Sound Device (@:CARD = Device, DEV=0), Analog
- ALSA: USB Sound Device (surround21:CARD = Device, DEV=0), Analog
But neither of them is running ok (surround is a bit "wider")

How can I fix this?


Crackling Sound ALSA on RPi2 (external USB card) - cpetry - 04-08-2015

Bump - I've still got these problems. Anyone got a solution?


Crackling Sound ALSA on RPi2 (external USB card) - blubserl - 04-13-2015

what are your audio settings?

when its crackling heavily i guess you have some heavy resampling going on? i also use an external dac and have output configuration "best match" selected.

if that doesn't help post a debug log


Crackling Sound ALSA on RPi2 (external USB card) - cpetry - 04-13-2015

I tried all possible options. "Best match" is my standard setting.

Here some warnings inside my System.log
Code:
[ 2.429370] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 2.522915] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[ 2.522937] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.525811] smsc95xx v1.0.4
[ 2.568921] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:67:6d:b5
[ 2.649303] usb 1-1.3: new full-speed USB device number 4 using dwc_otg
[ 2.722307] random: systemd urandom read with 79 bits of entropy available
[ 2.770786] usb 1-1.3: New USB device found, idVendor=045e, idProduct=0719
[ 2.770808] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2.770818] usb 1-1.3: Product: Xbox 360 Wireless Receiver for Windows
[ 2.770829] usb 1-1.3: Manufacturer: ©Microsoft
[ 2.770838] usb 1-1.3: SerialNumber: FE8905D0
[ 2.852650] usb 1-1.5: new full-speed USB device number 5 using dwc_otg
[ 2.957712] usb 1-1.5: New USB device found, idVendor=0d8c, idProduct=0102
[ 2.957749] usb 1-1.5: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 2.957764] usb 1-1.5: Product: USB Sound Device
[ 2.968909] input: USB Sound Device as /devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5:1.3/0003:0D8C:0102.0001/input/input0
[ 2.969537] hid-generic 0003:0D8C:0102.0001: input,hidraw0: USB HID v1.00 Device [USB Sound Device ] on usb-bcm2708_usb-1.5/input3
[ 3.164910] bcm2708_rng_init=afbf6000
[ 3.605653] systemd-journald[186]: Received request to flush runtime journal from PID 1
[ 4.074819] random: nonblocking pool is initialized
[ 4.845006] Console: switching to colour dummy device 80x30
[ 4.974874] usb 1-1.5: current rate 30464 is different from the runtime rate 96000
[ 5.000631] usb 1-1.5: Warning! Unlikely big volume range (=8065), cval->res is probably wrong.
[ 5.000662] usb 1-1.5: [9] FU [Mic Playback Volume] ch = 2, val = -6144/1921/1
[ 5.008851] usb 1-1.5: Warning! Unlikely big volume range (=8065), cval->res is probably wrong.
[ 5.008879] usb 1-1.5: [11] FU [Line Playback Volume] ch = 2, val = -6144/1921/1
[ 5.030106] usb 1-1.5: Warning! Unlikely big volume range (=6928), cval->res is probably wrong.
[ 5.030137] usb 1-1.5: [8] FU [Mic Capture Volume] ch = 2, val = -4096/2832/1
[ 5.033349] usb 1-1.5: Warning! Unlikely big volume range (=6928), cval->res is probably wrong.
[ 5.033379] usb 1-1.5: [15] FU [Line Capture Volume] ch = 2, val = -4096/2832/1
[ 5.036886] usb 1-1.5: Warning! Unlikely big volume range (=6928), cval->res is probably wrong.
[ 5.036916] usb 1-1.5: [2] FU [PCM Capture Volume] ch = 2, val = -4096/2832/1
[ 5.038352] usbcore: registered new interface driver snd-usb-audio
[ 5.354839] input: Xbox 360 Wireless Receiver as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/input/input1
[ 5.369035] input: Xbox 360 Wireless Receiver as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.2/input/input2
[ 5.371506] input: Xbox 360 Wireless Receiver as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.4/input/input3
[ 5.379936] input: Xbox 360 Wireless Receiver as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.6/input/input4
[ 5.381717] usbcore: registered new interface driver xpad
[ 5.683225] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 5.683990] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 7.229748] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 7.233756] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[ 69.328524] Transfer to device 4 endpoint 0x7 frame 1753 failed - FIQ reported NYET. Data may have been lost.
[ 76.822510] Transfer to device 4 endpoint 0x5 frame 1054 failed - FIQ reported NYET. Data may have been lost.
[ 76.822610] Transfer to device 5 endpoint 0x1 frame 1054 failed - FIQ reported NYET. Data may have been lost.
[ 83.047867] Transfer to device 4 endpoint 0x3 frame 1135 failed - FIQ reported NYET. Data may have been lost.
[ 85.167619] Transfer to device 4 endpoint 0x5 frame 1206 failed - FIQ reported NYET. Data may have been lost.
[ 85.167714] Transfer to device 5 endpoint 0x1 frame 1206 failed - FIQ reported NYET. Data may have been lost.
[ 92.304581] Transfer to device 4 endpoint 0x1 frame 150 failed - FIQ reported NYET. Data may have been lost.
[ 92.304683] Transfer to device 5 endpoint 0x1 frame 150 failed - FIQ reported NYET. Data may have been lost.
[ 94.808918] Transfer to device 4 endpoint 0x1 frame 606 failed - FIQ reported NYET. Data may have been lost.
[ 94.809035] Transfer to device 5 endpoint 0x1 frame 606 failed - FIQ reported NYET. Data may have been lost.
[ 94.904950] Transfer to device 4 endpoint 0x3 frame 702 failed - FIQ reported NYET. Data may have been lost.
[ 94.905063] Transfer to device 5 endpoint 0x1 frame 702 failed - FIQ reported NYET. Data may have been lost.
[ 103.130025] Transfer to device 4 endpoint 0x1 frame 734 failed - FIQ reported NYET. Data may have been lost.
[ 103.130144] Transfer to device 5 endpoint 0x1 frame 734 failed - FIQ reported NYET. Data may have been lost.
[ 108.707212] Transfer to device 4 endpoint 0x1 frame 166 failed - FIQ reported NYET. Data may have been lost.
[ 117.195997] Transfer to device 4 endpoint 0x3 frame 462 failed - FIQ reported NYET. Data may have been lost.
[ 117.196446] Transfer to device 5 endpoint 0x1 frame 463 failed - FIQ reported NYET. Data may have been lost.
[ 136.630494] Transfer to device 4 endpoint 0x7 frame 1462 failed - FIQ reported NYET. Data may have been lost.
[ 136.630622] Transfer to device 5 endpoint 0x1 frame 1462 failed - FIQ reported NYET. Data may have been lost.
[ 142.087219] Transfer to device 4 endpoint 0x3 frame 774 failed - FIQ reported NYET. Data may have been lost.
[ 142.087331] Transfer to device 5 endpoint 0x1 frame 774 failed - FIQ reported NYET. Data may have been lost.
[ 142.423259] Transfer to device 4 endpoint 0x3 frame 1110 failed - FIQ reported NYET. Data may have been lost.
[ 142.423362] Transfer to device 5 endpoint 0x1 frame 1110 failed - FIQ reported NYET. Data may have been lost.
[ 199.294851] Transfer to device 4 endpoint 0x5 frame 630 failed - FIQ reported NYET. Data may have been lost.
[ 199.295025] Transfer to device 5 endpoint 0x1 frame 630 failed - FIQ reported NYET. Data may have been lost.
[ 271.056408] Transfer to device 4 endpoint 0x1 frame 702 failed - FIQ reported NYET. Data may have been lost.
[ 271.056525] Transfer to device 5 endpoint 0x1 frame 702 failed - FIQ reported NYET. Data may have been lost.

################################################################################
# ... output of lsmod
# OpenELEC release: RPi2.arm-5.0.8
#
################################################################################
Module Size Used by
xpad 12209 0
snd_usb_audio 97802 2
snd_hwdep 4857 1 snd_usb_audio
snd_usbmidi_lib 17407 1 snd_usb_audio
snd_rawmidi 15374 1 snd_usbmidi_lib
snd_pcm 60222 2 snd_usb_audio
snd_timer 16287 2 snd_pcm
snd 38962 8 snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_rawmidi,snd_usbmidi_lib
bcm2708_rng 801 0

Here my Audio.log
Code:
################################################################################
# ... output of aplay -l
# OpenELEC release: RPi2.arm-5.0.8
#
################################################################################
**** List of PLAYBACK Hardware Devices ****
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0

################################################################################
# ... output of aplay -L
# OpenELEC release: RPi2.arm-5.0.8
#
################################################################################
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Device
USB Sound Device, USB Audio
Default Audio Device
sysdefault:CARD=Device
USB Sound Device, USB Audio
Default Audio Device
front:CARD=Device,DEV=0
USB Sound Device, USB Audio
Front speakers
surround21:CARD=Device,DEV=0
USB Sound Device, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device,DEV=0
USB Sound Device, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
USB Sound Device, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
USB Sound Device, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
USB Sound Device, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
USB Sound Device, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
USB Sound Device, USB Audio
IEC958 (S/PDIF) Digital Audio Output

################################################################################
# ... output of amixer
# OpenELEC release: RPi2.arm-5.0.8
#
################################################################################

And the last lines of my Kodi.log
Code:
13:27:26 T:1633002560 NOTICE: Thread DVDPlayer start, auto delete: false
13:27:26 T:1633002560 NOTICE: Creating InputStream
13:27:28 T:1633002560 NOTICE: Creating Demuxer
13:27:30 T:1633002560 NOTICE: Opening stream: 0 source: 256
13:27:30 T:1633002560 NOTICE: Creating video codec with codec id: 13
13:27:30 T:1633002560 NOTICE: Creating video thread
13:27:30 T:1655698496 NOTICE: Thread DVDPlayerVideo start, auto delete: false
13:27:30 T:1633002560 NOTICE: Opening stream: 1 source: 256
13:27:30 T:1655698496 NOTICE: running thread: video_thread
13:27:30 T:1633002560 NOTICE: Finding audio codec for: 86019
13:27:30 T:1633002560 NOTICE: Creating audio thread
13:27:30 T:1647309888 NOTICE: Thread DVDPlayerAudio start, auto delete: false
13:27:30 T:1647309888 NOTICE: running thread: CDVDPlayerAudio::Process()
13:27:30 T:1647309888 ERROR: CDVDPlayerAudio::DecodeFrame - Decode Error. Skipping audio packet (-1094995529)
13:27:30 T:1647309888 NOTICE: Creating audio stream (codec id: 86019, channels: 6, sample rate: 48000, no pass-through)
13:27:30 T:1802093632 NOTICE: 1Channel: Service: Playback started
13:27:30 T:1655698496 NOTICE: fps: 25.000000, pwidth: 720, pheight: 304, dwidth: 720, dheight: 304
13:27:30 T:1655698496 NOTICE: Display resolution DESKTOP : 1920x1080 (1920x1080) @ 60.00 - Full Screen (16)
13:27:31 T:1970262560 NOTICE: CDVDPlayer::CloseFile()
13:27:31 T:1970262560 NOTICE: DVDPlayer: waiting for threads to exit
13:27:31 T:1633002560 NOTICE: CDVDPlayer::OnExit()
13:27:31 T:1633002560 NOTICE: Closing stream player 1
13:27:31 T:1633002560 NOTICE: Waiting for audio thread to exit
13:27:31 T:1647309888 NOTICE: thread end: CDVDPlayerAudio::OnExit()
13:27:31 T:1633002560 NOTICE: Closing audio device
13:27:31 T:1633002560 NOTICE: Deleting audio codec
13:27:31 T:1633002560 NOTICE: Closing stream player 2
13:27:31 T:1633002560 NOTICE: waiting for video thread to exit
13:27:32 T:1655698496 NOTICE: thread end: video_thread
13:27:32 T:1633002560 NOTICE: deleting video codec
13:27:32 T:1970262560 NOTICE: DVDPlayer: finished waiting
13:27:32 T:1802093632 NOTICE: 1Channel: Service: Playback Stopped
13:27:32 T:1802093632 NOTICE: 1Channel: Service: Resetting...
13:27:32 T:1676670016 NOTICE: Thread BackgroundLoader start, auto delete: false
13:27:33 T:1970262560 NOTICE: CDVDPlayer::CloseFile()
13:27:33 T:1970262560 NOTICE: DVDPlayer: waiting for threads to exit
13:27:33 T:1970262560 NOTICE: DVDPlayer: finished waiting
13:27:33 T:1970262560 NOTICE: CDVDPlayer::CloseFile()
13:27:33 T:1970262560 NOTICE: DVDPlayer: waiting for threads to exit
13:27:33 T:1970262560 NOTICE: DVDPlayer: finished waiting

It now (since the last updates) sounds more like a crackling echo of the original sound.
Perhaps something with the volume range? Could it be that openelec isn't correctly initializing my soundcard?


Crackling Sound ALSA on RPi2 (external USB card) - blubserl - 04-13-2015

hmm...yes these warnings look suspicious imho. maybe a dev can say something on this topic...
it looks like you are playing a video file... does this happen with mp3 files as well? are you playing a local file or over the network?


Crackling Sound ALSA on RPi2 (external USB card) - cpetry - 04-13-2015

This only happens when playing video files. MP3s are ok. No problem there.
I'm playing files attached to a NAS over network. It's attached via ethernet cable... so there shouldn't be a problem there.


Crackling Sound ALSA on RPi2 (external USB card) - blubserl - 04-13-2015

well... it seems the dts stream is causing the problem here:

Code:
NOTICE: Creating audio stream (codec id: 86019, channels: 6, sample rate: 48000, no pass-through)

dts can't be hardware decoded on the raspberry pi and the processor of the pi2 is still too weak. your options are passthrough and decoding through an external receiver (if available) or converting the audiostream of your video files


Crackling Sound ALSA on RPi2 (external USB card) - cpetry - 04-14-2015

Strangely, I got it working for a while. Just restarted my pi and everything went fine for some seconds.
Then it slowly started to get worse and after stopping and again playing the same movie the problems got worse.
At first the sound in the menu was ok. After playing back some movie even that had crackling.

So I think it's not the problem with DTS...


Stuttering on RPi with Wilson Audio Card (ALSA) - maestroji - 04-15-2015

I read with keen interest the earlier discussions and I am prompted to seek your helpful advice.
I am using the original RPi B with Wilson Audio Card.
Recently I was provided a link to a DSD Audio File (David Elias - The Window) by a very kind blogger.
The RPi plays this file, however, the output staggers and crackles.
I am attaching the debug file.
[attachment=2177]log-2015-04-15-08.09.11.zip[/attachment]
Any advice and suggestions from you on overcoming this problem is greatly appreciated.
Thank you.


Crackling Sound ALSA on RPi2 (external USB card) - cpetry - 04-28-2015

Bump - no one has an idea? :dry: