analog audio

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

jemismyname
Atari freak
Atari freak
Posts: 69
Joined: Wed Feb 27, 2019 8:25 pm

analog audio

Postby jemismyname » Fri Apr 12, 2019 2:26 am

so i was looking at the schematic for the I/O board... i can just tap pins 2 and 7 from the GPIO1, and those are my left and right audio outputs?

Other than some filtering or preamp stuff, is there anything else i would need to fiddle with to get audio out of the board?

I dont' really need a full on I/O board, but analog audio would be nice, because my monitor has crap speakers and it doesn't have an audio output

THaase
Captain Atari
Captain Atari
Posts: 183
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: analog audio

Postby THaase » Fri Apr 12, 2019 4:06 am

You will also need the following low pass filter that follows.
So C1 - C6 & R24 - R27

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4931
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: analog audio

Postby Sorgelig » Fri Apr 12, 2019 6:14 am

THaase wrote:You will also need the following low pass filter that follows.
So C1 - C6 & R24 - R27

they are not low=pass filters. They are DAC.
And of course they are required.

THaase
Captain Atari
Captain Atari
Posts: 183
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: analog audio

Postby THaase » Fri Apr 12, 2019 7:07 am

Well - I really have to use google that this construction is called PWM-DAC .... :-)

From electrical point of view ist a RC-Low-Pass of 2nd-order ....
With Corner Frequency of about 28kHz (28421Hz) and a -3dB-Frequency of about 18kHz (18291Hz) followed by a decoupling capacitor ....
Typical (often used as it's cheap of cost) schematic to convert PWM to analog audio - really didn't know that this is also called PWM-DAC :-)

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4931
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: analog audio

Postby Sorgelig » Fri Apr 12, 2019 7:54 am

This is not PWM-DAC. It's Sigma-Delta DAC :)
It's kind of similar but still different DACs. I didn't study why, but SD is more popular than PWM in audio.
PWM is when constant frequency pulses have different duty. Sigma-Delta has same sized pulses - with different amounts. They start from rare positive pulses and the end by rare negative pulses.

Actually, even without this SD-DAC circuit, many connected devices will be able to get audio. Just because any capacitor on input circuit will become part of SD-DAC with good or bad result :)

witchmaster
Atari maniac
Atari maniac
Posts: 84
Joined: Wed Jun 15, 2011 10:50 am

Re: analog audio

Postby witchmaster » Fri Apr 12, 2019 8:20 am

I extracted the audio part from the IO Board schematic when I soldered up the analog audio circuit on perfboard. Here it is:
IO-Audio-Out.png
You do not have the required permissions to view the files attached to this post.
Last edited by witchmaster on Fri Apr 12, 2019 9:47 am, edited 2 times in total.

THaase
Captain Atari
Captain Atari
Posts: 183
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: analog audio

Postby THaase » Fri Apr 12, 2019 8:21 am

Thanks for clarification - I've not checked the FPGA Cores till now - I was just expecting PWM ....

THaase
Captain Atari
Captain Atari
Posts: 183
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: analog audio

Postby THaase » Fri Apr 12, 2019 8:24 am

witchmaster wrote:I extracted the audio part from the IO Board schematic when I soldered up the analog audio circuit on perfboard. Here it is:
IO-Audio-Out.png

Nice - but you should add Pin 12/14 as GND - it's maybe then more clear for some people.

witchmaster
Atari maniac
Atari maniac
Posts: 84
Joined: Wed Jun 15, 2011 10:50 am

Re: analog audio

Postby witchmaster » Fri Apr 12, 2019 8:32 am

THaase wrote:
witchmaster wrote:I extracted the audio part from the IO Board schematic when I soldered up the analog audio circuit on perfboard. Here it is:
IO-Audio-Out.png

Nice - but you should add Pin 12/14 as GND - it's maybe then more clear for some people.

You're right, I updated the schematic.

JamesF
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 126
Joined: Sat Dec 15, 2018 6:46 am

Re: analog audio

Postby JamesF » Fri Apr 12, 2019 9:41 am

I believe is Pin 10 & 12 for ground.
Pin 14 is clock.

THaase
Captain Atari
Captain Atari
Posts: 183
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: analog audio

