Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home

jorgenmodin.net - Blog

Latency down to 34ms with soft mode and "no memory lock" — jackd raspberry pi

Posted by admin |

So I am trying out a Raspberry Pi 3B+ as a headphones protector, running a cheap USB sound card in duplex mode and sound processing being done in Rakarrack. The sound system hanged a lot with "xrun" error messages, even with very conservative sizes of buffer (lots) and sampling frequency (low).

By selecting "no memory lock" those hangs disappeared and were replaced with clicking sounds when the runs happened.

I then ticked "soft mode" and the clicks disappeared. I can now run with low latency, currently 34ms. Since this is for headphone minitoring I don't mind if samples get dropped; it's not for recording.

Maybe I should try to put memory lock back… Anyway, great performance progress!

Update 2019-03-07 I put memory lock back, seems to work fine, so it was the soft mode that made the difference.

Mar 06, 2019 09:55

Proof of concept of a headphones sound protector w. Jack & Linux

Posted by admin |

I am trying to build a headphones audio processor with Linux, and today I got a proof of concept running. It's not running on a Raspberry pi yet, but I tried it on a laptop. An equalizer and a compressor was applied to the signal, and the processed version came out with a barely noticeable delay.

Hardware used

  • An Acer laptop
  • An old Philips USB sound card that came with a pair of headphones many years ago. It has a mic input and a headphone output. A cheap audio interface like Xenyx 302 USB is a worse choice here, since it plays the input sound over the USB mix.

Software used

  • Ubuntu Linux 18.04
  • Ubuntu Studio components including Rakarrack
  • Low latency kernel

Setup and problems

The laptop refused to switch to the USB sound card. The solution was to kill jackd, and start it from the command line. I have no idea how jackd is automatically started by the way. It's not reachable by service or systemctl. Start it up indicating the sound card to be used. I think the problem is that qJackCtl never managed to modify or restart jackd, it just pretended.

Rakarrack, a guitar effects host, is more stable than Jack Rack so I used that.

In qJackCtl, patches would already be correctly set up by Rakarrack.

Modify the rack in Rakarrack to contain an equalizer and a compressor.

The sound of the mic input on the card should now be routed through Rakarrack to the headphones output. At least it did for me.

Next step will be to get this running on a raspberry pi! That means an Arm version of all this.

Mar 04, 2019 11:20

One more youtube favorite on video & sound: Potato Jet

Posted by admin |

I've only watched two so far but his guests are really knowledgeable, for example in this video on lighting:

https://www.youtube.com/watch?v=iiUTTk67kXE&t=683s

Mar 04, 2019 12:32

Cheap voice compressors that do not take up too much space

Posted by admin |

Ready-built

ART Tube MP/C

Looks cool. ~€110. This one's possibly made for guitars, not sure. No headphones output.

Behringer Xenyx Q502USB

This is a mixer, and audio interface. But it has a compressor and tone controls and it's the cheapest on this list by far! €45. Headphones output!

Rolls CL 151

On-line reviews seem to indicate that people either hate this one or tolerate it. It seems to have a non-standard behaviour. ~€130

No headphones output.

Amazon.com: Peavey HB2 Headphone Amplifier

This looks great but I think it's discontinued. The HB2 is specifically made for headphones listenting, I guess for a live band member so that he can hear the others clearly without suffering the ill effects of sudden bursts. This is the closest to my use case.

Semi-built

SSM 2167 pre-built

SSM2167 Microphone Preamplifier Board Low Noise COMP Compression Module DC 3V 5V-in Replacement Parts & Accessories from Consumer Electronics on Aliexpress.com | Alibaba Group ~€3

This one will give you 30dB (I think) of gain that you maybe didn't want, and I am unsure of how to desolder or switch in components for changing compression and limiting.

Teensy audio

The audio card for the Teensy SOC. The audio chip has built in compression possibilities, so can be switched on and configured in two lines of code. ~€20 + ~€20 for the Teensy + cabinet and knobs. This is a powerful solution with I guess close to instaneous boot times. But it does mean you have to do 28 solders, and use the arduino IDE with at least a few lines of C code. Having done that though, you can deploy different kinds of code.

Raspberry Pi + Jack + Rakarrack or similar

A Raspberry Pi with JACK and a USB audio interface ~€50 + cabinet and (possibly USB) knobs. This is the easiest semi-built option by far, since it requires no soldering or mounting of other components. JACK can patch any sound input or ouput to and from any JACK-compatible software. When JACK is installed you can use different plugin hosts to drag-and-drop a sound processing chain from your sound card's input to its output. One such plugin host is Rakarrack. Remember to use a low latency Linux kernel and to prioritize audio.

The more I think of it, the more I like this solution: You can prototype on your normal laptop or desktop Linux machine, there is a plethora of ready-made effects of which some are of high quality such as in my experience the Calf compressor. And there are hundreds of more plugins.

