The amazing $0 realtek phono preamp?

Hmm I have a torture track to test that with to see if it misses transients. What's the best way of getting that to you?

I sent you the declicked flac and the residual noise flac as a link from my Dropbox. Hope the download works.

For anyone else who is interested: Bill sent me a song that was grabbed off of a CD containing music with lots of very sharp transients.

I hadn't actually thought of running a track that is not a vinyl rip though this to check for false positives but it is obviously a great idea and works really well.

I ran your test track through the ffmpeg declick, then I imported the original and the declicked version into audacity so I could use the "solo" feature to switch between the tracks. What I find really fascinating is that the residual noise (original file subtracted from declicked file) contains only really sharp transients that by themselves actually sound exactly like clicks from an LP. The declicked version sounds softer but is still very listenable. I bet this result can be improved upon by tweaking the algorithm parameters a bit. In the mean time, I'm quite impressed - especially as this is only the default setting.

original-declick.png
Original audio and declicked audio

original-clicks.png
Original audio and clicks deleted by the algorithm

Code:
ffmpeg -i ~/input-file.flac -af adeclick ~/input-file-declick.flac         

[...]

[Parsed_adeclick_0 @ 0x55c72d7f3b00] Detected clicks in 1952651 of 33147912 samples (5.89072%).
 
I'd like to get my hands on a good ceramic cart. As I can digitally correct both frequency response and crosstalk a ceramic cart might be fun because of the high output. Maybe I can find a Philips GP390 somewhere, just for experiments.

I found a Philips GP 390 without a stylus and two NOS stylus replacement kits. I hope I manage to mount the cantilever correctly. I now have two tries to get it right :) . It promises MM compatibility, no problems with cable capacitance and 8mV of output. It's supposed to work with 1.5g tracking weight and should do full 20-20kHz bandwidth.

I also came across a NOS Philips GP 815. This is just a half-inch mounting adapter combined with the GP 215 ceramic cart. Back when I was about ten years old I had a 22 GA 715 record player amplifier combo with this mounted as standard. The included speakers were quite basic but I still have fond memories of this cheap player.

What got me interested is that according to this spec sheet the output is 375mV! It does want a 1MOhm loading impedance though. I wonder, maybe I can get away with using the regular line input and some serious EQ. This site suggests that the author was able to get a usable frequency response from a ceramic cart (the infamous Chuo Denshi clone) with only a +-10dB EQ. I expect the Philips to be better than this sub-$2 cart, even if it wasn't state of the art when it was new, back in the early 70s.

The downside to this cart (apart from it being a mid-fi ceramic) is a lowly 18dB channel separation figure, a frequency response that is specified as only being 30-16k and tracking weight from 3g to 7g (!!!). I'm really curious what I can extract from this thing with copious amounts of EQ and my crosstalk cancelling routine. I might end up with something usable with a rather high signal/noise ratio. I might also just ruin my test record and conclude that some memories of old "HiFi" should better not be refreshed. I got a spare copy of the test record, just to be safe.

Of course I know that this whole plan is absolutely silly but at this point it has become a kind of sport for me. And, to be honest, if it was just about the best sound quality, I could consider this thing called the CD...

micro acoustics?

It seems that it is really hard to find a stylus for micro acoustics carts. But micro acoustics also made a test record with a focus on transient response. This I did manage to aquire. It might come in handy when evaluating declicking algos.

Let us know if you get the FFMpeg filters running as real time declick would be fun.

I came up with a few ways in which I could use ffmpeg as a realtime declicker but I did not yet find the time to try this out. It's still something I plan to do though. ffmpeg also has some other filters that I'd like to try - downward expansion and surface noise suppression are two that come to mind.

The virtual balanced setup is also still on my to do list. I still did not find the time to make my HTPC dual boot, though.
 
Last edited:
I came up with a few ways in which I could use ffmpeg as a realtime declicker but I did not yet find the time to try this out. It's still something I plan to do though.

It works!!! Here's the magic formula:

Code:
parec --latency-msec=30 --device=your_input_device_here --raw --format float32le --rate 48000 | 
ffmpeg -f f32le -ar 48000 -ac 2 -i pipe:0 -ar 48000 -af adeclick -f s32le -acodec pcm_f32le pipe:1 | 
paplay --latency-msec=500 --device=your_output_device_here --raw --format float32le --rate 48000

I use parec to grab audio from the input, pipe it to ffmpeg, pipe the ffmpeg output to paplay which plays out to my hardware.

Technically ffmpeg has support for pulseaudio built in to the source code. Unfortunately I am using the statically compiled version that comes without PA support. Unix comes to the rescue: just use pipes to get audio in and out of ffmpeg, no hardware support needed.

Latency is about a second. To try it out I just put on an old Tom Jones record that looks as if someone had been ice skating on it. I'm absolutely amazed. There are hardly any clicks left. The very few clicks that are still there are attenuated.

Like with the Rickie Lee Jones track, it does sound a bit 'softer' but it is still very listenable. The original is just trash.

Compared to the Marantz SX 72 DSP declicker I like the one in ffmpeg better. By a lot, actually. Hooray for Free Open Source Software!

Your progress is a lot better than mine! BTW that Rickie lee jones album is available on vinyl and generally affordable (I can see one in DE for €11 ). I bought CD and LP for comparisons I still haven;t had time to perform.

The Rickie Lee LP is on its way. I had not heard her before but liked the track you sent. Technical aspects aside, when I found out that the album was produced by Walter Becker I had to get it.
 
I did some tests now that the Flying Cowboys LP arrived:

The declicker works a lot better on the LP - the residual noise does not contain anything like the faint robot voice that the algo extracted from the CD version. This time it was transients only - but not as many as from the CD. It did get the few clicks that my pressing has.

Too bad that I could not get the declicker to only suppress real clicks and leave the drums alone during the short time I had to test. I changed the threshold and switched between the "overlap-add" and "overlap-save" method. To be honest I'd have to listen again with my IEMs to spot a difference between those two. My laptop speakers gave me no clue.

I made another recording of a really beaten up pressing of Revolver. It's one of those that are so bad that it sounds like a camp fire crackling away right between the speakers. FFmpeg made this copy very listenable again. It wasn't the proverbial "veil being lifted" but rather the campfire being extinguished. It made a barely listenable record sound quite pleasant again. Declicking made it sound a little more boring for lack of a better word but to me the huge increase in clarity made up for it.
I can provide before and after files plus a difference file in case anyone is interested.

Maybe I'll try some upward expansion to add some excitement back into the tracks. FFmpeg has a few expanders included.
 
De-click from LP typically works better before RIAA. Can you route your audio that way for realtime play?

I did not get around to rerouting my setup yet. Still on my to do list.

I felt like listening to some classical music today and tried the declicker with that. The results are excellent. The few clicks that are still left are attenuated and the whole experience is a lot more pleasant. First round was the Berlin Philharmonic Orchestra playing Beethoven's 5th conducted by Karajan. I know this record really well and was surprised at how clean the resulting audio was. As there are no drum beats in Beethoven I could not hear any problems caused by the declick. The result was very good.

The next record I tried was the Chicago Symphony Orchestra playing Scheherazade coducted by Fritz Reiner. I think it's a lovely piece of music but it has such a large dynamic range that ticks and pops make it unlistenable to me for the most part. Once again the declick works like a charm and I can actually concentrate on the music instead of being annoyed by the medium's defects.

Going back to a Steely Dan record (that needs no declicking) the problems with the algo were obvious again: The transients on the drums, especially the snare, were attenuated. It sounds somewhat similar to a worn out cassette tape as far as impulses are concerned. You could call it a little washed out. Still very listenable but not fully transparent.

I went back to the file with the residual noise that the filter removed from my Rickie Lee Jones needle drop. Looking closely at the 'false positive' clicks I noticed that they were exactly on the beat of the music.

After some googling the program called aubio came up. Among a lot of other things it does It can take a piece of audio and print out the timecode of every beat. I can even tell it to look specifically at the onset energy :)

This command ...

Code:
aubiotrack -O energy -i rickieleejones.wav

... will do the trick and the timestamps that this command prints out line up perfectly with the false-positive clicks.

Now I need to figure out a way to have the declicker mute itself a few samples around the timestamps that the aubiotrack command detects as the beat. This way the amount of false-positive samples could be greatly reduced on any music with drums.
 
I went back to the file with the residual noise that the filter removed from my Rickie Lee Jones needle drop. Looking closely at the 'false positive' clicks I noticed that they were exactly on the beat of the music.

Two wrongs don't make a right. Aubio didn't really help me in separating drum beats from clicks in the audio. I had to do a lot of tuning to get it to detect the beat right and then the drum hits were still off by a little bit. If it was really that easy someone else would have done it before me, I guess.

