DhrBaksteen / ArduinoOPL2

Arduino library for use with the OPL2 board (YM3812) and OPL3Duo (YMF262)
MIT License
198 stars 39 forks source link

Clicking and popping #33

Closed s0rent closed 5 years ago

s0rent commented 5 years ago

Hi. I just assembled the board and i can play the demo tune. There is however a lot of loud click noises when the device is idle (possibly also when playing music). When i turn the volume down, the noise disappears. The noise is consistent in both left and right so i dont think its my cabling.

click noise.zip

Ps. about ~9 seconds in i put my finger on cap C10 which removes most of the humming noise. Whats causing the hum? I tried with both PC and battery power, and i used a ground loop isolator on the audio output, but the humming persists. Anyway, the hum is easier to filter out from a recording than the clicks and pops.

s0rent commented 5 years ago

Tried another arduino, Tried different electrolytic caps. Tried putting a cap between VCC and GND on the LM386 which removed some hum. Tried pulling out the Y3014 and LM358 (no audio fed to LM386). The clicking and popping persists.

DhrBaksteen commented 5 years ago

Hi, this is not normal. I always check the chips before sending them out, but to me this sounds like one is damaged. Since you already pulled some my first suspect would be the YM3812.

The hum filtering on this version of the board is not the best I must admit. This is fixed in the next version but as you say it can be fixed simply with an extra capacitor.

I’m currently traveling back home so as of tomorrow I can dive a bit more deeper into this issue.

s0rent commented 5 years ago

Awesome, let me know if there is something you want me to try out (Can be on skype or discord if its more convenient).

I am interested in buying a revision D? board especially if the audio quality is better (i dream of making a synth out of it), any idea when it will be available?

DhrBaksteen commented 5 years ago

Can you try the following? Remove all the chips, listen for clicks and pops and then one by one add the chips back while listening if it starts clicking. You should remove power before adding the next chip and start by adding the LM386 first. Hopefully that will point to the source of your issue and then we see how to fix it.

I'm currently working on the design for the new boards. They will be available around november / december is my plan.

s0rent commented 5 years ago

Cool, will try that. Ordered a couple of ICs from china in case one of those i have is bad.

Will the new board use the same LM358 / LM386 amplification stage? For historical/purist "adlib reasons" I think the use of LM386 is very charming, but I would be interested in a "high-fidelity" version with a better op-amp / power amp and brand name electrolytic caps (if there is a market for two versions?).

DhrBaksteen commented 5 years ago

I'd also be happy to help should you have any broken parts.

I'm not sure yet if the amplifier will be based on the LM386. It has its quirks... I am experimenting with a few different ones (sorry can't remember the types from the top of my head). This line of boards is good for Adlib emulation in DosBox for example or to doodle on an Arduino. I am thinking about making an OPL3 based board with more features (maybe also dual OPL3?) and better support for a MIDI interface, but this is still in an early phase.

s0rent commented 5 years ago

No sound when none of the chips are in place. As soon as i add LM386 the popping starts. I have ordered a bunch of new ones, so when they get here in a month or so then I will test again.

I must admit that i have absolutely no knowledge of how to make my own amp stage to go from what ever the YM3014B DAC outputs to line level / headphones, but seems like you can get some fairly decent opamp ICs without breaking the bank so I might give it a try. Can I ask why you decided to add the LM386 (and not just the LM358)?

Apologies for all the questions, but im pretty fascinated with this thing :)

DhrBaksteen commented 5 years ago

Alright that's a blown LM386 then. If you need some quicker then feel free to contact me on Tindie with your order number.

I chose the LM386 because it's a very common part that is cheap and easy to obtain and it's also part of the original Adlib card schematics. The LM358 by itself is not powerful enough to drive a speaker as it's an op-amp that does not add any gain to the audio signal. It is used as a filter for the DAC, but you can feed the signal from pin 1 or 2 of the LM358 into an external amp and bypass the one on the board.

No worries about the questions :)

s0rent commented 5 years ago

Ah I see. Is there noise from the DAC? I might naively try see if I can use a single OPA1688 instead of both LM's. From the datasheet it looks like it can run on 5V single supply and drive headphones, plus its only 1-2€. Again, it might be a ridiculous idea as I have absolutely no experience in building my own amp.

DhrBaksteen commented 5 years ago

Yes, there is quite a bit of noice coming from the DAC if you're talking about hooking up an amplifier directly to the BUFF pin. The LM358 (or another op-amp) is required by the Y3014. See the datasheet: http://www.atkinsoft.com/datasheets/YM3014B.PDF.

Any AMP should do :) it's just a matter of how much power you want out of it I'd say :)

s0rent commented 5 years ago

I hope the OPA1688 will do, it looks good on paper at least :) I've ordered a handful now. Do you have an updated schematic of your rev C board? Just curious how you do the low pass filtering.

DhrBaksteen commented 5 years ago

I updated the schematic in the repository. The current board doesn't include a low pass filter. In the new design I'm working on there is a RC low pass filter before the amp. It is constructed of the regular 15k resistor and a 22nF capacitor to ground. Not sure if this is final yet... The amplifier I'm currently trying out is using a TDA7052.

s0rent commented 5 years ago

Thanks a lot! :) I made a breadboard "merge" of your schematic with the schematics from the Commodore sound expander (using the OPA1688 op-amps and without low-pass filtering as it doesnt seem necessary) and now it works perfectly :) Not even the slightest white noise or anything at all even with USB power.

DhrBaksteen commented 5 years ago

Great to hear that :+1: