I2S Support (Headphones, external amp, etc)

Moderators: mdrjr, odroid

I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Thu Aug 09, 2018 9:54 pm

The ODROID-GO supports an audio (I2S) DAC on its external connector. I previously stated my intention to officially support this. This post documents the hardware interface.

You will need an I2S DAC such as the popular PCM5102. I have tested the following which is available for less than $10 USD:
Image

Refer to the wiki for the expansion port pinout:
https://wiki.odroid.com/odroid_go/odroid_go#odroid-go_header_p2_description

Five wires need to be connected.
Code: Select all
ODROID-GO -> DAC
---------    ---
 1 GND       GND
 2
 3 IO12      LCK
 4 IO15      DIN
 5 IO4       BCK
 6 P3V3      VIN


To enable the DAC instead of the speaker in the emulators:
https://github.com/OtherCrashOverride/go-play/blob/1953f92b8f98f9723f87f0369c0400da7704cad6/odroid-go-common/components/odroid/odroid_audio.c#L13
Code: Select all
#define BUILTIN_DAC_ENABLED 0

https://github.com/OtherCrashOverride/go-play/blob/1953f92b8f98f9723f87f0369c0400da7704cad6/odroid-go-common/components/odroid/odroid_audio.c#L91-L96
Code: Select all
    i2s_pin_config_t pin_config = {
        .bck_io_num = 4,
        .ws_io_num = 12,
        .data_out_num = 15,
        .data_in_num = -1                                                       //Not used
    };


An official patch will apear in a future release of the emulators.

P.S. Someone please let this guy know about this post:
https://www.youtube.com/watch?v=8DnR3sBm568

----------------------------------------------------

[edit]

HardKernel Stereo Boom Bonnet Kit
https://www.hardkernel.com/main/products/prdt_info.php?g_code=G150067146391
Image
Five wires need to be connected. The power connection (pin 6 or 10) used depends on whether speakers will be used. The 3.3V power supply should be sufficient for headphone use, but the 5V (USB VBUS) power should be used if the speakers are connected to the board. Note the 5V supply is only available when a USB cable is connected to the ODROID-GO. Since this is not an intended use of the hardware, USE AT YOUR OWN RISK. ;)
Code: Select all
ODROID-GO -> DAC
---------    ---
 1 GND       GND
 2
 3 IO12      LRCLK
 4 IO15      OUT
 5 IO4       SCLK
 6 P3V3      P5V0 (for headphone use only)

- or -
Code: Select all
ODROID-GO -> DAC
---------    ---
 1 GND       GND
 2
 3 IO12      LRCLK
 4 IO15      OUT
 5 IO4       SCLK
10 VBUS      P5V0 (headphone/speaker use)
Last edited by crashoverride on Fri Aug 10, 2018 8:10 pm, edited 1 time in total.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby mad_ady » Thu Aug 09, 2018 10:41 pm

P.S. Someone please let this guy know about this post:
https://www.youtube.com/watch?v=8DnR3sBm568

Done.

How does it look, is it sturdy enough?
User avatar
mad_ady
 
Posts: 4567
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Thu Aug 09, 2018 11:13 pm

I just have five jumper wires connecting the two pieces together for testing so not sturdy at all.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby mad_ady » Thu Aug 09, 2018 11:23 pm

So it's not just plugged in - you have to cross some cables?
User avatar
mad_ady
 
Posts: 4567
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Thu Aug 09, 2018 11:33 pm

You have to cross two wires and skip a pin on the expansion port. The guy in the youtube link is designing a "just plug it in" board. My "yes, it really works" test uses parts I had laying around and did not have the expectation of pin-to-pin compatibility.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Thu Aug 09, 2018 11:37 pm

Hi guys,

(that guy here!)

Great work here, as a result I am just laying up a custom board to use the pcm5102 DAC and looking to add headphone detect. I was wondering if the source could be compiled with a detect on a GPIO and remove the compiler directive logic. Is this possible withing the constrains and memory limits of the platform?

