Author Topic: I want to build a DAC for Raspberry Pi 2  (Read 77059 times)

0 Members and 4 Guests are viewing this topic.

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I want to build a DAC for Raspberry Pi 2
« Reply #15 on: July 30, 2015, 01:55:29 pm »
not really, but fist I will buy wire to connect. And also I have to break my 5years Warranty 7.1 Case  >:D

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I want to build a DAC for Raspberry Pi 2
« Reply #16 on: July 30, 2015, 03:02:21 pm »
pix:

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2130
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I want to build a DAC for Raspberry Pi 2
« Reply #17 on: July 31, 2015, 10:04:53 pm »
That looks nice.

Do you know what to do next?

I like to use multi-colored insulated solid copper wire.

This wire plugs into the input pin sockets and stays in nicely.

James.
« Last Edit: July 31, 2015, 10:08:36 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I want to build a DAC for Raspberry Pi 2
« Reply #18 on: August 02, 2015, 12:43:46 pm »
I've got multi-colored insulated solid copper wire.
Do you know what to do next?

>> no realy

I need to know how to connect the amp kit to the 7.1 channels, and the +5v/GND ...

Does it need external power too (12V)?

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2130
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I want to build a DAC for Raspberry Pi 2
« Reply #19 on: August 02, 2015, 01:40:17 pm »
No. You use USB power.

Look at the back of where the USB jack is soldered. You should be able to find two solder spots. One of them will have continuity to the metal jacket of the USB port. That is ground. Having found ground, you should be able to find the +5VDC with your meter (with the sound card powered).

Then you need to look at all those capacitors that are near the audio output jacks. You should find that each one of them is connected in series with the signal contacts on those jacks.

So you should be able to measure continuity from the negative leads of each cap to the signal contacts on the audio jacks to properly identify which cap goes to which output.

The positive sides of each of those caps are connected directly to each channel of the DAC.

That's what you want.

If you tack wires on the positive sides of each of the audio decoupling capacitors you will have 8 wires that are each connected directly to the output of each channel of the 8 channel DAC.

With the sound device powered and the driver loaded in Windows, and the driver set to 8 channels, and the Windows sound system set up for 8 speaker output.....

You should be able to measure a small DC offset voltage on every one of those direct outputs from the DAC when there is no sound being played through the sound device.

It should be about +1.2 to +2.25VDC with respect to ground.

This is the DC offset that the correction amp is designed to NULL.

The correction amp does two things.

It sums a negative voltage with the input, NULLing the DC offset and it provides voltage gain to give you enough voltage to drive your laser projector.

It is also an inverting amp. So you make waves in LaserBoy that are inverted.

Inverted -> inverter = non-inverted.

You only need 6 direct outputs from the DAC for the correction amp, but you should find all 8 so that you can use your setup for Windows or Linux.

If you recall, I found that channels 5 & 6 get swapped with 7 & 8, between Windows and Linux.

I'm sure you can rearrange this in Linux. But it's just as easy to swap the wires.

Plus, all you need to do is put a 47uF capacitor in series with any one of those direct DAC outputs (+lead towards the DAC, -lead towards the audio output) and it becomes a valid audio output again.

This is not the board that you have, but it is a C-Media 6206 sound card.

http://laserboy.org/forum/index.php?topic=8.msg6336#msg6336

Once you have found all of the direct outputs from the DAC, you should figure out a way to identify which channel each one is in a wave file.

You can use Audacity in any OS to make 8 channel waves.

You have to go into edit... preferences... Import / Export.... * use custom mix (for example to export a 5.1 multichannel file).

Then you can create up to 8 channels of waves in Audacity and export the whole thing as one wave file of 8 channels.

You cannot play the 8 channel wave in Audacity.

You have to find a wave player that will do that for you in your OS.

ALSA player can do it in Linux.

Spider Player does it in Windows.

http://laserboy.org/Spider_Player_2.5.3_Setup.exe

I think you will find that

front left and right are channels 1 & 2.

center / sub are 3 & 4.

rear left and right are (6 & 5 in Windows) ... (8 & 7 in Linux)

