Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home

jorgenmodin.net - Blog

Three gorgeous Raspberry Pi cases I won't buy

Posted by admin |

And I won't buy them because I want the USB and power connectors to be internal to the box, since I will plug in a sound card there and a power bank, and I want those to be integral to the box.

However if that weren't the, uhm case, then these would be on my shopping list:

Mar 10, 2019 06:20

Modep, Pisound, Puredata — more sound processing options for the Raspberry Pi

Posted by admin |

Going deeper into the world of Raspberry Pi and sound I have discovered some new options. Modep (Meet MODEP - MOD DUO Emulator for Raspberry Pi)  is a ready-made operating system image with almost 200 plugins installed. I haven't tested it yet, but I am very curious as to how well they solve the optimization issues. I'm downloading it right now. There are even two de-essers among the plugins! I suupect though that many of the plugins are made for guitar effects and are hence in mono.

Modep is hosted by the Lithuanian Blokas guys who make the Pisound high-quality sound sound card for Pi. Buy Pisound - Sound Card & MIDI Interface for Raspberry Pi. At around €100 I will refrain to buy it at this point in time, since I think it is the processing limits of the Pi itself, that sets the limits for me. Still cool though!

Review: Blokas PiSound, Audio & MIDI Interface For Raspberry Pi : Ask.Audio

Modep seems to be created by the guys behind the super pedals  Mod Duo and Mod Duo X. Their stuff looks close to what I would like to create except they do guitar effects.

Finally, since I have problems with the processing power of the Pi, maybe it's time to look at PureData, maybe the bare bones approach would yield more powerful results, suitable for a headless configuration?

Update 2019-03-10: Couldn't boot with Modep from a USB stick with a Raspberry Pi 3 B+. It complained about things being on different partitions or something. Either the Modep image cannot handle the 3B+ hardware or it cannot handle being on a USB, I guess.

Mar 09, 2019 12:20

Plugins — Rakarrack vs Jack Rack Vs Calf Rack on a Raspberry Pi

Posted by admin |

First of all, kudos to the porters and maintainers for making all of these run on the Pi!

However it seems to me that it is the Rakarrack that actually runs well, given the constrained resources of the Pi. And this is not so strange given that I think Rakarrack was made with the ARM-powered Pi in mind!

When running the two others, Jackd seems to give up eventually. It starts outputting lots of clicks, like rain. I think that happens when many samples are dropped so that the result has huge discrepancies between adjacent samples in the output. Then it goes downhill from there and locks up. Basically these two seem to strain the resources of the PI. Maybe their plugins are inherently more computationally complex, or they have not been properly optimized for the ARM architecture.

Thinking about it, I actually only tested the Calf plugins for Jack Rack and Calf Rack. It may be that they are extra difficult on the Pi: Plugin performance on RaspberryPi 3 | rncbc.org

Mar 08, 2019 11:45

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