Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio quality degrades randomly? #26

Open
3 of 4 tasks
mobeets opened this issue Nov 29, 2019 · 11 comments
Open
3 of 4 tasks

audio quality degrades randomly? #26

mobeets opened this issue Nov 29, 2019 · 11 comments
Labels
bug Something isn't working

Comments

@mobeets
Copy link
Owner

mobeets commented Nov 29, 2019

things to check:

  • the cheap usb interface?
  • clipping because signal too hot?
  • my shitty speaker?
  • something to do with alsamixer?

edit: sometimes it was the signal being too hot. but most of the time it's because of silent xruns.

@mobeets mobeets added the bug Something isn't working label Nov 29, 2019
@mobeets
Copy link
Owner Author

mobeets commented Nov 30, 2019

I think it's at least sometimes the signal being too hot. so turning down the volume of the input signal should often help this.

@mobeets
Copy link
Owner Author

mobeets commented Dec 8, 2019

Okay, added input/output gain control in #34, which I'm pretty sure was always the cause of the problem anyway.

@mobeets mobeets closed this as completed Dec 8, 2019
@mobeets mobeets reopened this Dec 9, 2019
@mobeets
Copy link
Owner Author

mobeets commented Dec 9, 2019

clues:

  • it's not SL, because the quality is shit in audacity too
  • restarting jack fixes the issue, but so does just waiting for a while
  • it's not my speakers, because if I just play directly through them it's fine
  • it's not the audio output, because if I play audio recorded prior to the beginning of the fuzziness it sounds just fine

so these clues lead me to think that it is somehow related to jack, and specifically the audio in part.

@mobeets
Copy link
Owner Author

mobeets commented Dec 10, 2019

I think the key was changing the jack period to '-n 3' because apparently usb interfaces tend to prefer that.

seemed to work...maybe?

@mobeets mobeets closed this as completed Dec 10, 2019
@mobeets
Copy link
Owner Author

mobeets commented Dec 11, 2019

Okay, so it's back to doing it. I had removed the '-s' and it gave me xruns even with just 4 tracks. So then I added back '-s' and eventually the crackling returned.

My current best guess: the '-s' softmode option prevents the xruns being reported, which preserves the looper working. but then once the xruns happen, the audio degrades. no idea if this is right but that's my best guess.

@mobeets mobeets reopened this Dec 11, 2019
@mobeets
Copy link
Owner Author

mobeets commented Dec 11, 2019

from this link here I think I'm probably correct: xruns cause crackling.

so I should increase the -p to 1024, resulting in more latency.
or I can try to disable other processes, like networking, or maybe try overclocking?

@mobeets
Copy link
Owner Author

mobeets commented Dec 11, 2019

need to check cpu/ram usage (with top -u mpd maybe?) to see if this is related to the issue. if so, I can try overclocking, and turning off unneeded processes.

https://www.runeaudio.com/forum/tweaking-the-audio-performance-rpi3-t4301-30.html

@mobeets
Copy link
Owner Author

mobeets commented Dec 13, 2019

nothing suspicious in top.

while working:
Screen Shot 2019-12-12 at 8 13 18 PM

and again, during the xruns:
Screen Shot 2019-12-12 at 8 16 49 PM

@mobeets
Copy link
Owner Author

mobeets commented Dec 15, 2019

when playing with jess, it always happened to us (the fuzziness) when we got to the fourth track (i.e., three saved, playing on the fourth). so possibly it's like jack not processing quickly enough once SL is using more RAM. so I'm gonna guess it's a ram issue?

if so, does setting a shorter max_loop_length param decrease memory demands?

@mobeets
Copy link
Owner Author

mobeets commented Dec 21, 2019

okay, so actually I think it's a CPU issue. as you record more loops in SL, the CPU usage grows (but MEM does not):

before:
Screen Shot 2019-12-20 at 8 46 09 PM

after (with four loops):
Screen Shot 2019-12-20 at 8 47 18 PM

then, clearing the loops decreases CPU.

I did two fixes, which helped me get to four loops without immediate crackling:

  • changed SL's max loop length from 40 secs to 20 secs
  • booting the pi without a desktop GUI (though I might actually need this to run jack since dbus is built in, apparently)

@mobeets
Copy link
Owner Author

mobeets commented Feb 1, 2024

here's the situation: audio crackling happens when you call jackd with -s. the crackling happens because there are xruns, and jack is ignoring them. if you instead try calling jackd without the -s, you will be able to see all the xruns, but then it will block audio entirely and the looper will not work at all.

so the reality is, it's best to run jackd with -s and deal with the resulting (occasional) audio crackling.

i've tried to run jack with a large buffer size, so -p 1024 and -n 3, and --no-realtime. but still, this happens occasionally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant