The DIY project by The Rational Audiophile

m1ts0s

News poster
Μηνύματα
2.337
Reaction score
3.650
"Ah yes, audio DIY. Even in this day and age it is still possible for an individual in his garage to create something that is absolutely the equal of commercial gear, for less money. But at the same time that isn’t all that much of a claim because

(a) The price of commercial gear can be obscenely high.

(b) Commercial gear may not be all that good!

At one time I thought I was interested in building amplifiers, and later I thought I was interested in making my own DACs, but I now realise how pointless those activities were. I was seduced by the thought of experimenting, creating, and by the idea that I could make the signal path simpler or purer, and that I might possibly be able to hear the difference though, even as an engineer, I wouldn’t be able to tell you why; I had bought into the whole “hi-fi is mysterious” thing. I was not considering that the basic topology of a standard hi-fi system (source, single amp, passive speakers) might be fundamentally compromised. My ‘rationalism’ at the time was at the level of scoffing at those who would spend the price of a car on an amplifier, but I certainly didn’t question the basic topology of a standard hi-fi system. In fact I am certain that I would have imagined active speaker systems in the same way that you, perhaps, imagine them now: surely they’re going to be hard, clinical, disjointed – because they don’t have the soft, organic purification stage of the passive crossover, that ‘smooths out’ the horrible quantised digital audio – and by using several amplifiers the system just won’t ‘pull together’. Or something like that.

Building speakers – in contrast to DACs and amplifiers – is very appealing because it involves messing about with woodwork and playing with acoustics. But second hand speakers from eBay are very cheap. It occurred to me that one way to learn about speaker design would be to modify some existing speakers, and that the most versatile method would be to drive them actively using DSP. Then I could experiment, and hear for myself the huge audible differences to be expected from different crossover slopes and frequencies that the experts assure us we should hear. So I duly modified a pair of cheap two way floorstanders and wrote some simple DSP software to do basic FFT-based complementary filtering, using a multichannel sound card to drive the amps. I wasn’t expecting anything spectacular, but even at this stage the sound was remarkable; the bunged up, congested sound of the standard speakers (that I hadn’t noticed so much until then) was gone and the music just poured out! The in-room EQ wasn’t perfect but there was no sign of hardness in the sound, nor of disjointedness – just the opposite. I very quickly realised that hi-fi can be a lot easier and better than people allow it to be.

Thus, it was clear to me that it was going to be worth doing something more ambitious. Three-way with unusually large sealed woofers (why not? – I had a budget of tens of pounds upwards), full DSP crossovers with driver correction (including phase) and time alignment (i.e. adjustable delay for each driver).



With hardly a hiccup, this has worked out much better than I might have imagined. Dangerously so. It has given me a certainty that much of the received wisdom in hi-fi is bunkum and that, in fact, the now-discredited idea* of pursuing basic linearity including the time domain, was correct all along. Even among so-called objectivists there’s an almost-universal notion that only the frequency domain matters; the world’s foremost authority on speaker design has recently delivered a lecture that reinforces this view. If this conventional view is wrong then I think it explains everything about the supposed mysteriousness of audio and the lack of correlation between orthodox measurements and perceived audio quality (some publications may perform more complete measurements than others, yet disregard or only mention in passing the time domain-related stuff). My DIY system suggests to me that if you get the frequency and time domains correct (including the bass i.e. no ports) then you have it all. Automatically. It also tells me that such a solution is ‘robust’, not balancing on a knife edge where the slightest modification to, say, a crossover frequency completely changes the sound. Indeed if this were so, it would render invalid the whole concept of the multi-way speaker – I cannot vouch for the implementations of conventional passive systems, however.

In my system the mid driver and tweeter are mounted in suitably solid 1980s Acoustic Research bookshelf enclosures, and the large woofers are in very large sealed ex-Goodmans enclosures. Using PC-based crossover filtering and driver correction based on near field measurements, the resulting sound is gloriously ‘non-digital’ (in the sense that the expression is used here). We are talking about aspects of reproduced sound that you cannot know are defective until you hear a system that is ‘correct’, and then everything falls into place. Not only is the sound the opposite of ‘harsh’ or ‘clinical’, but having gone the three way route with large sealed woofers it is full-on ‘high end’, effortless sound that goes as deep and dynamic as necessary, and keeps the instruments and/or voices separated and imaged precisely (if that’s what the recording contains)."

