kdoren / jambox-pi-gen

Start jamming online easily with a Raspberry Pi, an audio interface, and this free Jambox image file. Just download/burn/boot/jam. Choose from multiple jamming apps: Jamulus, SonoBus, JackTrip, JamTaba, JammerNetz or HpsJam. User interface is any web browser on same local network. Pre-built image file is available under "Releases".
BSD 3-Clause "New" or "Revised" License
75 stars 9 forks source link

Recurring buzz saw on microphone #71

Closed ve3meo closed 2 years ago

ve3meo commented 3 years ago

I have 3 USB audio adapters, two of which are compatible with JamBox: they are a Trond AC2 and a plugable(tm) USB-AUDIO. The third, a Trond AC3, has a problem with JamBox that it does not on Raspbian: a cyclic buzz-saw interference to the microphone audio that recurs with a period of maybe 100 seconds and persists for 10 or so. The audio becomes distinctly non-musical with strange alias distortion artifacts as though there were multiple sampling frequencies (some very low) in effect. It is present not only in Jamulus but also in Audacity and was evident when I first set up JamBox a month or so ago and again with the latest version. I installed Audacity and Jamulus on a Raspbian card and the problem is gone (although I have not got the latency down to what JamBox provides).

This isn't a big issue for me because the adapter is not providing sufficient mic gain for what I have (none of them do); likewise, the headphone outputs are a bit weak. However, this problem may point to an underlying fault that might affect others.

kdoren commented 3 years ago

@ve3meo Thanks for reporting. I've seen something like this in the past, and in that case, the remedy was to increase NPERIODS in /etc/jackdrc.conf. I also have a theory that somehow frames were getting swapped, maybe by a device that doesn't work quite right with PERIOD=64, in which case going to PERIOD=128 might help.

Things to try:

  1. increase NPERIODS in /etc/jackdrc.conf
  2. in /etc/jackdrc.conf, set PERIOD to 128 and reduce NPERIODS (i.e. to 4, or even 5 if there is still distortion).
CAguayo commented 3 years ago

This is exactly what I was seeing with the Aluratek USB headset on jambox, and I would swear that I tried this suggested fix, and saw no improvement. I had given up on the Aluratek headset, but could re-test the suggested fix if that is helpful.

I would think the levels could be adjusted with the Audio Device Settings app.

Carlos

On Fri, Mar 26, 2021 at 9:24 AM Kevin Doren @.***> wrote:

@ve3meo https://github.com/ve3meo Thanks for reporting. I've seen something like this in the past, and in that case, the remedy was to increase NPERIODS in /etc/jackdrc.conf. I also have a theory that somehow frames were getting swapped, maybe by a device that doesn't work quite right with PERIOD=64, in which case going to PERIOD=128 might help.

Things to try:

  1. increase NPERIODS in /etc/jackdrc.conf
  2. in /etc/jackdrc.conf, set PERIOD to 128 and reduce NPERIODS (i.e. to 4, or even 5 if there is still distortion).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kdoren/jambox-pi-gen/issues/71#issuecomment-808348854, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKJTEZZEMYSWQXBWSUXBNTTFSYM5ANCNFSM4Z3QCGNQ .

ve3meo commented 3 years ago

@kdoren I tried a variety of PERIOD and NPERIOD settings but cannot eliminate the problem. One affects the interval between attacks, the other the duration. It has to be something more fundamental that is different between your image and what I got from installing on Raspbian. Both using JACK. On the latter, PERIODS is 128 and NPERIODS 2 but those settings still suffer on JamBox.

ve3meo commented 3 years ago

I would think the levels could be adjusted with the Audio Device Settings app.

@CAguayo they can but 100% is not enough.

kdoren commented 3 years ago

@ve3meo in Jambox, jack is jackd2 variant, and newer version. It runs a very high priority, with realtime kernel, to avoid xruns. This should all be good, but maybe there is a case where it is not. in /etc/jackdrc.conf, there is a setting JACK_PRIORITY=95. With PERIOD=128 you might want to try lowering JACK_PRIORITY (maybe to 90 or even 50). Don't comment it out, or it will default to 95. There is also a setting JAMULUS_PRIORITY=40,, you might comment out this line to see if it helps.

ve3meo commented 3 years ago

Tried JACK_PRIORITY=50 to no avail; Likewise after commenting out JAMULUS_PRIORITY which is unsurprising because the buzz-saw affects Audacity recording from the microphone.

kdoren commented 2 years ago

I believe this may have been caused by the use of the jack "-s" (softmode) argument in Jambox 1.3 and earlier versions. I removed this argument in Jambox 1.4 and later, which has fixed this and similar problems.