The things that I am wary of is how quickly it would boot and how stable it will be in practice. Also, although it's no harder than any other option in this section, what kind of user interface you will want to have. You could go with a touch screen, with potentiometers directly wired to the Pi's inputs or with a USB controller. I'm gonna do this one! At least prototype it on a laptop.

Roll your own

SSM2166SZ Microphone Amplifier IC SO-14 Analog Devices

SSM2166 - more configurable than the previously mentioned 2167. It has a a limiter and compressor built in that are easily configurable. But there are no breakout boards for the 2166 afaict, and it only comes as a surface mount component. Although of the soldering-is-humanly-possible surface mount component kind.

Conclusion

Well, all the above options exist for a reason, but I'd recommend the Behringer or the Raspberry. Unless you are a serious tech-head and might think of selling your work to others.

 

Mar 03, 2019 01:45

Zoom H5 — first gripes from first impressions

Posted by admin |

Let me first say that I like the Zoom H5 audio recorder and USB audio interface. But since it easier in the beginning, and I got it yesterday, to find some things you would like to be better, I'll start with some gripes:

  1. The headphone volume buttons. These should have been a knob instead I believe. The reason being that with a knob you can more quickly turn the volume down, if by mistake something loud is coming in.
     
  2. The headphone output makes a slight pop sound on each change in volume. It's probably not loud but I will check that with my other sound card, because our brains are not good at estimating the volume of short (<<100ms) noises.
     
  3. Unclear when it's running on USB when set to be in recording mode. I eventually made sure it was indeed running on USB juice, by simply removing the batteries and it booted up without them. There is a setting to control this when used as a sound card, but not afaict when used as a recorder.

    But it seems to run fine on USB when in recording mode. Maybe the heuristics are that if you plug in a cable when in in recording mode, it's for that sweet sweet USB juice, since there is no other reason to have USB in that mode.
     
  4. The weird bursts of random noise incident. After transferring the files to my PC, all recording had bursts of noise and hiss at maximum volume. I returned the SD card and upgraded the firmware from 2.0 to 2.10. One of those things fixed it. Or possibly a combination of them. Internet said, from what little I could find that it could either be a problem with PulseAudio (I run Linux) or with the card.

    For all I know it could have been a problem with PulseAudio still, but I did convert the files to FLAC from WAV with ffmpeg and the problem persisted. But I guess still don't know for sure!
    Actually, these burst were clearly visible in Audacity, so it cannot have been a Pulseaudio problem. Phew. And now I found a file from the old card, and it still has the bursts. So there.

    I tried the files with Audacity, VLC and aplay. Same problem everywhere. Maybe Zoom used a non standard WAV format for a while?
     
  5. The menu selector button has edges that are a bit too sharp. Minor gripe.
Feb 27, 2019 10:25

Cheap directional condenser mics for voice use - some ideas

Posted by admin |

I'm thinking of getting an affordable directional condenser mic for use as a boom mic but also as a general voice mic. It would be nice if it is switchable to different polar patterns. Ideally I'd like to pay around €50, but two of the below ones are more expensive.

AKG C1000S MkIV

Around €90. AKG C1000s MKIV The AKG C1000S is a classic condenser microphone, that gets a surprising amount of hate on the Internet, including from some people who have actually used it. The only mic I've seen receiving more hate is the Blue Yeti. Both mics are best sellers so they can't be all that bad. The AKG CS1000S Mk IV can run on two AA batteries besides 48V which is great, and it has switchable polar and frequency characteristics which also makes it more versatile.

Here is a Youtube example including rap. The Session with Blazewun - indoor dialogue AKG c1000 test - YouTube The rap is also recorded with it, and not just the monologue. The rap uses the hypercardoid setting.

AKG C1000 Battle - Indoor Dialogue - The Adapter Features - YouTube same guy again, now comparing all the modes: Cardoid, hypercardoid and presence.

Avantone CK-1

Around €150. Avantone CK-1. Rave reviews on the store sites. A bit on the expensive side for my budget. It gives you three different capsules and a shock mount included. Good.

This is the video I found wrt voice. It seems to have been lossily encoded into oblivion though: Avantone CK-1 Microphone Test w/Hyper Cardioid Cap Installed on Vimeo

Samson C02

Here we're coming down to €45 territory. Samson C02. Supercardioid characteristics and shock mount included.

Samson C02 Voice-over Test Demo - YouTube

Vocal Test Samson C02 Condenser Mic - Beneath The Surface - YouTube

Samson c02 mic vs Zoom SGH-6 shotgun - YouTube

Feb 27, 2019 01:00

Best microphone setup for indoor interviews?

Posted by admin |

Summary: The two options seem to be lavalier/lapel microphones or overhead boom microphones. Lav mics seems by far the easier option.

Curtis Judd talks about this a bit and seems to favoor boom mics. However he points out that so called shotgun mics have problems with room echo and are best used outdoors. For indoor use you can use directional mics without that shotgun tube. Hypercardioid is the description to look for, for highly directional mics.

