Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home

jorgenmodin.net - Blog

Lots of help on how to put up Jackd with lower latencies on Raspberry pi

Posted by admin |

I got here:

https://lucidbeaming.com/blog/setting-up-a-raspberry-pi-3-to-run-zynaddsubfx-in-a-headless-configuration/

In a quick test this morning it seemed to make a difference although some of the adjustments had already been made. Jackd had already prioritized up things. The things I did that were new were the following:

1. Disable the internal audio card by commenting out the "dtparam=audio=on" :

sudo nano -w /boot/config.txt

...

# Enable audio (loads snd_bcm2835)
# dtparam=audio=on

2. DBus security policy (disclaimer: I have no idea what this one does in this context):

sudo nano -w /etc/dbus-1/system.conf

...
<!-- Only systemd, which runs as root, may report activation failures. -->
<policy user="root">
<allow send_destination="org.freedesktop.DBus"
    send_interface="org.freedesktop.systemd1.Activator"/>
</policy>
<policy user="pi">
    <allow own="org.freedesktop.ReserveDevice1.Audio0"/>
</policy>

3. Default configuration to use the USB card:

sudo nano -w /etc/asound.conf

pcm.!default {
 type hw card 0
 }
ctl.!default {
 type hw card 0
 }

4. Force the pi to always be alert, by telling it so on startup:

sudo nano -w /etc/rc.local
...
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "performance" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "performance" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo "performance" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
...

 

Mar 06, 2019 11:55

Headphones protector, next problem: I/O levels

Posted by admin |

It seems clear now that I have succeeded in building a headphones protector with a Raspberry Pi 3B+, Jackd and Rakarrack.

However some very practical problems remain, and they would actually remain for whatever solution I would have chosen, namely: How do I know I'm feeding the compressor at the right level? If the input signal is too low, the compressor/limiter may not kick in.

So I need an indicator, a VU meter that it is indeed being fed at a good level. I could go the route of having a VU meter directly monitoring the input before it reaches the Pi, but that would be a lot of tinkering.

Since Rakarrack already has built in meters for input and output, it's probably better to outfit the Pi with a small screen, and then create a viewport with xrandr that ensures that those meters of Rakarrack are displayed. And it should be a touch screen so the sliders adjacent to the VU meters can be used.

The second problem is the output level. I would really like to have an analogue potentiometer to be able to adjust the volume there, outside of the Pi. However making a voltage divider with the headset as a part in it, will introduce weird non-linear responses, since headphones vary in impedance depending on frequency. I better go and check to see how much headphone impedance does vary with frequency…

Mar 06, 2019 10:40

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