karawin / Ka-Radio32

esp32 version of Ka-Radio (https://github.com/karawin/Ka-Radio) by jp Cocatrix
517 stars 155 forks source link

I2s dac #120

Closed nano111 closed 5 years ago

nano111 commented 5 years ago

HI, I have this dac: https://fr.aliexpress.com/item/Max98357-I2S-3-W-classe-D-amplificateur-Interface-de-sortie-Dac-d-codeur-Module-carte-Audio/32988732683.html?transAbTest=ae803_3&ws_ab_test=searchweb0_0%2Csearchweb201602_9_10065_10068_319_10059_10884_317_10887_10696_321_322_10084_453_10083_454_10103_10618_10307_10820_10301_10821_10303_537_536%2Csearchweb201603_52%2CppcSwitch_0&algo_pvid=f662d53f-7bc9-4179-9987-b51145e9eeb9&algo_expid=f662d53f-7bc9-4179-9987-b51145e9eeb9-2

connected to ttgo ts board LRCK BCLK and DIN and it works but with max volume. When I lower volume to 0 ,sound stops,but just at 5 it goes to max level and I can not control it. Any help? thanks

karawin commented 5 years ago

Please select the pcm mode on the web page of KaRadio (I2S mode)

karawin commented 5 years ago

Read that? Gain GAIN is, well, the gain setting. You can have a gain of 3dB, 6dB, 9dB, 12dB or 15dB. 15dB if a 100K resistor is connected between GAIN and GND 12dB if GAIN is connected directly to GND 9dB if GAIN is not connected to anything (this is the default) 6dB if GAIN is conneted directly to Vin 3dB if a 100K resistor is connected between GAIN and Vin This way, the default gain is 9dB but you can easily change it by tweaking the connection to the GAIN pin. Note you may need to perform a power reset to adjust the gain.

SD / MODE This pin is used for shutdown mode but is also used for setting which channel is output. It's a little confusing but essentially: If SD is connected to ground directly (voltage is under 0.16V) then the amp is shut down If the voltage on SD is between 0.16V and 0.77V then the output is (Left + Right)/2, that is the stereo average. If the voltage on SD is between 0.77V and 1.4V then the output is just the Right channel If the voltage on SD is higher than 1.4V then the output is the Left channel. This is compounded by an internal 100K pulldown resistor on SD so you need to use a pullup resistor on SD to balance out the 100K internal pulldown. For the breakout board, there's a 1Mohm resistor from SD to Vin which, when powering from 5V will give you the 'stereo average' output. If you want left or right channel only, or if you are powering from non-5V power, you may need to experiment with different resistors to get the desired voltage on SD

nano111 commented 5 years ago

Sure i set I2s on web page of the radio.Tried 2db gain,but very little difference.Little les volum ,but still no control.

nano111 commented 5 years ago

3db sorry

karawin commented 5 years ago

Sorry, i don't have an answer for this board.

nano111 commented 5 years ago

It is confusing .I set PDM ,not I2S mode on web of radio and now it works Ok.

karawin commented 5 years ago

Your board is a pcm/pdm input compatible but it seems that the pdm mode is better. I had read a forum where a user of this board had a problem of volume. After changing to the same one, it was working ok.

nano111 commented 5 years ago

We learn every day :-) I did try pdm before I wrote this issue , but it did not work because I did not hard reset the board. Thanks

Pozdrav Goran

On 1 Jun 2019, at 21:57, KaraWin notifications@github.com<mailto:notifications@github.com> wrote:

Your board is a pcm/pdm input compatible but it seems that the pdm mode is better. I had read a forum where a user of this board had a problem of volume. After changing to the same one, it was working ok.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/karawin/Ka-Radio32/issues/120?email_source=notifications&email_token=AJGT3BWCD6QMSK3FHIWKR2LPYLICNA5CNFSM4HQPCDSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWXHQ5I#issuecomment-497973365, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJGT3BUYFVO3CRML4ELPOQ3PYLICNANCNFSM4HQPCDSA.

nano111 commented 5 years ago

Just for info... With above dac and karadio set to PDM the music is a bit louder and it plays slower. When karadio is set to I2S (dont ask me how it started to work,it just did :-) ),speed is OK,but the volume is lower for about 1db.Tested with two dac boards. Otherwise it works OK

JayB7076 commented 2 years ago

Mine one is not even working any idea? Any library or pin did I need to change? I used Esp32 30pin Wroom board. And I have same dac.

JayB7076 commented 2 years ago

And I don't know why but after seeing photos of other people's project it seems like very few people used this type of dac....

nano111 commented 2 years ago

You have to tell us how did you connect wroom with dac. In the configuration file you have to change pin numbers to match your connection.

JayB7076 commented 1 year ago

I connected same as shown in diagram. And I didn't change any pin configuration from bin file. Is there any way to check dac?

nano111 commented 1 year ago

Which diagram? Your connection needs to match with your csv file. https://github.com/karawin/Ka-Radio32/tree/master/boards Look here if there is no your board you have to change pin numbers to match your connection. See instructions what to do with the csv file you modified.

nano111 commented 1 year ago

Here are the instructions: https://github.com/karawin/Ka-Radio32/blob/master/HardwareConfig.md

nano111 commented 1 year ago

I do not know the way to test the dac.

JayB7076 commented 1 year ago

I connected according to Karadio32 diagram Diagram is in Karadio32_master>images>schematic. And I used Esp32 30pin Wroom board and I have same DAC as you showed in AliExpress link. Did I need to change something from instructions?

nano111 commented 1 year ago

I think you do.Tell me numbers of io pins wher you connected pins Din, bclk, sd and lrc on your wroom board. Do you have a display or rotary encode or anything other than wroom and dac connected?

nano111 commented 1 year ago

…or send mw exact link to your diagram.

JayB7076 commented 1 year ago

schemekaradio32 IMG_20220722_131552 IMG_20220722_132552

Yes I connected display and rotary encoder but this two is directly connected to Esp32. I2S DAC --> ESP32 LRC --> D25 BCLK --> D26 DIN --> D22 GAIN IS NOT CONNECTED ANYWHERE SD IS NOT CONNECTED ANYWHERE GND --> ESP32 GND VCC --> VIN OF ESP32

My soldering is bad but it just for testing. I am going to resolder everything after It going to work properly.

nano111 commented 1 year ago

So display and encoder work?

Pozdrav Goran

On 22.07.2022., at 10:01, JayB7076 @.***> wrote:



[schemekaradio32]https://user-images.githubusercontent.com/100558736/180392129-6b28ca3b-63f5-4ca9-9fc5-5853158f1e78.jpg [IMG_20220722_131552]https://user-images.githubusercontent.com/100558736/180392178-6d23b1ad-8aa7-4a24-b6b9-c7840bd7627c.jpg [IMG_20220722_132552]https://user-images.githubusercontent.com/100558736/180392192-7ddadf37-2086-4c23-88aa-d62ef57c703e.jpg

Yes I connected display and rotary encoder but this two is directly connected to Esp32. I2S DAC --> ESP32 LRC --> D25 BCLK --> D26 DIN --> D22 GAIN IS NOT CONNECTED ANYWHERE SD IS NOT CONNECTED ANYWHERE GND --> ESP32 GND VCC --> VIN OF ESP32

— Reply to this email directly, view it on GitHubhttps://github.com/karawin/Ka-Radio32/issues/120#issuecomment-1192296392, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJGT3BX7ABAIHMGCL6BE3BTVVJIMLANCNFSM4HQPCDSA. You are receiving this because you modified the open/close state.Message ID: @.***>

nano111 commented 1 year ago

“ standard_psram.bin is the default description for a wrover cpu”

check if this csv file in boards directory matches your connection. Then make bin with that file as described.

nano111 commented 1 year ago

sorry … it is alredy bin file .Do you use this file (standard_psram.bin)when you programme board?

JayB7076 commented 1 year ago

No I didn't use standard_psram.bin file and before uploading karadio32 bin files I formatted flash of esp32 board.and I uploaded karadio32 default factory flash but I don't know it's factory one or not. And I used Esp32 Wroom board and it have 30pin not wrover.

nano111 commented 1 year ago

as I said … you have to modify csv file according to your connection and convert it to bin … then flash it tothe board

JayB7076 commented 1 year ago

I connected pins according to bin file and in first time uploading bin files I didn't find any standard_adb.bin file in Karadio32_master IMG_20220723_112542 Than I found file and re-uploaded four bin files with standard_adb.bin files. IMG_20220723_112410 IMG_20220723_112438 And I connected again according to standard_adb.bin and I didn't changed anything I uploaded bin file that i found in karadio32_master.

JayB7076 commented 1 year ago

Can't I use already made bin file? And did standard_adb.bin file is not for Esp32 30p Wroom? And is it compulsory to change CSV file and than convert to bin and than upload? And I didn't changed pin of esp32 I connected everything according to diagram and pin configuration that I found in bin file.

nano111 commented 1 year ago

it is not necessary to change csv if everything is connected as in that file. Did you change in web interface of karadio in Setting audio option to I2S or PDM? Does your display work?Encoder? You can try to change pins 25 and 26 anf connect da. to some other two and change csv.Maybe those are only for internal dac on your board. Maybe you have a bad dac board if nothing of this helps

JayB7076 commented 1 year ago

Yes I connected everything according to CSV file. Yes I tried every options from karadio32 web interface and non of them worked accept Dac option,and my internal DAC is working completely fine. Yes my display and rotary encoder is working fine. Yes and only 25 and 26 is only two pins for internal DAC. I am thinking to buy and try new dac but this time VS1056 instead of max98357a. Is this standard_psram.bin file can work on esp32 30p Wroom?

JayB7076 commented 1 year ago

Can it supports VS1003b module? I found one it's similar look similar to vs1053 And some people used it so can it going to work?

nano111 commented 1 year ago

Try to connect lrck and bclk to two other io pins that are free and modify csv to that connection and make bin. Do you hard reset (disconect power to the board) your board after you change audio settings on web interface? You always have to check csv file if it matches your connection .

JayB7076 commented 1 year ago

Yes I hard reseted board after changing settings from url. And CSV file connection matches to.. And I tried another pins but still not working.

JayB7076 commented 1 year ago

I gess I need to try new one. I found total 3 boards that can delever fast to my address and seller Shop are in my country and price is looks ok too.. But I am confused which to use Any recommendations? Mine not working dac is max98357a And I found Sparkfun one but what if this not work? images - 2022-07-24T201731 394 And I found this vs1003b but on board they printed vs1003b/vs1053 so I am confused but ic number is vs1003b and I seen a someone used before but he programmed esp with Arduinoide and code is not Karadio one. images - 2022-07-24T201506 956 And I found this vs1053 in Arduino shield board type but still not used by anyone so don't know if it going to work but ic is vs1053 so thinking to use. images - 2022-07-24T201424 234

JayB7076 commented 1 year ago

And do you know how do I add url of radio station? I added some but they are not working.

nano111 commented 1 year ago

I used VS1053 in one of my karadio and it works perfectly.For other I do not know. Is your dac new or used? Did you try using other gpio’s insted of 25 and 26? I think you are missing something. That dac works well in my radio.

nano111 commented 1 year ago

And do you know how do I add url of radio station? I added some but they are not working.

How did you try yor dac if you didnt add stations to your radio? There are some radio lists for download on radios web interface under settings scroll to the bottom. Upload one of them in your radio. You can edit list under Edit menu … click on station and you can change url and name. You have to check if the stream is in mp3 format.

JayB7076 commented 1 year ago

No no I already added list of radio station but the list is from karadio32 I am not added my country's station. Yes I changed pins but still no sound only internal dac is working. And my DAC is brand new. And can you tell me how to check is stream is in MP3 or other formats?😅 Here is one of my country's station:- https://onlineradiofm.in/stations/mirchi

nano111 commented 1 year ago

“ For a wrover cpu you need a csv file with psram in the name. Without it, the default configuration will fail.” That is quote from karadi32 read me. Maybe you could try that , maybe the boards are similar wroom and wrover.

nano111 commented 1 year ago

https://swling.com/blog/2021/04/robs-tips-for-uncovering-radio-station-stream-urls/

here are instructions for finding urls of web radio stations

nano111 commented 1 year ago

when yoy chsnged pins did you modified csv file and made a new bin and flash it to the board?

JayB7076 commented 1 year ago

Yes I modified pins after seeing pin diagram of esp32 And flashed to Esp32. And I found how to find radio station url.

JayB7076 commented 1 year ago

Hey did Karadio32 supports m3u8 codec? I found this link but it seems like it's streaming in m3u8 format https://airhlspush.pc.cdn.bitgravity.com/httppush/hlspbaudio004/hlspbaudio00464kbps.m3u8

nano111 commented 1 year ago

https://online-radio.eu/radio/92592-radio-mirchi-patna On this page you can download list for vlc, winamp (in green window) Paste url from the list to your radio… it should work

JayB7076 commented 1 year ago

"No ip found" this error massage showing

JayB7076 commented 1 year ago

Can I use that red colour vs1053 board? Can I buy and use that instead of buying another max98357a?

nano111 commented 1 year ago

VS1053 is Ok… but if your max is new I do not see reason that it wont work. You are making a mistake somewhere and you should try to find it. Abiuy urls see tutorial that I sent you the link to.

JayB7076 commented 1 year ago

I have one question after uploading bin file to Esp32 you need to format it's flash for uploading new bin file right?but after formatting you need to upload factory flash file right?I once formatted Esp32 and uploaded factory bin file is it right thing to do?

nano111 commented 1 year ago

WARNING: the standard_adb.bin must be changed for a wrover processor or another configuration. Do you use this tool? http://karadio.karawin.fr/karawin32Flash.jpg You only need to flash your radio once and after just that last file if you change your hardware configuration.

JayB7076 commented 1 year ago

Yes I used Esp32 flash tool. And I uploaded karadio32-Karadio32-partition-bootloader-standerd_adb BIN files I used Esp32 Wroom 30pin.

nano111 commented 1 year ago

Maybe you could try that psram file for wrover.