snapclient
snapclient copied to clipboard
Sync with sample stuffing
Also upgrade to idf5
@alexyao2015 I am trying to merge your recent changes regarding AI thinker board. In this branch there has been an IDF upgrade to v5 but also an ADF upgrade and I am unsure how to proceed now. I resolved most conflicts but have commented out some of your changes. Could you please try this and see what needs to be changed / added to make your changes work with the new ADF base?
@unknown0816 @alexyao2015 Could one of you please try this with AI thinker board and confirm it works? I'd really like to go on with the merge.
I haven't had a chance to try it yet sorry!
Ok, sorry to push this. I thought nobody saw it as there was no reaction at all ;) glad to read you are still in
I will try this today. I will come back to you, soon.
Sadly I'm unable to get my docker running.. With my old version from idf v.4.3.5 I get the message that I must use v5 of idf. Using the newer versions I get the message, that cmake cannot be found. Can you help me getting the idf running?
do you mean that CMakeList.txt isn't found? I had that problem too due to providing the wrong path on the host to the -v argument. Maybe check the content of the /project folder in the interactive container shell to verify that this is not the case.
I was just able to start the build of this branch with the commands provided in the readme.
Thanks for the info. My problem actually was an old build directory with a reference to an old cmake version.
I could flash to the AI thinker and I found two issues. First I had white noise all the time. even if no signal came from the snapcast. So there must be something wrong. Second the volume change does work, but it is not really good. At least for me the scaling is no sound from 0 to 50 and from 50 to 100 it is pretty fast too loud to listen.
Thanks for taking the time.
There is a define in boarddef.h called PA_GAIN or similar. Could you try to play with that?
Also the noise was present for my lyrat too but was gone once playback from server started even if stopped again. I think this is another issue which I haven't found yet, not related to that specific board.
@unknown0816 noise problem should be fixed with latest commit
@unknown0816 noise problem should be fixed with latest commit
Okay. I will test it. Unfortunately, I won't be able to test it today, but I will try to do it soon.
@CarlosDerSeher Sadly, I still getting the noise. The main difference is that on my board the noise is all the time.. Not only during booting.
@unknown0816 even if you start playback or only if there is no playback from the server and / or the client is muted?
@CarlosDerSeher Even during playing I get the noise.. So it is always there. During Muting the sound stops, but the noise is still there.
And with master you don't have this problem right? Only the volume scaling isn't right there?
Yes. For the volume setting I changed the calculation like posted in other PRs and it works fine..
I tried to undo some of your changes in the es8388.c, but the noise keeps coming.. Maybe you have an idea what I could try?
maybe something get misscalculated here? https://github.com/CarlosDerSeher/snapclient/blob/e5dea7d8d71bdc6eb0a217c52f45bdf3386a9989/components/audio_hal/driver/es8388/es8388.c#L442
Is it an amplifier saturating noise or more like white noise?
Nope. Still having the noice if I undo the changes in this function.
I would say it is a white noise, but I'm not sure ;)
You could try to take the driver from master and work your way up from there maybe? Some compile errors will most certainly happen and will need to be resolved but mybe you can find the problem then? or take the driver from ADF v2.6 and try to insert your board there, should be as easy ass adding the #ifdef s . Maybe I something went wrong during merging.
Anothger thing to you could check: https://github.com/CarlosDerSeher/snapclient/blob/e5dea7d8d71bdc6eb0a217c52f45bdf3386a9989/components/audio_hal/driver/es8388/es8388.c#L410 does this align with the settings from https://github.com/CarlosDerSeher/snapclient/blob/e5dea7d8d71bdc6eb0a217c52f45bdf3386a9989/components/lightsnapcast/player.c#L143
Yes. I will try to find the source of the noise.. But this will take some time. ;)
Maybe you need to call audio_hal_codec_iface_config
after player_setup_i2s
? I doubt it though as it works as it is for Lyrat...
Take your time. Thanks for the effort!
Sadly, I couldn't find the problem yet, but I found out that the noise starts when the first audio is played. So if I startup the board and the audio is not playing I get no noise. The noise starts when I start the audio playing. Maybe this information helps?
So the noise starts with this line: "ESP_ERROR_CHECK(i2s_channel_init_std_mode(tx_chan, &tx_std_cfg));" in the function player_setup_i2s in player.c However, I'm unable to find the source code of this function.
However, I'm unable to find the source code of this function.
This code is located externally at your IDF installation.
Maybe you need to call
audio_hal_codec_iface_config
afterplayer_setup_i2s
? I doubt it though as it works as it is for Lyrat...
did you try this? Maybe a sample rate missmatch?
Thanks. I found the file and I found that the noise starts, when the function calls: "ESP_GOTO_ON_ERROR(i2s_std_set_gpio(handle, &std_cfg->gpio_cfg), err, TAG, "initialize channel failed while setting gpio pins");" So I guess some gpiopins are wrong.
Could running your suggested command help there? I didn't do it until now.
Noise-Starting Command one level down: "i2s_gpio_check_and_set(gpio_cfg->dout, i2s_periph_signal[id].data_out_sig, false, false);"
I guess this just means noise starts when I2S signals are enabled. This doesn't mean gpios are wrong.
Could running your suggested command help there?
I doubt it will help as it works for Lyrat without it, but its still worth a shot. I don't know how this particular DAC is configured exactly but from what I saw it needs sample rate set for playback in some registers?
If this doesn't help you could try to revert to original es8388 DAC driver from ADF 2.6 and work from there. Seems to me the upgrade of ADF or IDF broke something.
If this doesn't help you could try to revert to original es8388 DAC driver from ADF 2.6 and work from there. Seems to me the upgrade of ADF or IDF broke something.
I tried this and due to lots of interface changes this failed quickly. But I can try again.
I guess this is more or less an interaction between these updates and an officially unsupported board. Maybe AI Thinker will redo some kind of instructions to get the board running with this newer versions.
Use this ADF branch. should work without much changes as this is the driver I used
https://github.com/espressif/esp-adf/tree/v2.6