Resampling problem 44.1 kHz 48 kHz?
Moderators: MattKingUSA, khz
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Resampling problem 44.1 kHz 48 kHz?
Hi,
I recently had a (unsolved) problem with distorted sounds while playing youtube videos via ALSA -> LOOP -> Jack
The thread can be found here: viewtopic.php?f=47&t=16537 if someone is interested.
I have KXStudio running and my interface is a ZOOM R8 which is set to 48 kHz, cause with 44.1 kHz I get crackling sounds with all Jack settings I tested. At least now I could limit the problem a bit more:
1. Here you hear frequency sweep played via youtube (see below) and recorded via audacity with a jack setting of 48 kHz (interface also set to 48 kHz)
http://vocaroo.com/i/s1XX3GNhW5Vg (please open in new window)
It's not a pure sine tone as there are overtones overlayed. Here's the frequency distribution:
2. The same done with a Jack setting of 44.1 kHz (interface still set to 48 kHz)
http://vocaroo.com/i/s1h6xUw0jvyZ
The sound now seems ok, but I here sporadic crackling. The freq distribution also looks ok. As I wrote setting the interface to 44.1 kHz is not a solution as I was not able to get rid of the crackling at all.
The freq sweep can be found here: https://www.youtube.com/watch?v=qNf9nzvnd1k
I recorded second 20 - ~35.
I really would appreciate if someone can help to solve this annoying issue or at least understands what's going on here.
btw: The two audio files played through firefox now have both distortions. Played via clementine the 44.1 kHz version has crackles and the 48 kHz has distortion.
I recently had a (unsolved) problem with distorted sounds while playing youtube videos via ALSA -> LOOP -> Jack
The thread can be found here: viewtopic.php?f=47&t=16537 if someone is interested.
I have KXStudio running and my interface is a ZOOM R8 which is set to 48 kHz, cause with 44.1 kHz I get crackling sounds with all Jack settings I tested. At least now I could limit the problem a bit more:
1. Here you hear frequency sweep played via youtube (see below) and recorded via audacity with a jack setting of 48 kHz (interface also set to 48 kHz)
http://vocaroo.com/i/s1XX3GNhW5Vg (please open in new window)
It's not a pure sine tone as there are overtones overlayed. Here's the frequency distribution:
2. The same done with a Jack setting of 44.1 kHz (interface still set to 48 kHz)
http://vocaroo.com/i/s1h6xUw0jvyZ
The sound now seems ok, but I here sporadic crackling. The freq distribution also looks ok. As I wrote setting the interface to 44.1 kHz is not a solution as I was not able to get rid of the crackling at all.
The freq sweep can be found here: https://www.youtube.com/watch?v=qNf9nzvnd1k
I recorded second 20 - ~35.
I really would appreciate if someone can help to solve this annoying issue or at least understands what's going on here.
btw: The two audio files played through firefox now have both distortions. Played via clementine the 44.1 kHz version has crackles and the 48 kHz has distortion.
- Attachments
-
- 441khz.png (32.29 KiB) Viewed 2174 times
-
- 48khz.png (32.52 KiB) Viewed 2174 times
Last edited by lilith on Mon Dec 25, 2017 12:03 am, edited 1 time in total.
- sadko4u
- Established Member
- Posts: 989
- Joined: Mon Sep 28, 2015 9:03 pm
- Has thanked: 2 times
- Been thanked: 361 times
Re: Resampling problem 44.1 kHz 48 kHz?
Do you have speech-dispatcher running/installed?
If yes, please try to disable it.
If yes, please try to disable it.
LSP (Linux Studio Plugins) Developer and Maintainer.
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Re: Resampling problem 44.1 kHz 48 kHz?
The frequency I recorded is quite low (~ 30 Hz), that's why it looks a bit strange. But when you listen to the audio files with headphones you can hear it.Question. Don't understand the grafic.
All are under minus 50 db. Beneath about minus 10db no one can hear it? Ain't it?
I just made some more tests:
I booted from the KXStudio ISO file and get the same issues. Then I switched to a laptop and booted from the ISO and again -> same issues. Then I played around and sometimes it's not really reproducible, i.e. changing the sampling rate makes no difference. Something seems to stuck at the old parameters. Sometimes it works, sometimes I get extreme distortion, etc. What I found out: It makes a difference if in jack the interface is set to duplex mode or not. With duplex mode off I get no distortions but crackling at 48 kHz and distortion at 44.1 kHz. With duplex mode it's the other way around (as written above). But this works only if I switch from duplex to non-duplex after booting. Changing it a second time makes no difference.
I also tested a ESI DAC nano with the laptop and had similar problems. Changing USB ports makes also no difference.
It only happens when playing music through the browser. Is it possible that it is due to some values in .asoundrc or would it help to use pulseaudio instead? Sorry for not being more clear, it's just not reproducible always.
What also strange: When I set my interface in jack to "hw:HDMI,7 [HDMI 1]" for example I still get sound from the Zoom R8, so it seems that still the R8 is taken although it's disabled.
- Attachments
-
- jack.png (147.45 KiB) Viewed 2132 times
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Re: Resampling problem 44.1 kHz 48 kHz?
I just recorded the stream to show what the problem is. When I (only) listen to music in youtube I get crackles or distortion.
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Re: Resampling problem 44.1 kHz 48 kHz?
The problem has to do with the alsa -> jack bridge I guess, because it only happens when using firefox. When I download the file and play it through clementine or smplayer it sounds fine at 48kHz, i.e. without distortion. While in Firefox I get distortion. At 44.1 kHz however I get crackings in youtube and in smplayer, but no distortion. I think these two problems are not related. The crackles seem to be interface related, however I get them also with the ESI DAC nano. The distortion has clearly something to to with this alsa bridge or firefox.
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Re: Resampling problem 44.1 kHz 48 kHz?
The problem is present when listening to youtube videos / music with audible frequencies. Everything sounds metallic and slightly distorted. I have it with 2 PCs and with the KXStudio ISO image. Also appears with Chromium as browser. I'll try the AVLinux image now if it's also present there.
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Re: Resampling problem 44.1 kHz 48 kHz?
I am online with an ISO image of AVLinux and .... tataaaaaaa... the same. Either I get distortion while playing youtube videos or I get crackling depending on the sampling rate I choose in Jack. I just downloaded the a youtube file and when paying it through a media player there is no crackling and no distortion. What I did not get, what is the difference between playing directly via youtube and downloading the file and playing it with a media player?
So, is the problem my interface or is it youtube and resampling? I mean the latter should basically affect everyone ..
@falkTX could you give me a hint how do get zita running and how to install it?
So, is the problem my interface or is it youtube and resampling? I mean the latter should basically affect everyone ..
@falkTX could you give me a hint how do get zita running and how to install it?
-
- Established Member
- Posts: 1067
- Joined: Mon May 12, 2014 7:11 am
- Has thanked: 15 times
- Been thanked: 36 times
Re: Resampling problem 44.1 kHz 48 kHz?
My guess is that the media player uses jack directly and Firefox goes via alsa and then to jack.
Btw, I've never understood the alsa - > loop-> jack thing and use alsa - > jack (always on) thing. but that's another topic
Btw, I've never understood the alsa - > loop-> jack thing and use alsa - > jack (always on) thing. but that's another topic
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Re: Resampling problem 44.1 kHz 48 kHz?
It also happens with the internal onboard sound card, so it's not related to the interface.
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Re: Resampling problem 44.1 kHz 48 kHz?
I reproduced it with Audacity. Generated a sine signal and when choosing ALSA as output, I get crackling. When choosing Jack Audio Connection Kit everything is fine. When stopping Jack and the Alsa Jack Bridge and choosing Alsa in Audacity and the Zoom R8 as Output device everything sounds fine.
Alsa -> Zoom R8 : works
Alsa -> AloopPlayback : crackles
Jack -> System : works
So, the problem lies somewhere in the setting of bridge and is not related to the interface.
Alsa -> Zoom R8 : works
Alsa -> AloopPlayback : crackles
Jack -> System : works
So, the problem lies somewhere in the setting of bridge and is not related to the interface.
- lilith
- Established Member
- Posts: 1706
- Joined: Fri May 27, 2016 11:41 pm
- Location: bLACK fOREST
- Has thanked: 122 times
- Been thanked: 57 times
- Contact:
Re: Resampling problem 44.1 kHz 48 kHz?
This basically solved my problemfalkTX wrote:there's an option to use zita-a2j/j2a instead of alsa_in/out, which in theory provides better resampling.
also note that resampling quality for the cadence aloop bridge is the almost minimum quality, in order to reduce cpu load (because it will likely be running all the time).
I should add an option there to configure quality...
All I did was:
Code: Select all
sudo apt-get install zita-ajbridge
It's seems a bit buggy as sometimes I have to restart my interface / kill cadence to get it running but it's doing the job.
Thanks!