Wednesday 31 October 2018

Soundblaster Audigy 2 ZS and Linux

I started recently to look a bit around for a good audio card to get to a "studio" quality recordings under Linux. I didn't want to invest much money so I decided to buy something on ebay.

A short investigation pointed me in the direction of the Audigy 2 ZS sound card. A Creative product with interesting specifications:
  • 24bit 96kHz sampling (in and out)
  • 108dB signal noise ratio
  • EMU10K1/2 processor
  • Hardware wavetable synthesizer (4x 16 channel polyphony)
  • Firewire interface (which became the best feature of this card)
And that all in an attractive package for only 10.50 Euro:
A2zs002.jpg
Creative SoundBlaster Audigy 2 ZS
By The original uploader was Swaaye at English Wikipedia. - Transferred from en.wikipedia to Commons by Lockal using CommonsHelper., CC BY-SA 3.0, Link

The mixer options look great:
Alsamixer for Audigy 2 ZS

Reality


While a quick scan suggested that this card is supported under linux is the reality rather disappointing.  The Alsa page gives some information.

It looks that this card is in practice only supported for  44.1kHz or 48kHz sample rate. And the playback and capturing is mainly 16bits with some support for 24bits. This is an alsa limitation and in that sense is the card not really an upgrade from the "crapy" audio of a normal main-board.

This forces me to look a  further for a new solution that does deliver 24bit at a high 96kHz or 192kHz sample rate.

Wavetable synthesizer


This part has some hardware limitations.  According to alsa information page is the address bus only 31bits, which gives problems with a 64bit operating system and more than 4 Gigabyte memory. When this card was released was this probably a none issue, but now with only 64bit Operating systems and 16Gbyte of memory is this a bit of pity.
A work arround is saving some bigger memory block by using the following kernel parameter within the grub2 boot menu:
memmap=2048M\$6144M
It can be unfortunately necessary to play a bit with single (\), double (\\) or triple (\\\) to escape the $ sign within grub2 config file to make this work correctly automatically on boot time.
Furthermore can it be necessary to increase the normal 128MByte memory for the wave table to 200MByte to make the FluidR3_GM.sf2 sound font fit. This can be done by using the following kernel module parameter:
options snd-emu10k1 max_buffer_size=<size_in_MB>
This parameter can be put in the /etc/modprobe.d/alsa-base.conf file.

If this is correctly working can be checked with the following commands:
hansan@Desk-computer:~/Music/mid$ cat /proc/asound/cards
0 [FW             ]: BeBoB - PHASE 24 FW
                      TerraTec Electronic Gmb PHASE 24 FW (id:4, rev:1), GUID 000aac0400239b18 at fw2 
1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xef410000 irq 30 
2 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xef360000 irq 31 
3 [Audigy2        ]: Audigy2 - SB Audigy 2 ZS [SB0350]
                      SB Audigy 2 ZS [SB0350] (rev.4, serial:0x20021102) at 0xc000, irq 16 
4 [U0x46d0x9a2    ]: USB-Audio - USB Device 0x46d:0x9a2
                      USB Device 0x46d:0x9a2 at usb-0000:00:14.0-3, high speed
And to check the status of the synthesizer:
hansan@Desk-computer:~/Music/mid$ cat /proc/asound/card3/wavetableD1
Device: Emu10k1
Ports: 4
Addresses: 29:0 29:1 29:2 29:3
Use Counter: 0
Max Voices: 64
Allocated Voices: 0
Memory Size: 134217728
Memory Available: 103062476
Allocated Blocks: 866
SoundFonts: 1
Instruments: 14491
Samples: 864
Locked Instruments: 14491
Locked Samples: 864
A new sound font can be loaded with:
hansan@Desk-computer:~/work/sf2$ asfxload  "GeneralUser GS Live-Audigy v1.44.sf2"
hansan@Desk-computer:~/work/sf2$ asfxload -M
DRAM memory left = 100714 kB
And a midi file can be played with:
hansan@Desk-computer:~/work/sf2$ aplaymidi -l
 Port    Client name                      Port name
 14:0    Midi Through                     Midi Through Port-0
 16:0    PHASE 24 FW                      PHASE 24 FW MIDI 1
 28:0    SB Audigy 2 ZS [SB0350]          Audigy MPU-401 (UART)
 28:32   SB Audigy 2 ZS [SB0350]          Audigy MPU-401 #2
 29:0    Emu10k1 WaveTable                Emu10k1 Port 0
 29:1    Emu10k1 WaveTable                Emu10k1 Port 1
 29:2    Emu10k1 WaveTable                Emu10k1 Port 2
 29:3    Emu10k1 WaveTable                Emu10k1 Port 3
hansan@Desk-computer:~/work/sf2$ aplaymidi -p 29.0  test.mid
This does works at least.... But I have say that fluidsynth is maybe an even better solution, given the performance of modern processors.

Conclusion


All with all this was not really a good very invested 10.50 Euro. The selling features like the high bit rate and resolution are not really delivered on the linux platform.
The only good item is a firewire interface, which enables me to look into a different class of audio cards.


(updated and corrected a few items on 3/11/2018)

Saturday 27 October 2018

