Showing posts with label electronics. Show all posts
Showing posts with label electronics. Show all posts

Making a DI box

Over the past decades making a DI box has been one of my recurring activities.

From repurposing scavenged  transformers into make shift 'passive' boxes to  experiments with unbalanced to balanced chips.

The problem is phantom supply. 

All though rated at 48volts it's purpose as a PSU for any circuitry is really limited, because the way it is implemented in almost every mic pre-amplifier:

The 48 volts is fed through 2 resistors of each 6k8 in each leg of the symmetrical input, thus giving an impedance of 3k4. Which means that if your circuit draws say 10mA of current only 14 volt of that supply is left to begin with.

Your own circuit will have some resistors in the supply lines too, to unload the output from your circuit. So the voltage to work with and thus the headroom of your DI will even drop more.

Hence the really limited headroom of a lot of modern, commercial DI boxes

Old skool '70's electronics to the rescue: 

 

This circuit is no rocket science and well known in every pro-audio circle, mostly credited to Bo Hansen..

Quite a few mods though, just as a reminder for myself a picture of the early limited (as in only 20 pcs of that specific transformer in my very old stock) prototype:


 
 
 
 


By popular demand we decided to try to do a reissue fairly recently.
The problem was finding a nice affordable transformer: these Swedish ones are really nice, but man, do they charge..Pure by coincidence i stumbled across OEP. Now those i do remember from the classic BSS AR116 DI. (Which has nothing to do with the modern AR133 !!) And with some googling I found them to be used by modern Telefunken as well (speaking of brand name marketing!!)
 