side left and right are (7 & 8 in Windows) ... (5 & 6 in Linux)

A good way to test this is by making a wave files in LaserBoy of the big white circle, frame 10.

If you make a 10 second wave of the white circle, it will play through Spider Player. You can set Spider Player to loop so it will just keep playing until you stop it. You should change the color of the circle to red, green and blue and makes waves of those colors as well.

Then you can test your sound card to see where the color signals come out.

X and Y for the galvos should always be on channels 1 & 2 == front left and right.

If you hook one meter lead to ground you can measure voltage changes on each of the direct outputs from the DAC.

Since LaserBoy makes inverted waves, by default, you should see the voltage offset drop to closer to zero volts on the color channels when a wave is playing and the wave contains an image that uses the color signal you are seeking. If you use the circle as a test wave, you should also be able to measure some AC voltage on the X and Y signal lines (front left and right).

...... hang on ....... more to come .........
« Last Edit: August 03, 2015, 02:45:00 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I want to build a DAC for Raspberry Pi 2
« Reply #20 on: August 02, 2015, 06:36:06 pm »
ok, I've made first test on raspberry using alsa test 5.1. and a volt meter. looks good

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2130
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I want to build a DAC for Raspberry Pi 2
« Reply #21 on: August 02, 2015, 07:10:54 pm »
OK.

Now you need to know how to adjust the correction amp!

Since you are using ALSA on a Raspberry Pi, you should know about alsamixer. It is possible to have digital gain in the driver of the sound device that is more than 1.0! This will cause the signals to clip coming from the sound card.

Set the maser volume to something like 70% before you do these adjustments.

Once you are done, you can fiddle with the master volume for the USB sound device in alsamixer and set it to the maximum value that does not clip the edges of the big white circle when you project it.

But, remember, when you change the master volume, you are also changing the volume of the color signals.

So you may need to re-adjust your gains on those channels to get back to +5VDC max (with no jumpers on).

This will make more sense if you read the whole thing before you start!




               ILDA PORT
            [:::::::::::::]
 * GND
   (Off) (Gain) [TLO72] (Off) (Gain)
        X       [opamp]    Green

 * V_off
   (Off) (Gain) [TLO72] (Off) (Gain)
        Y       [opamp]     Blue


   (Off) (Gain) [TLO72] (Off) (Gain)
       Red      [opamp]   Intensity


   (adj)        [-vreg]
                        power
                        * * *
                      GND | GND
         INPUT           +5V
      * * * * * *
      X Y R G B I


http://laserboy.org/forum/index.php?topic=561.0

First of all, pull off the jumpers.

If you were starting with an amp that has never been adjusted, you should turn all the 500 ohm offset and voltage regulator adjust trim pots (7 of them) all the way down by rotating them several times counter clockwise. They are 25 turn pots. You might hear or feel clicking when they are all the way down.

Then turn all the 100K gain trim pots (6 of them) all the way up by rotating them several times clockwise.

This will set the gain of every op-amp channel to max (100K) and set the individual offset adjustments (500 ohm) to minimum.

Now take note of the voltage offsets you measured on each wire coming straight out of the DAC channels.

They should all be close to the same voltage.

Pick the lowest voltage.

Multiply this voltage by about -1.5.

This is close to the voltage you want to set on the variable negative voltage regulator.

There is a 500 ohm pot next to the negative voltage regulator.

You can put your meter between ground and the pin labeled V_off.

Turn the 500 ohm pot next to the voltage regulator until you measure a voltage that is -1.5 times the lowest offset voltage you measured from the DAC channels.

This will get you close.

You need to adjust this master offset voltage such that with each channel of the DAC connected to the correction amp, the outputs are very small voltages (like millivolts) but they are all still positive.

With the DB25 ribbon plugged into the amp, you can stick a wire into pin sockets 1, 2, 5, 6, 7 & 8.

1 & 2 are X and Y. 5, 6, 7 are Red, Green and Blue. 8 can be used as a mix of RGB for single color laser systems (intensity).

You need to make sure that you do not over correct with the negative voltage.

You can only add a little bit more negative voltage with the trim 500 ohm pots on each channel.

If you over adjust the voltage regulator to be too negative, you cannot compensate for it with the individual trim pots on each channel.

Since your 100K gain pots are all the way up, this will greatly amplify the results of your offset trim adjustments.

So, get as close as you can. It takes a while to let the voltage regulator settle and sometimes it helps to tap on the trim pots with a pencil or something.

Turning each one of the offset pots up will get you closer to zero volts on each channel. Try to get as close to zero volts as you can on each channel.

You have to keep checking each one several times. Let it sit for a while and come back and test it again.

Once you are happy that you are about as close as you can get you can turn the gain for X and Y way down. These signals drive your scanners.

This is where the wave of the big white circle is needed.

When you play this wave, you are sending full-on voltages to your color control signals. White is full on red, green and blue. You need to adjust the gain for each, red, green, blue and intensity to +5VDC when the wave is playing. Turn the gain pots (100K) down for each of the color channels until each one measures +5VDC.

After you set these voltages, you can put the jumpers back onto the correction amp. These jumpers put a 5V zener diode to ground on each of the color control signals so that they can never go over +5VDC. So make sure the jumpers are always on when you use the correction amp to drive your projector.

Also when the circle wave is playing, you should be able to measure some AC voltage on X and Y. If you turn the gains on these channels way down, you can hook up your laser projector and adjust these gains to control the size of the scanned image. X is width and Y is height. Adjust them to make a perfect circle.

Now make a wave of one of the frames in LaserBoy that is a recognizable image, like the LaserBoy Logo in frame 0 or Quisp in frame 35. Display it on your projector and make sure your X and Y are correct. If the image projects sideways, you need to swap the input wires for X and Y on the correction amp and maybe check the offset adjustments for those channels again.

Then you need to take some nice pictures and post them here!

You're done!

James.
« Last Edit: August 03, 2015, 02:35:01 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I want to build a DAC for Raspberry Pi 2
« Reply #22 on: August 03, 2015, 05:46:12 pm »
setup is ready for testing :-)

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2130
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I want to build a DAC for Raspberry Pi 2
« Reply #23 on: August 03, 2015, 07:43:56 pm »
Looks good. Nice and neat.

Do my instructions make any sense?

Do you have any questions?

It's a good idea to take a black magic marker and mark the pin socket holes on the DB25 ILDA connector at locations 1, 2, 5, 6, 7 & 8. That way you can find them easily for measuring your voltages.

James.
« Last Edit: August 03, 2015, 08:32:21 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I want to build a DAC for Raspberry Pi 2
« Reply #24 on: August 04, 2015, 04:51:22 pm »
min volt was 2,25 V on Channel 8 (Soundcard) so I put the amp to -3,37 V.


All other 500 Ohm down (not all do loop snapping at the bottom, while screwing down) , and all 100k up.

100k Pots: I can come with Ilda pin 1 and pin 2 closly to zero, but not with pin 8 (-0,5 mV at top, screwing down brings only more negativ volt), pin 7 (-1,3mV at top, screwing down brings only more negativ volt) pin 6 (+2,8mV at top, screwing down brings only more volt)


I can hear the circle wave on usbcard's output jack, but there is no signal to the ilda pins, playing that circle wave.


I've tryed diffrent alsamix settings 70% for all, 100% on line 70% on speaker, ..., more master offset less ... turning the amp's cannels 500Ohm pots


always same volt on the ilda pins :-(
« Last Edit: August 04, 2015, 05:07:49 pm by emanuel »

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2130
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I want to build a DAC for Raspberry Pi 2
« Reply #25 on: August 04, 2015, 05:56:22 pm »
One thing to know is that all six channels on the correction amp are exactly the same, except for the 5V zener diodes on the color channels. But if you pull the jumpers, they are not in the circuit.

So all channels should behave in the same way.

If you are measuring small negative voltages on some of your outputs, you have over compensated with the setting of the master negative voltage regulator.

You cannot compensate for too much negative voltage from V_off by adjusting the individual offset adjustments on each channel.

So you need to back off the setting on the negative voltage regulator a tiny bit such that all of the outputs from the correction amp (with the sound card attached) measure some small POSITIVE voltage. Then you can tweak out this small positive voltage by adjusting the individual offset adjustments on each channel.

One more thing that you need to know is that your multi-channel USB sound device might be mixing all of the 6 channels of the LaserBoy waves down to stereo and only outputting from the front left and right channels.

This happens in Windows, if you do not enable the USB sound device in the Windows driver to do 6 or 8 channels.

I'm not sure how you set this in Linux. But I know it can be done. I have my Raspberry Pi 2 set up this way and it works fine.

http://www.photonlexicon.com/forums/showthread.php/23778-controlling-scanners-standalone?p=309861#post309861

BTW, a few millivolts is very close to zero! Once you have your correction amp close to zero and you adjust the gain pots down to show +5VDC on the color channels and a reasonable scan size on the galvo signals when you play the wave of the big white circle, your offset voltages should be very close to zero volts.

Do you have access to an oscilloscope? That can be very useful.

I hope this helps.

I'm here to answer any more questions you might have.

James.
« Last Edit: August 04, 2015, 06:03:34 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2130
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I want to build a DAC for Raspberry Pi 2
« Reply #26 on: August 04, 2015, 09:55:38 pm »
If you are interested, I can make an image of my micro SD card that boots my Pi2 so you could use that image. That way we would be on the same page.

It already has the C++ compiler installed with libSDL and Boost C++ libs, plus the LaserBoy folder is there with all the source code ready to compile.

That's the nicest thing about the Pi2. They are all exactly the same! :)

James.
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I want to build a DAC for Raspberry Pi 2
« Reply #27 on: August 05, 2015, 04:27:53 am »

Do you have access to an oscilloscope?
>> No
if you are interested, I can make an image of my micro SD card
>> could be helpfull, if nothing helps.
I'm using rasbian, sdl, boost, LaserBoy compiled on host.  I'll try again.


usb soundcard channels have at all min 2,25V, amp was -3,37V.
How mutch volts should I use to get better results on the RGB pins?

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2130
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I want to build a DAC for Raspberry Pi 2
« Reply #28 on: August 05, 2015, 12:42:42 pm »
You might never get to exactly zero volts on any of the control signals. Millivolts is thousandths of a volt. That is very close to zero.

The effect that has on your laser projector is minimal.

If there is a tiny voltage, negative or positive, on the galvo signals, all that does is move the scanners a tiny bit off center when there is no signal. No big deal.

A tiny voltage on the color signals is not important either as long as the lasers are off when there is no wave playing.

You just need to get close to zero.

James.
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2130
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I want to build a DAC for Raspberry Pi 2
« Reply #29 on: August 05, 2015, 01:36:09 pm »
Forget about the correction amp for a moment.

You should test your Raspberry Pi2 and sound device to make sure that you are really getting 6 or 8 channel playback.

You can use Audacity to make an 8 channel wave that has something different and recognizable in each channel. You might use a mic and record your own voice saying "One, Two..., Three, Four..." etc... for each channel. When you play it back through the sound device, make sure you hear the correct playback from each channel.

Then you will know that your sound system it working correctly.

Like I said before, it is possible that your device might be mixing all of the channels down to stereo and only outputting on channels 1 & 2 (front left and right).

Also note that when you send a wave to the sound device that is not all 8 channels, the outputs of the channels not assigned by the driver playing the wave are undefined. You cannot assume that they will be silent. When playing a 6 channel wave, it is likely that you will have the green and blue color signals coming from the undefined channels 7 & 8.

If you have your LaserBoy DAC hooked up to an audio system for music tracks in 7 & 8 and you play a 6 channel wave, you'll get color signals sent to your sound system.

LaserBoy has a setting to make 8 channel waves with all zeros in channels 7 & 8.

James.
« Last Edit: August 05, 2015, 02:43:22 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.7 © 2008-2024, SimplePortal