Terratec Producer Phase 24FW digital / midi connector pin-out.

I started recently to look into "professional" audio interfaces for Linux. As part of this I have picked up from ebay a Terratec Producer Phase 24 FW in my quest for decent equipment . This is a fairly simple interface with 2 analogue inputs and 4 analogue outputs of which 2 are used for the headpones output at the front of the box.  There are two nice things of this box:
  • Fully supported by the FFADO project.
  • 24bit resolution with 192kHz sample rate.
There is now-a-days not much information to find about this box. There are some old reviews, but the normal website of Terratec is not showing much anymore. However there is a kind of manual archive with some good information and software. This can be found here. The software is of course MAC and windows only and therefore not so important.

Unfortunately the box came without the adapter cable for the digital connector.  This connector contains S/PDIF signals and MIDI signals in and out.  I thought I was fine; I don't have MIDI equipment and I did not want to experiment with SPIDF. However at the time I didn't realize that the S/PDIF signal is mandatory to synchronize multiple interfaces together on one master clock.  Some audio interfaces can even use a world clock signal, but most use the optical or coax S/PDIF or ADAT signal for this purpose.

The missing digital and MIDI signal cable as shown on the advertisement material of the manufacturer
Therefore It was necessary to find out the pin-out of the digital 9 pin sub-d connector.  It was fairly easy to guess the function of the pins on the connector by looking at the more or less standard circuits for S/PDIF and MIDI interfaces and by some poking around with a multimeter.

Based on the measurements and the standard schematics I was able to get to the following schematic / cable diagram of a part of the inside of the Phase 24 FW box and the resulting breakout cable:
Terratec Phase 24 FW breakout cable
Schematic of the digital / midi connector and the breakout cable

The inside of the Phase 24 FW part is not very accurate but simplified to understand the way the breakout cable should be connected. There are much more components on the PCB than showed in the above schematic. Interestingly not only the Midi-in is isolated, but also the SPDIF-out is more or less floating. This is probably to prevent ground loops. The suppressor diode tries to keep the excessive voltages under control.

The following table gives an quick overview of the pinning of the 9 pin female sub-d connector on the box:

Signal group
Pin
Description
MID out
1
+5V out through 220Ohm
2
Out signal
3
Gnd
S/PDIF out
4
Signal out
5
Suppressor diode to GND
Midi in
6
LED (diode in parallel with LED) through 220Ohm
7
Return
S/PDIF in
8
82Ohm input
9
Gnd

Looking at the website and other old data of Terratec I expect that the Phase 22 has the same adapter cable for the digital signals.  And it is very well possible that more products use the same pin out for this 9pin sub-d connector.

Now I have to solder a cable and synchronise my audio interfaces.

Tuesday 2 October 2018

Insulation tester HP-6688F

I had recently again problems with my Dishwasher. For some reason it was tripping the FI-main switch.  I decided to need an insulation tester to investigate this further.  A short search on internet pointed me to this HP-8866F insulation tester.

This is a fairly reasonable low cost tester with a 2500V range. This high voltage range is on most lower cost instruments not available. There is not that much information available on this instrument, but here is a review with tear-down on youtube.
The specification for this instrument is as follows (copied from the manual)

Insulation tester
2500V
Test voltage / Minimum resistance to keep voltage 250V 1MΩ
500V 1MΩ
1000V 2MΩ
2500V 2MΩ
Output voltage 90 – 110% of the test voltage
Measurement range 1MΩ – 20GΩ
Resolution 0.01MΩ
Accuracy 1MΩ – 200MΩ ±(3.0%+5)
200MΩ – 10GΩ ±(5.0%+5)
10GΩ – 200GΩ ±(10.0%+5)
AC voltage range 1V – 750V ±(2.0%+5)
Frequency range 1V 40 – 400Hz


It is of course typical a measurement tool that you need only once a year and therefore I didn't want to spend too much on such instrument. I have bought the instrument at Komerci, but it can also be purchased on ebay, Amazon or Aliexpress.

For my purpose to find a short in the heater of the dishwasher did this instrument do a good job. However I would not depend my life on it; the professionals can better buy a Fluke or other name instrument. The voltages are a bit off and the youtube review shows quite some overshoot. Testing motors, heaters and other "passive" components will be no problem, but testing some active semiconductor circuit can be a problem.

For this blog I made a few experiments with 10 x 1MΩ resistors in series.  My small multimeter is measuring the voltage over the last resistor, which makes that it shows the measurement voltage divided by 10. This gives the following results:
Fluke
Resistance: 10.16MΩ
Voltage: 2.489V
Old Multimeter
Resistance: 10.07MΩ
Voltage: 0.508V

Interesting difference in measurement voltage between my fluke and my old multimeter of 25 years ago.
250V
Resistance: 9.98MΩ
Voltage: 208.7V
(Too low!!)
500V
Resistance: 10.01MΩ
Voltage: 456.9V
1000V
Resistance: 9.95MΩ
Voltage: 909.9V
2500V
Resistance: 9.88MΩ
Voltage: 2262V


The results are not too bad, however the voltage on the 250V range is a bit too low according to the specification.

This instrument was anyhow useful to find the short in the heater of the dishwasher.