Postby THaase » Fri Apr 12, 2019 9:44 am

Sorry - you're right ....

witchmaster
Atari maniac
Atari maniac
Posts: 84
Joined: Wed Jun 15, 2011 10:50 am

Re: analog audio

Postby witchmaster » Fri Apr 12, 2019 9:51 am

JamesF wrote:I believe is Pin 10 & 12 for ground.
Pin 14 is clock.

God damn! :) Only pins 12 and 30 are ground according to the DE10-Nano user manual, edited the schematic again.

JamesF
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 126
Joined: Sat Dec 15, 2018 6:46 am

Re: analog audio

Postby JamesF » Fri Apr 12, 2019 10:23 am

I strongly recommend buying a small DAC which outperforms the analog output on the mister.

Many people use this one with the mister, including me:
https://www.ebay.com/itm/Optical-Coaxia ... R&LH_BIN=1

Instead of building a RC dac for the analog pins, build a red led for the SPDIF signal of the mister on pin 9.
I actually built both audio dongles before buying a IO board, trust me when I say you want the red led and the ebay dac.
Image

BBond007
Captain Atari
Captain Atari
Posts: 366
Joined: Wed Feb 28, 2018 3:23 am

Re: analog audio

Postby BBond007 » Fri Apr 12, 2019 11:08 am

jemismyname wrote:I dont' really need a full on I/O board, but analog audio would be nice, because my monitor has crap speakers and it doesn't have an audio output


Check out this post by user Shamus:

viewtopic.php?f=117&t=34468&p=354727#p355203

witchmaster
Atari maniac
Atari maniac
Posts: 84
Joined: Wed Jun 15, 2011 10:50 am

Re: analog audio

Postby witchmaster » Fri Apr 12, 2019 11:21 am

JamesF wrote:I strongly recommend buying a small DAC which outperforms the analog output on the mister.

Many people use this one with the mister, including me:
https://www.ebay.com/itm/Optical-Coaxia ... R&LH_BIN=1

Instead of building a RC dac for the analog pins, build a red led for the SPDIF signal of the mister on pin 9.
I actually built both audio dongles before buying a IO board, trust me when I say you want the red led and the ebay dac.

Interesting, have to give that a go!
Last edited by witchmaster on Sat Apr 13, 2019 6:09 am, edited 1 time in total.

jemismyname
Atari freak
Atari freak
Posts: 69
Joined: Wed Feb 27, 2019 8:25 pm

Re: analog audio

Postby jemismyname » Fri Apr 12, 2019 3:34 pm

I am actually a big fan of sigma-delta audio. I think it often sounds superior to linear PCM (pulse code modulation) in both high-fi (such as DSD or SACD) and lo-fi applications (such as the NES sample channel).

the fact is, if you look at the datasheets of most audio converters created since the mid 90s, you will find that they employ (oversampled) sigma-delta conversion and then convert that signal to or from PCM at a lower frequency. Truely linear PCM converters are pretty rare.

PWM (pulse width modulation) doesn't really work for digital audio because you need instantaneous samples, but PWM encodes the value of a word as a function of time.

I am curious what is the sample rate of the Sigma-delta output of the MISTer?
Last edited by jemismyname on Fri Apr 12, 2019 3:52 pm, edited 1 time in total.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4931
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: analog audio

Postby Sorgelig » Fri Apr 12, 2019 7:18 pm

The master clock for sigma-delta encoder is 50MHz.

User avatar
Newsdee
Atari God
Atari God
Posts: 1435
Joined: Fri Sep 19, 2014 8:40 am

Re: analog audio

Postby Newsdee » Sat Apr 13, 2019 1:43 am

How does this optical audio conversion compare to using an HDMI audio splitter like this one?

https://www.amazon.com/iArkPower-Extrac ... B01I9JG70A

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4931
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: analog audio

Postby Sorgelig » Sat Apr 13, 2019 5:51 am

Newsdee wrote:How does this optical audio conversion compare to using an HDMI audio splitter like this one?

https://www.amazon.com/iArkPower-Extrac ... B01I9JG70A

generally speaking both ways produce the same digital audio.

