Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squeezelite and Lyriat board #28

Open
kheperV3 opened this issue Aug 23, 2020 · 26 comments
Open

Squeezelite and Lyriat board #28

kheperV3 opened this issue Aug 23, 2020 · 26 comments

Comments

@kheperV3
Copy link

I am trying to install Squeezelite on a Lyriat board.
I think that the biggest problem is to handle the ES8388 chip (vs the AC101 on the SqueezeAmp board).
I think there would be 2 possibilties:

  • to use the nvs parameter "dac_controlset" but I'm afraid it's very complex and difficult...
  • to write a specific handler ((on the AC101 model) but in this case I will have difficulties in intoducing it in your squeezelite...
    What do you think about this ?
    Many thanks!...

(this is not an issue but a request for an advice!)

@philippe44
Copy link
Owner

It depends what the ES8388 needs in term of I2C config. Do you know?
BTW, SqueezeAMP is a TAS5756/54/80, not a AC101

@kheperV3
Copy link
Author

Yes I know it well enough (I wrote a handler for another app)
(0x10 is the i2c chip address, up to 45 registers to be managed via i2c - much less in a simple use...)
Could vous give me your opinion on this problem?
Thanks!

@philippe44
Copy link
Owner

How many for a simple use? you could use dac_controlset, it's not complicated. Otherwise you'll have to go the C route

@kheperV3
Copy link
Author

Hi Philippe,
I'm trying the "dac_controlset" way..
23 register writes for "init"
1 for "poweron"
1 for poweroff"

For the moment, it does not work...
I'm trying to check the syntax...
Any other idea ?
(by the way, I work from the "generic I2S & BT" model, that's right?)
Thanks!

@kheperV3
Copy link
Author

Hi Philippe,
Today I worked on my Lyriat board using these nvs parameters :
dac_config => bck=5,ws=25,do=26,sda=18,scl=23,i2c=16,port=0
dac_controlset => {"init":[{"reg"=25,"val"=4},{"reg"=2,"val"=0},{"reg"=8,"val"=0}{"reg"=4,"val"=192},{"reg"=0,"val"=18},{"reg"=1,"val"=0},{"reg"=23,"val"=24},{"reg"=24,"val"=2},{"reg"=38,"val"=9},{"reg"=39,"val"=144},{"reg"=42,"val"=144},{"reg"=43,"val"=128},{"reg"=45,"val"=0},{"reg"=27,"val"=0},{"reg"=26,"val"=0},{"reg"=46,"val"=33},{"reg"=47,"val"=33},{"reg"=4,"val"=12},{"reg"=25,"val"=0}],"poweron":[{"reg"=2, "val"=0}],"poweroff":[{"reg"=2,"val"=3}]}

And I watched the I2C signals SDA ans SCL using a logic analyser.
=>It seems that there is no I2C transaction.
What do you think about that ?
Syntax errors ?
False values?

Many thanks
Louis

@philippe44
Copy link
Owner

what do you have in traces?

@philippe44
Copy link
Owner

philippe44 commented Aug 31, 2020

And you're missing a few comma in the payload and syntax is wrong (using = instead of :) . Use a validator like this one https://jsonlint.com/

Use that example { "init": [ {"reg":41, "val":128}, {"reg":18, "val":255} ], "poweron": [ {"reg":18, "val":64, "mode":"or"} ], "poweroff": [ {"reg":18, "val":191, "mode":"and"} ] }

@kheperV3
Copy link
Author

Thanks for the json validator.
It seems that I have a lot of syntax errors !
I will correct all this from next week (short vacation...)
I'll keep you informed...

@kheperV3
Copy link
Author

Hi Philippe!
It works now!
1- I corrected the syntax of "dac_controlset"
2- But I had to add 2 lines in your code to create the MCLK clock (for the ES8388) from the CLK_OUT1 signal (pin23/gpio0 of the ESP32)

I wonder if this could not be done with an NVS parameter (existing or to be created) ?
What do you think about this?
Thanks!
Louis

@philippe44
Copy link
Owner

Can you share what you did?

@kheperV3
Copy link
Author

What I did:
1- NVS params
dac_config => bck=5,ws=25,do=26,sda=18,scl=23,i2c=32,model=I2S
dac_controlset => {"init": [{ "reg": 0, "val": 128 }, { "reg": 0, "val": 0 }, { "reg": 25, "val": 4 }, .... ( about 20 items)
set_GPIO => 21=amp
2- in file "esp_app_main.c"
at line 368 (after "config_init();") I added this:
// GPIO0 => CLK_OUT1
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
WRITE_PERI_REG(PIN_CTRL, READ_PERI_REG(PIN_CTRL)& 0xFFFFFFF0);

@philippe44
Copy link
Owner

oh but can't you just not use MCLK (register 43, bit4)?

@kheperV3
Copy link
Author

I have already tried this. But it does not work on the Lyriat board (why?...)

@dtorner
Copy link

dtorner commented Mar 21, 2021

Hey @kheperV3 would you mind to share the config you used to get the lyrat board working? I'm trying to figure it out by myself, but I'm having problems... Thanks in advance.

@kheperV3
Copy link
Author

Hi dtorner
You have to do what is in my September post .
And for "dac-controlset" you must put the following values (respecting the json format)
R00 = 00
R25 = 04
R01 = 50
R02 = 00
R08 = 00
R04 = c0
R00 = 12
R01 = 00
R23 = 18
R24 = 02
R38 = 09
R39 = 90
R42 = 90
R43 = 80
R45 = 00
R27 = 00
R26 = 00
R02 = f0
R02 = 00
R29 = 1c
R04 = 30
R25 = 00
R46 = 21
R47 = 21
I hope this will be useful for you ...

@dtorner
Copy link

dtorner commented Mar 22, 2021

Thanks you very much @kheperV3, I'll try to get it working using that info.

@Mikescops
Copy link

Hey @kheperV3, thanks for the work on LyraT.
I'm just getting into playing with this board and the squeezelite project.

I followed your post here #28 (comment) but I'm struggling with the last part with the dac_controlset setting.

I get the idea of converting the different registers to a JSON format but how does it fit in the different actions possible (init/poweron/...)

I'm curious to know (and eager to learn) how you went to have everything working 😄

@philippe44
Copy link
Owner

This https://github.com/sle118/squeezelite-esp32/blob/master-cmake/README.md#daci2s section of the README tells you how to use dac_controlset

@Mikescops
Copy link

thanks @philippe44, I've already looked at how to use the dac_controlset and I get it but what I don't understand is how to find the expected registers that I need to set (sorry if it's a stupid question)

@philippe44
Copy link
Owner

Don't worry about stupid or not stupid question 😄. Now if your board as an ES8388 codec, support is now built-in, you just have to set model=ES83888 (see README) and set the proper gpio in the dac_config and you are good to go!

@Mikescops
Copy link

Damn, how could I miss that 😅 Thanks a lot! It's working perfectly 🎉

Ok, now I have to take some time to understand it all but that's a start, thanks again :)

@philippe44
Copy link
Owner

Glad to help (un Français peut-être?)

@Mikescops
Copy link

oui ! 🇫🇷

@philippe44
Copy link
Owner

Tu peux nous retrouver sur notre gitter https://gitter.im/SqueezeAmp/community?source=orgpage (ça ne parle pas que de SqueezeAMP)

@gnkarn
Copy link

gnkarn commented Apr 10, 2022

Hi , im trying to get the lyrat firmware flashed, and i tried to make the configuration working by compiling with VS code studio ( and the extensions) , with no luck after spending lot of time , so my question are : is there a binar i could flash , to get it initially working?, is it possible to flash it from a MAC?, si there a step by step procedure to get the environment correctly set for VSC? , thanks a lot and appreciate any help .

@philippe44
Copy link
Owner

Please go there https://github.com/sle118/squeezelite-esp32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants