Stefan Huus Gregersen Posted December 24, 2017 Share Posted December 24, 2017 Hello folks, Been working on making I2S dacs work on the Orange Pi Zero, after reading on a few pages i got crazy and almost gave up and then i did some playaround and managed to make it work! And this is how i did! I am using examples from the topic here, as it was well written until i had to figure things out myself because of that stupid wifi_enable on PA20 which also is the data out on the OPI zero Thread: https://forum.armbian.com/topic/759-i2s-on-orange-pi-h3/ First up it requires a bit of soldering, removing the R69 and adding a small wire is required to access the DIN(data in) or so called PA20. What i did was just simply adding a header so i can just connect it there as shown After you have added the resistor it is time to wire up the device. For my example im using the PCM5102 board as example. You can buy it really cheap on Aliexpress and ebay! Afterwards it is time to configure the device. Start by entering the script file cd /boot sudo bin2fex script.bin script.fex sudo nano script.fex Then we'll have to change the following [twi1] twi_used = 1 to [twi1] twi_used = 0 and [pcm0] daudio_used = 0 to [pcm0] daudio_used = 1 Then the part that i have discovered Because of the PA20 is used to enable the wifi it would not work with the sound card unless you change the PA20 to another pin so now we'll have to do the following Find the following and change it: [smc_para] smc_used = smc_rst = port:PA09<2><default><default><default> smc_vppen = port:PA20<3><default><default><default> Change it to smc_vppen = port:PA02<3><default><default><default> Find [module_para] module_power0 = port:PA20<1><default><default><0> Change it to [module_para] module_power0 = port:PA02<1><default><default><0> Then there is another SMC_Para hidden, the only difference is that it is SMC_USED = 0 where the other is SMC_used = [smc_para] smc_used = 0 smc_rst = port:PA09<2><default><default><default> smc_vppen = port:PA20<3><default><default><default> And to [smc_para] smc_used = 0 smc_rst = port:PA09<2><default><default><default> smc_vppen = port:PA02<3><default><default><default> That should be it! Save your file and run the last command needed! sudo fex2bin script.fex script.bin You can test the audio by using the following command speaker-test -twav -c2 -Dhw:1 I am still working on figuring out how to change the default audio device to the I2S. I am a noob in Linux, i am more a hardware man than a software man I hope you guys manage to make it work! 1 Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted December 25, 2017 Author Share Posted December 25, 2017 And to change the default output device: Do the following open asound nano /etc/asound.conf Add the following code pcm.!default { type hw card 1 } and save, no need to restart You have now a full functional DAC to your OPI Zero Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted December 25, 2017 Author Share Posted December 25, 2017 Still working on increasing the frequency to 192KHz and 32 sample resolution as the Datasheet of the H3 says it support. I might need to get my hands on some audio files that support the maximum output to test it. I am currently using mpg123 to play the audio but not sure about it it has limits.. Link to comment Share on other sites More sharing options...
Jeremy Lake Posted January 9, 2018 Share Posted January 9, 2018 (edited) Excellent article! Although I think this may only work with the earlier revision of the board. Take a gander at my v1.4; seems the manufacturers *really* don't want DA20/i2c PA20/i2s being accessed on the newer OPi zero Edited January 11, 2018 by Jeremy Lake typos Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted January 9, 2018 Author Share Posted January 9, 2018 2 hours ago, Jeremy Lake said: Excellent article! Although I think this may only work with the earlier revision of the board. Take a gander at my v1.4; seems the manufacturers *really* don't want DA20/i2c being accessed on the OPi zero Oh.. I see, i will look into that for you Edit: Oh man.. hey completely removed that resistor and the access to the PA20 after version 1.1. What you can do tho is modifying the USB_detect for CN1(The micro usb). It has a 1K resistor but as the Schematics for version 1.4 is not available unless hidden somewhere. I will have to look into that mod and have a look at it! Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted January 9, 2018 Author Share Posted January 9, 2018 7 minutes ago, Stefan Huus Gregersen said: Oh.. I see, i will look into that for you Edit: Oh man.. hey completely removed that resistor and the access to the PA20 after version 1.1. What you can do tho is modifying the USB_detect for CN1(The micro usb). It has a 1K resistor but as the Schematics for version 1.4 is not available unless hidden somewhere. I will have to look into that mod and have a look at it! Can you do me a favor and take another picture of the backside? Link to comment Share on other sites More sharing options...
Jeremy Lake Posted January 11, 2018 Share Posted January 11, 2018 On 09/01/2018 at 11:28 PM, Stefan Huus Gregersen said: Can you do me a favor and take another picture of the backside? Thanks for taking the time to look at this. I went hunting for the schematics, but the signup page to download them is currently throwing 500 errors. Link to comment Share on other sites More sharing options...
zador.blood.stained Posted January 11, 2018 Share Posted January 11, 2018 33 minutes ago, Jeremy Lake said: I went hunting for the schematics, but the signup page to download them is currently throwing 500 errors. Rev. 1.1 schematics are available on the linux-sunxi wiki: https://linux-sunxi.org/File:Orange-Pi-Zero-Schanetics-v1_11.pdf Unfortunately Xunlong didn't provide schematics for the Rev. 1.4. Link to comment Share on other sites More sharing options...
Jeremy Lake Posted January 11, 2018 Share Posted January 11, 2018 10 minutes ago, zador.blood.stained said: Rev. 1.1 schematics are available on the linux-sunxi wiki: https://linux-sunxi.org/File:Orange-Pi-Zero-Schanetics-v1_11.pdf Unfortunately Xunlong didn't provide schematics for the Rev. 1.4. Thanks for that. I think earlier in this post I meant PA20 and I2S (in case someone else reads this text and gets confused). Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted January 15, 2018 Author Share Posted January 15, 2018 On 11/1/2018 at 2:52 PM, Jeremy Lake said: Thanks for that. I think earlier in this post I meant PA20 and I2S (in case someone else reads this text and gets confused). Hmm.. Not alot to work with sadly, if i had it here i would be able to find the resistor but it is a bit hard. It is called R157 and is a part of the other data bus so you could use that instead Link to comment Share on other sites More sharing options...
Jeremy Lake Posted January 17, 2018 Share Posted January 17, 2018 On 16/01/2018 at 8:18 AM, Stefan Huus Gregersen said: Hmm.. Not alot to work with sadly, if i had it here i would be able to find the resistor but it is a bit hard. It is called R157 and is a part of the other data bus so you could use that instead Thanks all the same. Link to comment Share on other sites More sharing options...
markbirss Posted January 18, 2018 Share Posted January 18, 2018 On 12/25/2017 at 12:29 AM, Stefan Huus Gregersen said: Hello folks, Been working on making I2S dacs work on the Orange Pi Zero, after reading on a few pages i got crazy and almost gave up and then i did some playaround and managed to make it work! And this is how i did! I am using examples from the topic here, as it was well written until i had to figure things out myself because of that stupid wifi_enable on PA20 which also is the data out on the OPI zero Thread: https://forum.armbian.com/topic/759-i2s-on-orange-pi-h3/ First up it requires a bit of soldering, removing the R69 and adding a small wire is required to access the DIN(data in) or so called PA20. What i did was just simply adding a header so i can just connect it there as shown After you have added the resistor it is time to wire up the device. For my example im using the PCM5102 board as example. You can buy it really cheap on Aliexpress and ebay! Afterwards it is time to configure the device. Start by entering the script file cd /boot sudo bin2fex script.bin script.fex sudo nano script.fex Then we'll have to change the following [twi1] twi_used = 1 to [twi1] twi_used = 0 and [pcm0] daudio_used = 0 to [pcm0] daudio_used = 1 Then the part that i have discovered Because of the PA20 is used to enable the wifi it would not work with the sound card unless you change the PA20 to another pin so now we'll have to do the following Find the following and change it: [smc_para] smc_used = smc_rst = port:PA09<2><default><default><default> smc_vppen = port:PA20<3><default><default><default> Change it to smc_vppen = port:PA02<3><default><default><default> Find [module_para] module_power0 = port:PA20<1><default><default><0> Change it to [module_para] module_power0 = port:PA02<1><default><default><0> Then there is another SMC_Para hidden, the only difference is that it is SMC_USED = 0 where the other is SMC_used = [smc_para] smc_used = 0 smc_rst = port:PA09<2><default><default><default> smc_vppen = port:PA20<3><default><default><default> And to [smc_para] smc_used = 0 smc_rst = port:PA09<2><default><default><default> smc_vppen = port:PA02<3><default><default><default> That should be it! Save your file and run the last command needed! sudo fex2bin script.fex script.bin You can test the audio by using the following command speaker-test -twav -c2 -Dhw:1 I am still working on figuring out how to change the default audio device to the I2S. I am a noob in Linux, i am more a hardware man than a software man I hope you guys manage to make it work! Stefan kindly share link for the i2s dac aliexpress. I think i had 1 of these Link to comment Share on other sites More sharing options...
andrikll Posted February 18, 2018 Share Posted February 18, 2018 Hello, It can is possible to call this contact? I have too v1.4 Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 21, 2018 Author Share Posted February 21, 2018 On 18/1/2018 at 10:07 AM, markbirss said: Stefan kindly share link for the i2s dac aliexpress. I think i had 1 of these Hello, sorry it is long time since i have been activehttps://www.aliexpress.com/item/Interface-I2S-PCM5102-DAC-Decoder-GY-PCM5102-I2S-Player-Module-For-Raspberry-Pi-pHAT-Format-Board/32833996405.html?spm=2114.search0104.3.20.749c3092lsgAgP&ws_ab_test=searchweb0_0,searchweb201602_2_10152_10151_10065_10344_10068_10342_10343_10340_10341_10084_10083_10618_10630_10304_10307_10302_5722317_5711211_10313_10059_10534_100031_10629_10103_10626_10625_10624_10623_10622_10621_10620_10142,searchweb201603_25,ppcSwitch_3&algo_expid=433dce46-a79f-4428-b62b-90f0fc5620f0-3&algo_pvid=433dce46-a79f-4428-b62b-90f0fc5620f0&transAbTest=ae803_5&priceBeautifyAB=0 This one Link to comment Share on other sites More sharing options...
leonidy-85 Posted February 21, 2018 Share Posted February 21, 2018 On 15.01.2018 at 10:18 PM, Stefan Huus Gregersen said: Hmm.. Not alot to work with sadly, if i had it here i would be able to find the resistor but it is a bit hard. It is called R157 and is a part of the other data bus so you could use that instead I have correctly understood to connect DAC I need to remove R157 and on his place to solder a wire? Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 22, 2018 Author Share Posted February 22, 2018 9 hours ago, leonidy-85 said: I have correctly understood to connect DAC I need to remove R157 and on his place to solder a wire? Good job mate! Now it is just about finding out where things are connected, it sadly requires a multimeter next step. Above R157 there is a resistor called R40, to find out which leg we'll use as data out for the DAC you'll have to measure which pad of the two resistors have a connection, as seen on the USB plug R40 puts R157 to 3.3v. When you know which pad is 3.3v please inform me and next step would be to remove R157 and solder a wire to it so you can connect it to your DAC.. Man i wish i had a newer board so i could try it out.. 1 Link to comment Share on other sites More sharing options...
andrikll Posted February 22, 2018 Share Posted February 22, 2018 Got it, I'll call and take a picture of macro. Do I understand correctly that i need to the right (under the scheme) point R157 connect and desolder the resistor? R40 desoldering it is desirable to not have voltage on contact from? Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 23, 2018 Author Share Posted February 23, 2018 On 22/2/2018 at 1:27 PM, andrikll said: Got it, I'll call and take a picture of macro. Do I understand correctly that i need to the right (under the scheme) point R157 connect and desolder the resistor? R40 desoldering it is desirable to not have voltage on contact from? Exactly! The reason is for not having a connection to the USB plug Link to comment Share on other sites More sharing options...
andrikll Posted February 24, 2018 Share Posted February 24, 2018 Just the difficulty of understanding the translation. I'm not sure those are the resistance. I am attaching the measurements, as well isvery top point r65 r68 Inn on the diagram are not soldered) here there is 12.2 K and 1.3 K to 3.3v point. May indicate the source of the schemes and there are different generations at version1.4 Board? 1 Link to comment Share on other sites More sharing options...
andrikll Posted February 24, 2018 Share Posted February 24, 2018 a-3.3v 3.26kom b-3.3v 2.47kom c-3.3v 3.2 kom d-3.3v 0 om e-3.3v 1.3kom f-3.3v 12.2kom 1 Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 24, 2018 Author Share Posted February 24, 2018 11 hours ago, andrikll said: Just the difficulty of understanding the translation. I'm not sure those are the resistance. I am attaching the measurements, as well isvery top point r65 r68 Inn on the diagram are not soldered) here there is 12.2 K and 1.3 K to 3.3v point. May indicate the source of the schemes and there are different generations at version1.4 Board? Can you measure which leg at R157 is connected to 3v3?; Leg A or B? Link to comment Share on other sites More sharing options...
andrikll Posted February 25, 2018 Share Posted February 25, 2018 R40 point D. Between 3.3v and a point D 0Ohm. here that the not so... Link to comment Share on other sites More sharing options...
leonidy-85 Posted February 25, 2018 Share Posted February 25, 2018 10 hours ago, Stefan Huus Gregersen said: Can you measure which leg at R157 is connected to 3v3?; Leg A or B? you about it? Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 25, 2018 Author Share Posted February 25, 2018 11 hours ago, leonidy-85 said: you about it? I know i know, it is written in the diagram, but i wanna know which exact leg is connected to R40 and which exact is connected to the GPIO so i can make some documentation about If you look at the picture where you wrote a,b,c,d and so on each pad, can you tell me which pad is NOT connected to R40, that leg is the GPIO which you need to solder a wire to Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 25, 2018 Author Share Posted February 25, 2018 I will try to be better at checking my account here so we can get to solve this, kinda exited to see what results we might get! Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 25, 2018 Author Share Posted February 25, 2018 And i just realized the resistor is on my own, currently just creating an Armbian from the start to make sure everything goes simple for me Removed the resistor and the leg on the resistor where the GPIO is placed is "B" if i refer back to your drawing; Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 25, 2018 Author Share Posted February 25, 2018 So time for a sad update.. About I2s on the newer boards I thought that the I2s was placed on a single bus with more outputs but they are on seperate buses so that means to use PCM1 we'll have to have access to 2 other GPIO's where one of them is unused so we cannot access it, that GPIO is PG11 aka CSI_EN and it is not descriped where it goes anywhere in the diagram so i cannot rework anything.. GODAMMIT WE WERE SO CLOSE... MAN i swear the designers of the Orange pi's really kills the idea of overruling Reaspberry PI.. They really need some proper designers to tell them what could make their boards awesome Oh well it is 1000 times simpler to do on a Orange pi One, it is almost plug and play! Link to comment Share on other sites More sharing options...
andrikll Posted February 26, 2018 Share Posted February 26, 2018 No questions. Maybe I'll try to still connect there led desolder resistor and adding1Kom from led? Just blinking, suddenly working? A few hours later. In General, I guess what I do not so the house was measured or tester battery hooked. Soldered to contact USB (4-point-plus and 2 from GND) in my work. All true as on the picture leonidy-85. Then can I continue? Link to comment Share on other sites More sharing options...
Stefan Huus Gregersen Posted February 26, 2018 Author Share Posted February 26, 2018 11 hours ago, andrikll said: No questions. Maybe I'll try to still connect there led desolder resistor and adding1Kom from led? Just blinking, suddenly working? A few hours later. In General, I guess what I do not so the house was measured or tester battery hooked. Soldered to contact USB (4-point-plus and 2 from GND) in my work. All true as on the picture leonidy-85. Then can I continue? As mentioned in my last comment it is not possible to get I2S to work on the newer boards Link to comment Share on other sites More sharing options...
andrikll Posted February 27, 2018 Share Posted February 27, 2018 I thought it was because I didn't find the right resistors... could you tell me where to read about it? .....read the message again, I understand you saw a diagram where not divorced this contact? Link to comment Share on other sites More sharing options...
Recommended Posts