Boom mic'ing is a lot of work and lavalier mics is a much easier option. If going with headset mics, plosives can become a problem, might be interesting to see if there is a good pop shield for headset mics.

One other option that could work would be to put directional mics below the subjects, at least if they are sitting down. But I think you want to place the mic within 50 cm or so of the mouth, which might be difficult. Still, it would be elegant to just have two mics, one in front of and below each subject's head, since that would very easy to set up.

Feb 23, 2019 12:45

Podcastage, Judd, & Krause: Fav channels for sound for video/podcast/screencast

Posted by admin |

Current favorite video channels for sound for video/podcast/screencast are:

Read more on them below:

Podcastage

There is no way around podcastage. Bandrew is a machine (figuratively speaking one must add in this day and age) who has reviewed tons of gear in a afaict fair way with technical knowledge and excellent presentation. Here are some of his videos, but he has hundreds surely:

Best USB Microphone Under $100 (Oct 2016) - YouTube

What's the Best Mic & How To Select the Right Mic (For Beginners) - YouTube

16 bit vs. 24 bit Audio, What Should You Record At? (FAQ Series) - YouTube

Julian Krause

Julian Krause, has a fair and technical approach which comes over very well, with objective tests, se for example:

Preamp Shootout - Sound Devices MixPre VS Zoom F/H VS Rode VS Roland - YouTube

Dynamic Mics are Noiser than Condenser Mics? (ft. Shure SM7B) - YouTube

Podcastage posted a comment of approval on the last one.

Curtis Judd

Curtis Judd talks about how to bring it all together, mostly with video but also with sound.  He is open about when he is a rookie and when he is experienced. Judd has the closest job compared to what tasks I need to get done sometimes, as he is a professional videographer working for companies. See for example:

Which Audio Recorders for Filmmaking Do I Still Use? 2016 - YouTube

Dialogue Boom Mic Comparison Results - YouTube

How to Get Loud Consistent Sound for Video - YouTube

 

Feb 21, 2019 03:25

Shortlist of audio interfaces of which I will select one

Posted by admin |

I currently have a 16-bit Behringer Xenyx 302USB, and I'd like to upgrade to 24 bit to get some more room under 0dB. I'd also lke to try out a large diaphragm condenser mic so I need an XLR, and I'd like to keep the ability to have a powered mic input for 3.5mm. Actually the Xenyx I have has a 12V XLR which is enough for the mic I'm looking at, so maybe better to start in the mic end and arrive at the interface end later.

I'd also like to have a recorder in it, since Android phones have problems with USB and Bluetooth has problems with, well, the Bluetooth standard which has no capability for good mic audio (maxes out at 16KHz sampling rate).

And since I prefer to do everything in post, more than 3 channels into the computer would be nice.

Interface €        Good
preamps
according
to youtube +
comments
24-
bit
#Powered
3.5 mm
#48V
XLR
Good
VU-
meters
#Multi track
to computer
Recorder #unique inputs  
Behringer U-Phoria UMC202HD 62 3 Monitoring is hard left & right, get UMC204HD for rectifying that. y 0 2 1 2 0 2  
Focusrite Scarlett 2i2 2nd Gen 129 4 y 0 2 1 2 0 2  
M-Audio M-Track 2x2M 115 5 Podcastage found it worse than the focusrite, but I liked the sound of it in the video. Has cnnection problems according to Amazon reviews. y 0 2 3 2 0 2  
Yamaha AG03 Mixer and USB Audio Interface 149 4, same as Steinberg y 1 (shared with XLR) 1 1 2 + feedback 0 5  
midiplus Studio M 79 ?? y 0 1 5 1 0 1  
Zoom H5 225 Is still good but in internal ranking a 1 Preamp Shootout - Sound Devices MixPre VS Zoom F/H VS Rode VS Roland , y 2 2 5 4 5 4  
Behringer Xenyx 302USB 49 2? n 1 0 1 2 0 5  

 

Feb 20, 2019 05:55

Apps to the rescue to record from USB on android?

Posted by admin |

I tried to record sound to a Motorola G5 through a USB sound card connected via an OTG adapter. Didn't work although playback worked. On a Nexus phone playback didn't work either.

It turns out USB sound card support is skimpy even in newer versions of Android.

One solution that is recommended on a forum is USB Audio Recorder - Apps on Google Play. The app has its own USB driver and their site shows support for a lot of phones and a lot of audio interfaces, including some really fancy ones.

But its free version available from their web site behaves lik a zip file on the phone, instead of as an apk, despite having the right suffix and being in the same folder as other working apks that can demonstrably be installed, downloaded with the same program.

I found also n-Track Studio Music DAW - Apps on Google Play but it wants to read my contacts. I'll see if I can turn that off and see how it behaves.

Feb 18, 2019 11:55