*EDIT* Hmmm, just looking at it closer, its probably a moot point. We are just one GPIO short of adding the SPI port expander needed to achieve this :(

Andrew
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Fri Aug 10, 2018 12:23 am

The I2S interface uses all free GPIOs so any auto detect would need to multiplex a pin. I am currently in the process of a new game emulator release that will support an external DAC. My plan is to use a button combination (TBD) to enable/disable it.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 10, 2018 12:25 am

Perfect. I have the Schematics laid out and will probably finish the board layout in a stream tonight. Are you working on a board yourself? If so I can stop what I am doing, I do not want to step on anyone toes!
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Fri Aug 10, 2018 12:33 am

I have no plans to produce a DAC board, and I am not aware of anyone else's plans to produce a DAC board.

[edit]
BTW, I am not an employee of HardKernel, so I do not speak for them.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 10, 2018 12:36 am

Ok thats great, its looking like it can be quite a neat and robust solution. The pin header will offer it a lot of support.

I will let you know when its completed with links to the github. I have a fair few in the backoffice discord who will be building and trying these to test them.

Andrew

--
https://www.youtube.com/backofficeshow
Come chat with me on discord https://discord.gg/6UB4Zj7
Attachments
board.JPG
Odroid-go Headphone Hat
board.JPG (58.2 KiB) Viewed 1846 times
Last edited by backofficeshow on Fri Aug 10, 2018 1:41 am, edited 4 times in total.
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Fri Aug 10, 2018 12:53 am

Looks good! Although I prefer a vertical (out the top) headphone jack, the current location and orientation would probably be the most resilient to jack insertion and removal forces.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 10, 2018 12:59 am

I can [and likely will] probably dual footprint it, great idea.
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 10, 2018 2:22 am

Probably the last post while we wait for PCBs, however, the PCB schematic and board are available at:

https://github.com/backofficeshow/odroid-go-audio-hat

If anyone wants to ping me regarding board and helping with the testing of the hardware, the best way is via the Discord server invite in my footer.

https://www.youtube.com/backofficeshow
Come chat with me on discord https://discord.gg/6UB4Zj7

Alternative link to discord: https://discord.gg/ZsvS7C3
Last edited by backofficeshow on Fri Aug 10, 2018 7:29 am, edited 1 time in total.
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby kamots » Fri Aug 10, 2018 3:53 am

backofficeshow wrote:Come chat with me on discord https://discord.gg/6UB4Zj7


Your link may have expired (it doesn't work).

I've just started making YouTube videos. Would like to ping you for some advice.
kamots
 
Posts: 17
Joined: Sun Jul 01, 2018 6:05 am
languages_spoken: english
ODROIDs: ODROID-GO

Re: I2S Support (Headphones, external amp, etc)

Unread postby mad_ady » Fri Aug 10, 2018 4:07 am

@crashoverride: now that the extension has a stereo speaker does it mean that the sound in the emulators is stereo (if applicable)? Doom, for instance has stereo sound.
User avatar
mad_ady
 
Posts: 4567
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Fri Aug 10, 2018 4:15 am

mad_ady wrote:does it mean that the sound in the emulators is stereo (if applicable)?

I think only GB/GBC and GG are stereo. The others are mono but output over both left and right channels.

mad_ady wrote:Doom, for instance has stereo sound.

Doom has no sound. ;)
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby mad_ady » Fri Aug 10, 2018 5:06 am

Doom has no sound.

Yet...
User avatar
mad_ady
 
Posts: 4567
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 10, 2018 7:30 am

kamots wrote:
backofficeshow wrote:Come chat with me on discord https://discord.gg/6UB4Zj7


Your link may have expired (it doesn't work).

I've just started making YouTube videos. Would like to ping you for some advice.


I added an alternative just incase
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby rooted » Fri Aug 10, 2018 8:23 am

backofficeshow wrote:
kamots wrote:
backofficeshow wrote:Come chat with me on discord https://discord.gg/6UB4Zj7


Your link may have expired (it doesn't work).

I've just started making YouTube videos. Would like to ping you for some advice.


I added an alternative just incase
Nice work on the hat.
mad_ady wrote:
Doom has no sound.

Yet...
:)
User avatar
rooted
 
Posts: 5562
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: I2S Support (Headphones, external amp, etc)

Unread postby lordhardware » Fri Aug 10, 2018 1:40 pm

Hey Crash, what's the intention regarding volume control on the DAC?
Obviously the volume toggle on the inbuilt mono dac will no longer be relevant, does the emu yet support control of the external DAC?
lordhardware
 
Posts: 54
Joined: Sat Sep 20, 2014 11:56 pm
languages_spoken: english
ODROIDs: U3
Odroid-W

Re: I2S Support (Headphones, external amp, etc)

Unread postby mad_ady » Fri Aug 10, 2018 1:45 pm

Since both are i2s I think volume control will work the same way (with the same code). Only initialization differs since it activates the other DAC
User avatar
mad_ady
 
Posts: 4567
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: I2S Support (Headphones, external amp, etc)

Unread postby kamots » Fri Aug 10, 2018 1:46 pm

lordhardware,

It uses the same volume control for both the internal DAC and external DACs. Was just talking to crashoverride about this today.
kamots
 
Posts: 17
Joined: Sun Jul 01, 2018 6:05 am
languages_spoken: english
ODROIDs: ODROID-GO

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 10, 2018 3:18 pm

Looking at the code I would concur totally, the only difference might be the number of steps the user might like or a different rank up curve. Easily solved in the short term with headphones with volume controls until we figure out the best combination. We just need to make sure quiet is quiet enough and loud is not deafening - the detail in between we can tinker with.
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby lordhardware » Fri Aug 10, 2018 6:50 pm

Oh ok, so the solution to volume will still be an analogue potentiometer.
Ive ordered the parts online so i can give it a shot next week
lordhardware
 
Posts: 54
Joined: Sat Sep 20, 2014 11:56 pm
languages_spoken: english
ODROIDs: U3
Odroid-W

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 10, 2018 7:27 pm

Logically as you will be able to switch from the internal DAC to the external one via software there is no reason that the headphone volume curves will need to match the speakers.

So be careful, you could be working on something for problem that might not exist by the time the boards are made :)

(Also volume button + Dpad up and Dpad down might be a really nice way of implementing an adjustable control - especially if an OSD was possible)
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Fri Aug 10, 2018 8:12 pm

lordhardware wrote:what's the intention regarding volume control on the DAC?

I updated the original post with instructions for HardKernel's Stereo Boom Bonnet. It has a volume knob.

Volume control in the emulators is the same as for the internal speaker. Pressing the Volume button selects from the predefined levels.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Fri Aug 10, 2018 8:23 pm

backofficeshow wrote:I can [and likely will] probably dual footprint it,

It has been brought to my attention that using a vertical jack is the only way to allow ODROID-GO to rest in your pocket while using headphones. Currently, this is not a scenario that makes any sense for emulator use, but its applicable to future use such as MP3 player or A2DP BT headphone apps.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby lordhardware » Fri Aug 10, 2018 10:40 pm

crashoverride wrote:
backofficeshow wrote:I can [and likely will] probably dual footprint it,

It has been brought to my attention that using a vertical jack is the only way to allow ODROID-GO to rest in your pocket while using headphones. Currently, this is not a scenario that makes any sense for emulator use, but its applicable to future use such as MP3 player or A2DP BT headphone apps.


Im going to place my jack verticle between the posts of the speaker bracket facing downwards.

I cant think that anywhere else wouls be conducive to good emulator play with cables running over screens or getting in the way of buttons
lordhardware
 
Posts: 54
Joined: Sat Sep 20, 2014 11:56 pm
languages_spoken: english
ODROIDs: U3
Odroid-W

Re: I2S Support (Headphones, external amp, etc)

Unread postby mad_ady » Sat Aug 11, 2018 12:02 am

It's great that you made it work with the boom bonnet!
User avatar
mad_ady
 
Posts: 4567
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Sat Aug 11, 2018 3:12 am

crashoverride wrote:
backofficeshow wrote:I can [and likely will] probably dual footprint it,

It has been brought to my attention that using a vertical jack is the only way to allow ODROID-GO to rest in your pocket while using headphones. Currently, this is not a scenario that makes any sense for emulator use, but its applicable to future use such as MP3 player or A2DP BT headphone apps.


As mentioned, it's dual footprinted and the boards are currently in production so both modalities are covered.
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Sat Aug 11, 2018 5:47 am

DAC support is enabled in todays 20180810 release of the Go-Play. The external DAC can be enabled ONLY from the main menu that shows all the emulators. Hold "Volume" and press "Right" to toggle it. The speaker icon in the upper left corner will change to indicate the mode.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby rooted » Sat Aug 11, 2018 5:56 am

Great work crashoverride, now if only someone would get some stock so I can play.
User avatar
rooted
 
Posts: 5562
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Wed Aug 15, 2018 2:30 am

Just an update, PCBWay really came through and got me these boards in super quick time, even before I got a BOM ordered!

We are already designing the V2 (With volume control), however, it is really cool noting that these boards can be mounted in two different orientations. I think I will ensure that the headphone socket can be mounted on the rear face or the front face as required.

It was just a bit of luck that the scalloping I put on the edge of the board more or less follows the contours of the Odroid-go quite well!

Andrew

--
https://www.youtube.com/backofficeshow
https://twitter.com/backofficeshow
Come chat with me on discord https://discord.gg/xV2TGV2
Attachments
IMG_20180814_173847.jpg
IMG_20180814_173847.jpg (462.46 KiB) Viewed 1034 times
IMG_20180814_173859.jpg
IMG_20180814_173859.jpg (629.56 KiB) Viewed 1034 times
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby mad_ady » Wed Aug 15, 2018 3:34 am

The flat approach is quite nice
User avatar
mad_ady
 
Posts: 4567
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: I2S Support (Headphones, external amp, etc)

Unread postby lordhardware » Wed Aug 15, 2018 5:23 pm

Flat with rear would be the way to go i reckon.
lordhardware
 
Posts: 54
Joined: Sat Sep 20, 2014 11:56 pm
languages_spoken: english
ODROIDs: U3
Odroid-W

Re: I2S Support (Headphones, external amp, etc)

Unread postby rooted » Thu Aug 16, 2018 2:04 am

Or flat and side.
User avatar
rooted
 
Posts: 5562
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: I2S Support (Headphones, external amp, etc)

Unread postby lordhardware » Thu Aug 16, 2018 7:01 am

Parts from ali express have still not arrived so i havent been able to do the internal DAC as yet, really excited.
lordhardware
 
Posts: 54
Joined: Sat Sep 20, 2014 11:56 pm
languages_spoken: english
ODROIDs: U3
Odroid-W

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 17, 2018 2:05 am

Just an update, all the BOM and parts have arrived, there are at least two of us testing the boards tonight/tomorrow will keep you updated

--
https://www.youtube.com/backofficeshow
https://twitter.com/backofficeshow
Come chat with me on discord https://discord.gg/xV2TGV2
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english

Re: I2S Support (Headphones, external amp, etc)

Unread postby crashoverride » Fri Aug 17, 2018 4:48 am

The distortion on the output lines can occur if you do not have the recommended filter circuit on the DAC output lines:
http://www.ti.com/lit/ds/symlink/pcm5102.pdf
p. 27

[edit]
FYI, the distortion does not occur on other DAC boards using the reference design.

[edi2]
Yes, the resisters are required or audio will distort at peak levels.

[edi3]
The DAC is stereo, the old emulators are NOT. Only GB/GBC and GG support true stereo.
crashoverride
 
Posts: 3978
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: I2S Support (Headphones, external amp, etc)

Unread postby backofficeshow » Fri Aug 17, 2018 5:30 am

Thanks everyone who joined the stream,

Glad we got there in the end, despite a little frustration! I am amazed by all the work you guys have put into this and how its all pretty seamless once you have the right firmware on there etc!

I have attached a couple of pictures, you can see its not using the correct headphone jack, but we managed to fit this one instead for testing. I might just keep it as it works fine!

Its a bit of a long stream, but here it is if anyone was interested, https://www.youtube.com/watch?v=j9-wCR7noaQ I will likely do a bench build of one of these in the not so distant future - higher quality and with less swearing :)

Thanks again crashoverride and kamots!

Andrew

--
https://www.youtube.com/backofficeshow
https://twitter.com/backofficeshow
Come chat with me on discord https://discord.gg/xV2TGV2
Attachments
IMG_20180816_211621.jpg
IMG_20180816_211621.jpg (230.59 KiB) Viewed 816 times
IMG_20180816_211615.jpg
IMG_20180816_211615.jpg (261.64 KiB) Viewed 816 times
backofficeshow
 
Posts: 12
Joined: Thu Aug 09, 2018 11:31 pm
languages_spoken: english


Return to General Chat

Who is online

Users browsing this forum: No registered users and 4 guests