witchmaster
Atari maniac
Atari maniac
Posts: 84
Joined: Wed Jun 15, 2011 10:50 am

Re: analog audio

Postby witchmaster » Sat Apr 13, 2019 6:14 am

JamesF wrote:Instead of building a RC dac for the analog pins, build a red led for the SPDIF signal of the mister on pin 9.

By the way, how do you connect the toslink cable to the adapter? You have some kind of plastic ring around the perfboard, can you give some more details, thanks! :)

BBond007
Captain Atari
Captain Atari
Posts: 366
Joined: Wed Feb 28, 2018 3:23 am

Re: analog audio

Postby BBond007 » Sat Apr 13, 2019 7:37 am

witchmaster wrote:By the way, how do you connect the toslink cable to the adapter? You have some kind of plastic ring around the perfboard, can you give some more details, thanks! :)


Just needs to hold the optical cable close... you could use a ziptie.

I had a really long optical cable that got caught up in the vacuum cleaner and torn off. I just chopped it flush with some wire cutters and stuck it in the receiver port holding it in place with some sticky tack. Worked fine.

Newsdee wrote:How does this optical audio conversion compare to using an HDMI audio splitter like this one?

https://www.amazon.com/iArkPower-Extrac ... B01I9JG70A


That one costs 5x more, so unless its 5x better... :)

JamesF
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 126
Joined: Sat Dec 15, 2018 6:46 am

Re: analog audio

Postby JamesF » Sat Apr 13, 2019 9:19 am

Newsdee wrote:How does this optical audio conversion compare to using an HDMI audio splitter like this one?
https://www.amazon.com/iArkPower-Extrac ... B01I9JG70A

These HDMI to HDMI+Audio boxes do not always work.
I have a few that do not accept non standard HDMI signals, and others that lose sync every few seconds.
The chinese TOSLINK dac is much more stable and handles only audio at any sample rate it is given, including 96kHz.

witchmaster wrote:By the way, how do you connect the toslink cable to the adapter? You have some kind of plastic ring around the perfboard, can you give some more details, thanks! :)

I have a IO board now, but the rubber gas pipe ring held the toslink connector just fine, a zip-tie will also do.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4931
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: analog audio

Postby Sorgelig » Sat Apr 13, 2019 9:39 am

Some one really interested can try to connect spdif output directly to coaxial SPDIF input, so it won't need the optical cable.
It's better to use it through 200 Ohm resistor to make sure FPGA output won't be overloaded.

jemismyname
Atari freak
Atari freak
Posts: 69
Joined: Wed Feb 27, 2019 8:25 pm

Re: analog audio

Postby jemismyname » Thu Apr 18, 2019 12:15 am

Sorgelig wrote:The master clock for sigma-delta encoder is 50MHz.


This is a really interesting thing to notice for me. The highest quality digital recorders available record and playback sigma-delta at 2.8 or 5.6 Mhz, and use a so called noise-shaping filter which pushes quantization noise into the inaudible range.

the cheapest ones are $400 to $700, and then up from there.

The highest quality digital audio workstations in the world are called Pyramix and each component costs thousands of dollars... I looked at a picture of the pyramix DAC board, which, by itself costs $2000 and it uses a Xilinx Virtex II FPGA (plus a lot of analog hardware, of course)... Although i have no idea how a Virtex II compares to a Cyclone V, i thought the Virt-II was pretty old.

Anyhow, you've got me thinking, that this DE-10 nano could easily output or record super high quality audio for a fraction of the cost of these systems...

I'm gonna seriously look into this

Can you please point me to some good references on implementing sigma-delta audio on an FPGA?

I imagine it's pretty simple, right? you just compare the current sample with the last one and output a 1 if it's larger and a 0 if it's smaller, if i understand correctly...

What i don't understand is how you get a higher frequency output than what is recorded?
Last edited by jemismyname on Thu Apr 18, 2019 12:39 am, edited 1 time in total.

jemismyname
Atari freak
Atari freak
Posts: 69
Joined: Wed Feb 27, 2019 8:25 pm

Re: analog audio

Postby jemismyname » Thu Apr 18, 2019 12:34 am

(double post, delete please)


Return to “MiSTer”

Who is online

Users browsing this forum: arit and 6 guests