So here we go a batch of class A, current driven, transformer balanced DIs in a stainless steel housing. 
Yes, stainless steel. 
Every DI gets abused once and awhile as a stage weight, box tilt, or even as a hammer so to prevent them from changing into ugly lumps of corroded, dented metal, we folded and water jet cut some stainless steel sheets:
(of course I didn't do it by myself: credits to Koos Roadservice)
 
 

 
 
 
Still not totally satisfied by the end result I learned myself how to powder coat (not difficult at all) 
 
So here it is..open for orders now..hahahaha...

KBLsystems class A transformer balanced DI



Fighting long boot times when using older RPI

It has been quite a while when did my 'audiophile' music player built.

raspberry-pi-with-balanced-output 

It has been almost a decade now and there is a zillion of dedicated distro's around to make this really easy.

Just google: RPI musicplayer.

All really nice and slick..but..taking..ages..to..boot, certainly on older PI's 

So while reviving this old project to include a transformer balanced output, (driven with a class A running NE5532! ) I worked myself through the big pile of clogged info to get a faster booting system.

Now the easiest way would be to get yourself a custom build image using a build system like buildroot, yocto, openwrt.

I did have a go at all of them but the easiest way to get yourself (like me total noob) going would be to start off with buildroot.

Just follow the walk through (maybe add in a SSH client like dropbear) and you will quickly get your own fast booting image. That is: it isn't complicated but the compilation takes hours!

The bit more nasty part comes when you want to take it further: not many people talking about this, so for future reference here's some reminders.(as long as this will be of any value in the allways changing wonderful world of linux 😂)

RPI has it's own rather special way of booting at which time you can configure all kinds of hardware add-ons by using so called dtoverlays.

If you have been working with RPI and audio you will have come across these: to configure edit the config.txt file in the 'boot' partition of your disk image. (sometimes it will have just a number instead of the name 'boot')

For a first test add 'dtparams=audio=on' to this file. This will select the onboard shitty audio out. In theory. But the inner workings of linux in these buildroot-builts don't seem to be loading the necessary kernel modules. Something with udev and dts / dto. Complicated stuff. Tell us when you know how to do this!

I got it working with 'modprobe snd-bcm2835'.

We did select the packages to get alsa and other obvious stuff like mpd, mpc and a texteditor in our simple build, right? 

Now to play some music (from that USB stick) you will have to mount it first: 'blkid' will give you a device name or UUID, create a mount point and mount. Configure '/etc/mpd.conf'  to point to that music directory and also add a default alsa-audio-out setting while you're there.

Restart MPD: first kill it by PID number found by 'ps' then start by mpd (no sysctl or systemd in default busybox) . Now mpc will have hopefully controle and some information on mpd.

Now on to even more remarkable easy to forget nooks and crannies:

We do want that i2s-dac thing running.  In the picture is a simple (i2s-slave) interface that doesn't need any configuration (by i2c). I think most of these simple boards will work, this one is an old hifiberry-dac with a pcm5102a. That is a significant hint to get it going:

First comment out the 'dtparams=audio=on' and add in 'dtoverlay=hifiberry-dac' in the aforementioned config.txt file.

But you will not have any overlays in that 'boot' directory. So download it from some github or strip it from some other distro. Probably kernel versions and .dtbo file will have some relation...

Now for the similar modprobing:


You need the 4 of them to get it going:

snd-soc-bcm2835-i2s, snd-soc-core, snd-soc-pcm5102a, snd-soc-rpi-simple-soundcard. 

Finally! Audio from your i2s board!


Now to make it persistent after reboot, you have to make a little script in the '/etc/init.d' . Give it number some lower as the mpd-start-stop script, which in my case was S95. (that's capital S!)

Don't forget to mount your USB-music-drive before starting mpd. I edited the mpd start script to mount the drive: the usual fstab methode doesn't work to well. Presumably the default mpd start script will be started before the USB drive is ready for mount.

Other nice stuff to implement:

We can us sysfs-kernel modules to manipulate GPIO ports. Make sure the pins are not in use for other functions (like i2s..duh). Here is a small script:

 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

#gpio17 to drive a led:
echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction

#gpio27 to have a push button to do "mpc next":
echo 27 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio27/direction

while true
do
if mpc status | grep -q 'playing'; then
  echo 1 > /sys/class/gpio/gpio17/value
else
  echo 0 > /sys/class/gpio/gpio17/value
fi

if cat /sys/class/gpio/gpio27/value | grep -q '1'; then
  mpc next
fi

sleep 0.5

done

 

 

Oh, and one more thing:

Before starting to use something like 'buildroot' think of a way to separate everything from your everyday-work-computer. It will give a big mess if you don't. I used VMware. Do configure for plenty of drive space!











Bringing Soundweb greens back to live


We are still using quite a lot of  old green Soundwebs 9088 and 9088ii in our soundprojects. The main reason being  that these ancient machines were allready capable of some FIR filtering.
Mind you: there is a bug in the software which makes you have to reverse the filter kernels. Presumably nobody ever noticed using linear phase filters (symmetrical as these will be) ;)

Anyway I had some broken ones lying around so I thought it would be time to do some repairing.
One of the apparent vulnerabilities is the power supply cap marked as C216.
So after replacing these I was able to get some off them back to live.
For all you out there plagued by the dreaded searching.... (at infinitum) modus I will repeat some 'rules':

  1. replace C216 cap, while you are at it maybe it's a good idea to upgrade cap C265 with something beafier as well.
  2. use the spare jumper at the option A position to set your machine in debug modus.
  3. switch on power, you now should get the 'nightrider' row of flashing leds.
  4. use the backup loader.exe to reload the firmware. make shure you have the correct *.a21 file. I learned the hard way do not to make a mistake!
  5. when done switch of power, replace jumper and reboot.
As allways use correct settings of com ports and bitrate (38400 front, 115200 back). Also the FTDI driver / USBtoRS232 works fine on windowsXP (and 7) but on windows 8 it appears to be troublesome.

Now for the fun (and utterly time consuming and by no means commercially viable) part.
Let see if we can do some 'audiophile' modifications.
In the issue 1 model (9088) there are some VCA IC's build in to facilitade volume controle directly after the DAC's.
These suck! ;)
I forgot the type number but in a earlier experiment some years ago I removed these and  shortened the signal path. So no more volme controle on the output and maybe (with high gain power amps) a bit excessive noise.
But hey, who cares for noise?
It's the universe coming through our speakers!
Big plus!


Next thing I thought would be whorthwhile is replacing all these (non-polar) caps in the signal path.
Well this wasn't going to happen.
All my regular dope dealers like Farnell and RS and the like seem to have stopped selling these, hmmm, bummer.
Now what if we replaced them with regular caps back to back with a DC bias.
(This is an idea I actually stole from a very old Midas PRO4 console I once owned).


Big improvement?
Argh euuhh, yes with all my skills I can notice the difference (some more clarity) but I 'm not even shure if this is desirable.
So, nah not going to do that on all our machines...

 ...edit...edit...edit...
Not completily convinced by the dispointing results of the above modification I decided to give it a second try.
Same mod but this time I tested a stereo a/b comparison..wow.. this is some serious shit.. much broader and deeper image and a very convincing musical impact..now why the hell is this???