* You may be sceptical, but the conventional view in audiophile circles is that the idea really has been discredited.

https://therationalaudiophile.wordpress.com/the-project/
 

m1ts0s

News poster
Μηνύματα
2.337
Reaction score
3.650
Linux-based active crossover: getting there

A few weeks ago I wrote about my desire to dump Windows and to go with Linux for audio. The aim is to create an active crossover system that is the best of all worlds:
  • completely flexible, programmable down to bit level (I am going to program it – or pretty much port my existing code from Windows)
  • powerful enough to implement any type of filtering (large FIRs in particular)
  • not dependent on specific hardware – can use a variety of low cost PCs including old PCs at the back of the cupboard, fanless, compact, low powered, dedicated DSP cards.
  • all libraries, drivers, compilers are open source; not beholden to commercial companies
  • capable of streaming from a variety of sources without sample conversion
  • not bogged down with continuous updates and anti-virus shenanigans
The goal is to use DSP to replace the passive crossovers that so-degrade conventional speakers’ performance, not merely to use the PC as a ‘media hub’. The Linux-based audio system can do this, and despite its workaday image represents the ultimate hi-fi source component. Hi-fi sustains an industry, and hordes of enthusiasts are prepared to spend real money on it. What an interesting thought, therefore, to realise that as a source there will never be any need for a better component than the ‘Linux box’. Here exists a system, a general purpose number cruncher that is powerful enough for all audio applications, bristling with connectivity, easy to equip with digital to analogue converters whose raw fidelity have long surpassed the limits of human hearing, and yet costs less than a Christmas cracker toy to own – unlike an equivalent Windows PC.

Details, details
Regardless, reading around the web on the subject, for my active crossover system I seem to either have unique requirements that no one has ever thought of, or my requirements are just so trivial as to be not even worth writing down by anyone. I am still not sure which it is…

On the face of it Linux seems to have audio covered and then some, but in amongst the fantastically comprehensive JACK solution I don’t really feel I know what is going on. It feels like overkill. Is the audio being resampled? I think I need a simpler solution.

Just to summarise the thinking behind my requirements:
  • I want to design my own DSP system rather than trying to adapt existing systems.
  • I want to be able to understand exactly what is going on.
  • Dedicated digital signal processing systems are relatively expensive, often not very powerful, and in order to get the most out of them they may entail a considerable learning curve without the effort being applicable elsewhere, whereas PCs running Linux are ridiculously powerful and cheap.
  • Linux can be installed on any PC for free, and there is no danger of The Powers That Be decreeing that it must be ‘upgraded’, with the high chance that the system will be broken by the upgrade. For example, the mandatory ‘upgrade’ from XP to Windows 7 broke my current system, entailing the fitting of a second sound card due to a change in functionality of a sound card driver. And it cost money.
  • I want the best of all worlds: to be able to program the system at low level as though it is a microcontroller sending samples to a DAC, but for it also to have nice GUIs, play CDs, run Spotify without the need for any other piece of hardware linked with a cable.
  • It would be nice if the system would run on any old PC e.g. fanless.
  • It would be nice to be able to use any sound card as the multichannel DAC.
  • I don’t want the system to resample the audio. This is the ‘killer’ requirement that, I think, most people never give a second thought to.
That last requirement is what the whole thing is about. It is nothing to do with conversion between 48 kHz and 44.1 kHz, or 96 kHz and 192 kHz, but is about the resampling that would be necessary in going from 44.0999 kHz to 44.10001 kHz, for example; if the source and DAC are at nominally the same sample rate, but use separate crystal clocks they will drift apart over time. This can be handled using adaptive resampling of the audio stream in software. Resampling would involve extra DSP, so even if I was happy that no audible degradation was occurring, it would be sapping more CPU power than was necessary, or relying on a particular type of sound card that does its own resampling.

The alternative is to ensure that the source and DAC are synchronised in terms of their average sample rates. The DAC will have a fixed, rigid sample rate, so the only rate that can vary is the source and, if the source is a stream of bytes from an audio application (e.g. a media player program), this synchronisation can be arranged by requesting chunks of data from the source only when the DAC is ready to receive it. A First-In-First-Out (FIFO) buffer is loaded with these chunks of data, and the data is streamed out to the DAC continuously.
 

m1ts0s

News poster
Μηνύματα
2.337
Reaction score
3.650
(συνέχεια)