Another weird idea I tried out was using 'spleeter'. It's a fun piece of software that will split an audio track up into multiple tracks, like vocals, bass, drums and "other". I hoped that this could maybe differentiate between clicks and drums so I'd be able to use declick on anything except the drums and then add the untouched drum track back in. Alas, just as any other software so far it lumps the clicks in with the drums. No real benefit here, unfortunately. But it still is impressive to see what ML can do nowadays.

Spleeter uses tensorflow, a machine learning program and can be trained to split anything that it has been fed separate tracks of. So in theory I could train it with music on the one hand and vinyl noise on the other and then teach it to separate the two from any audio I feed it. I don't think that I'd ever have the time to seriously attempt this though.

I'll just try to declick before RIAA next, it's probably still the only thing that can improve the results I am getting with music containing drums. For anything without drums I must say that the FFmpeg filter is very pleasant to listen to even on quieter records. In that case the resulting audio sounds flawless to me.

On the ceramic cart front I have not made any worthwhile progress. I tried to mount the Philips GP 215 on a Philips AF 777 thinking they might be compatible but the GP 215's half inch adapter does not fit at all. I'll have to try the GP 215 with my Grundig PS 4500 next. As far as the GP 390 is concerned I'll probably mount that to the AF 777 as is almost the same shape as the factory installed GP 400. I still have to mount the new stylus on the 390 though.
 
View attachment 852226

As all the graphs were done with simple peak hold, both graphs show absolute worst case behaviour. Of course K2 looks insanely high but I don't think this aspect has any practical relevance. What I do find interesting is the 80dB difference between the +18dB peak and the noise floor at that same frequency. More than I expected, for sure.

What the graphs I mentioned also show is that with low frequencies the groove noise is barely a few dB louder than the LF noise generated by the amplification in the Realtek chip.

During regular listening this was not as obvious as it was when listening to some needle drops with my IEMs. With the IEMs it was clear that on some records the groove noise was louder and on others the low frequency hiss from the gain stage was louder.

While I'm trying to stay as close to the original premise of this thread, that of the $0 preamp, it is not $0 anymore. I bought a 30dB preamp module meant for microphones, the Kemo Electronic M237. It costs about $/€ 12 and claims a bandwidth of 8Hz-60kHz and distortion below 0.02%.

So the project is no longer "free" but "cheap" and on the hardware side no longer "no effort" but "low effort". I'm trying to find a balance between doing as little as possible and as much as needed.

I connected the module to an old SMPS that was left over from an external hard drive. Connected some very short RCA cables and started my software RIAA EQ. Now groove noise is clearly louder than any noise from the preamp stage except for the fact that my test setup is picking up some mains hum from somewhere. Considering that I did not put any effort into shielding for this first test this comes as no surprise.

Input impedance for the module is specified as 100k so I'll add a 65k load for the 100pf cable capacitance I have as Bill suggested in the "what about digital RIAA" thread. Shielding must be taken care of and then I'll get out the test LPs to EQ this setup to be as flat as possible. I'll re-evaluate my crosstalk cancelling setup but I don't expect the values to change as crosstalk will be determined by my cartridge alone.

My long term goal is to (learn how to) build a small preamp stage with some NE5534s. Until now my attempts have not been all that successful as my boards would make popping noises and oscillate. Recently I learned about decoupling caps and I think the oscillation was because I never bothered to bandwidth limit the feedback loop on the opamps. I'm doing my best to take this one step at a time. Patience is something that I'm still learning :)
 
Hi, there. I am starting on electronics and maybe you could help me a bit ? I have soldered an SPDIF output on a Realtek ALC662 microchip. I did not realised I had to put some semiconductors into the wiring but it Its seems ok to do it straight, the driver sees the output. I tried to do the same to get a "line in" imput but it does not work : the driver even don't show it into the software mixer. I have just connected Left and Right channels to pins 23 / 24 and I took the ground from the USB / metal case of the Shuttle mini ITX. Is it not working because I had to put resistors ? Or should I have connected another pin for jack "recognition" ? I attach a part from the chip PDF that shows possible wirings (ignoring what kind of coil are those L things) All help would be much appreciated ! I'm new here .. Thanks !
 

Attachments

  • Line In diagram.jpg
    Line In diagram.jpg
    129.7 KB · Views: 46
Last edited:
Very cool that you managed to add SPDIF to the ALC662. Would you mind sharing some more details on this? What motherboard was this? What components did you add?

It might make more sense to do this in a new thread, as this one is pretty old and was originally about vinyl playback through realtek chips.

I think that you are probably on the right track concerning the jack detection feature. The chip would need to know that the port actually exists.