I would like to think I have now found the solution using Linux. I would be very grateful if any Linux gurus out there would care to correct me if I am wrong on any of this:
  • Linux has several (confusing) layers when it comes to handling audio. However, most audio applications will work directly with ALSA, which allows fairly low level programming.
  • Typical Linux distributions also come with Pulseaudio loaded and running. Pulseaudio is a higher level system than ALSA and has many nice features, but automatically performs resampling(?). Pulseaudio can be removed.
  • Another step up in sophistication is JACK, a very comprehensive system that requires a server program to be running all the time in the background. There is no obligation to set JACK running.
  • As with Windows, fitting a sound card into a Linux machine causes the driver for that sound card to be loaded automatically. ALSA can then ‘see’ the card and it can be referred to as “hw:3,1” where the ‘3’ is the card, and the ‘1’ is a device on the card, or using aliases e.g. “hw:DS,1” etc. – this is useful because the numeric designation may change between boot-ups.
  • “hw” devices are accessed directly without any resampling. as opposed to “plughw” devices. Both options are usually available for most sound cards and their drivers. I am only considering the “hw” option.
  • Driver capabilities can be ascertained in detail by dumping the driver controls to a file using various methods e.g. “alsactrl store” etc.
  • Linux provides drivers that have been put together by enthusiasts based on sound card chipsets, so not all the facilities listed by the driver will necessarily be available for every card.
  • ALSA’s API allows real time streaming to and from ALSA devices, including multichannel frames. Taking data from a device is known as capture, and sending to a device is known as playback (or similar).
  • A device can be designated as the ALSA default, which most audio applications default to sending their output to. Applications like Spotify can only direct their output to the default device.
  • There is a ‘dummy’ driver available called snd-aloop. This can be loaded into the system at boot-up. To ALSA it appears as as a sound card calledLoopback with eight capture devices and eight playback.
  • snd-aloop can be designated as the default device.
  • snd-aloop has a very desirable feature: its sample rate can be varied via a real time control. This control is accessible like the controls that are available on any sound card driver and can simply be set from a terminal using a command such as “amixer cset numid=49 100010” where 49 is the index of the control and 100010 is the value we are setting it to. The control can also be adjusted from inside your own program.
  • Clearly, if a way can be found to compare the sample rates of the DAC and snd-aloop, then snd-aloop‘s sample rate can be adjusted occasionally to keep the source’s average sample rate the same as the DAC’s. N.B. this is not dynamically changing the pitch or timing of the stream – this is fixed and immoveable and set by the DAC – but merely ensures that the FIFO buffer’s capacity is not exceeded in either direction. If the source was not asynchronous (e.g. not a CD or on-demand streaming application whose data can be requested at any time) but a fixed rate stream with no way of locking the DAC to its sample rate via hardware, then this would not be possible, and adaptive re-sampling would be essential.
After a few days of wrestling with this, my experience is as follows:
  • Removing Pulseaudio from Ubuntu (“sudo apt-get remove pulseaudio –force” or similar) has side-effects, and the system loses many of its GUI-adjustable settings options because various Gnome-related dependencies are removed too. It doesn’t ‘break’ the system; merely makes it less useable. The solution can be as crude as re-installing Pulseaudio in order to make a settings change and then removing it again! I don’t know that it is essential to remove Pulseaudio, but it certainly feels better to do so.
  • Various audio apps are happy to play their outputs into snd-aloop, and my software can capture its output and process it quite happily.
  • The real core essentials of using the ALSA API for streaming are straightforward-ish, but documentation beyond a simple description of each function is sparse. In many cases, the ALSA source code is viewed as being sufficient documentation. As an example, try to find any information on how to modify an ALSA driver control without actually delving into an existing program like amixer to try and work it out. I find that most ‘third party’ tutorials seem to obscure the essentials with multiple equivalent options demonstrating all the different ways that a single task can be performed.
  • My ASUS Xonar sound card may yet turn out to be useful now that I don’t have to worry about using it as an input as well as an output: it is a high quality eight channel DAC that seems well-behaved in terms of lack of ‘thump’ at power-on and -off.
  • I found the easiest way to adjust the snd-aloop sample rate dynamically was by cutting and pasting the source code for the standard ALSA/Linux program amixer into my program (isn’t open source software great?) and passing the commands to it with the same syntax as I would use at the command line.
  • The system seems stable and robust when the PC is doing other things i.e. opening up highly graphical web pages in a browser. No audible glitches at all and no jump in the difference between my record and playback sample counters.
  • I am, as yet, unsure as to the best way to implement the control loop that will keep snd-aloop and the Asus Xonar in sync. With a snd-aloop rate setting of 100000 i.e. nominally neutral, there is a drift of about one sample every couple of seconds (an evening’s worth of listening could be assured without any adjustment at all by have a large enough FIFO and slightly-longer-than-desirable latency…). I am currently keeping a count of the number of samples captured vs. the number of samples sent to the DAC and simply swapping between fixed ‘slightly slow’ (99995) and ‘slightly fast’ (100005)snd-aloop sample rates, triggered when the (heavily-averaged) difference hits either of two thresholds.
  • In terms of the ALSA sample streaming I just use the ‘blocking method’ inside two separate threads: one for capture and one for playback.
  • It occurs to me that this system could be used to stream to an HDMI output, thence to an AV receiver with multiple output channels. Not sure if the PC locks to the AV receiver’s DAC sample rate via HDMI (is it bidirectional?), or whether the AV receiver resamples the data, or syncs itself to the incoming the HDMI stream.
You may find it hard to get excited by this stuff, but not me: it’s a case of feeling that I own the system rather than my recent experiences that showed that with Windows the system is merely ‘under licence’ from Microsoft and the hardware vendors.
 

m1ts0s

News poster
Μηνύματα
2.337
Reaction score
3.650
Linux Active Crossover is working!

Hi-Fi – there’s nothing left to do

"The successful ‘Linux-isation’ of my audio system reinforces my view that hi-fi is a solved problem. Enlightened people within the industry solved it some time ago, in fact. All that is left to do is create variants on the central theme of:

  • digital source incorporating DSP
  • multi-channel DACs
  • multi-channel amps (may incorporate the DACs)
  • drivers in sealed enclosures (may incorporate the DSP, DACs and amps)
Most systems will most likely be stereo, but the concept is scale-able to surround sound should that be considered desirable (I’m not all that keen, myself). With software changes it can incorporate amobiophonics etc. And that’s it.

There is no real mystery in hi-fi. An entire mythology has grown up purely as a result of the inherent limitations of early audio technologies. These technologies’ drawbacks influenced the way performance was measured, ignoring what couldn’t be fixed at the time. These inadequate figures of merit persist, and the larger part of the hi-fi industry still, to this day, sees no point in building anything different from what its predecessors built. The resulting systems’ complex, arbitrary defects defy simple measurement and are the source of the supposed ‘mystery’. There are no specifications or measurements that can quantify meaningfully the peculiar effects of interposing passive crossover impedances between amplifier and driver, so it is never spoken of; they work fine with steady state sinusoids so that is all that matters. All passive speakers have phase distortion, but it doesn’t affect the standard frequency response graph, so it can be ignored. Bass reflex ‘rumble generators’ work perfectly as long as they are driven with steady state sinusoids, so this is the only measurement anyone ever bothers with.

Compounding the ludicrousness of it all, manufacturers and customers alike subscribe to a simple folk-association between the physical form of the hardware and what they expect to hear.

I am pleased to be one of the very few who has heard the alternative. The striking thing about it is its ‘robustness’ and ‘correctness’. I could wax lyrical about how “natural” it is; how brilliant it is at reproducing piano notes, plucked violins, vocals and so on, but this would be pointless. If you hear the ‘correct’ system then your reaction is not “Gosh, those piano notes sound so real!”, it is rather more a reaction of “Of course they sound real”. There is no sense that the system is balancing on a knife edge, or attempting to squeeze a quart out of a pint pot; this system is gallon-sized (yes the speakers are large) and giving you the full gallon – if you’ve got a few square feet to spare in your room, why would you try to do anything else? In fact, in the space you save by removing your record deck, vinyl records and dual monoblock valve amps with separate power supplies, you too could fit some adequate speakers.

It really is very simple. It may appear complicated on one level, but this application of now-commonplace technology removes at a stroke the irreconcilable difficulties that our virtuoso designers struggle with so painfully when producing their tortured, flawed masterpieces."
 


Τελευταια Μηνυματα

Staff online

ΣΤΑΤΙΣΤΙΚΑ

Threads
175.905
Μηνύματα
3.033.652
Members
38.519
Νεότερο μέλος
gperdik
Top