Closed DerPicknicker closed 8 months ago
@DerPicknicker seems to me current volume isn't saved anywhere inside the mute function? https://github.com/CarlosDerSeher/snapclient/blob/713cda5816605bac1b50ff998af6f81f64bbe77a/components/audio_hal/driver/es8311/es8311.c#L332 I can't find a good datasheet with register description but I guess the mute function should probably look something like this:
static int currentVolume;
/*
* set es8311 dac mute or not
* if mute = 0, dac un-mute
* if mute = 1, dac mute
*/
static void
es8311_mute (int mute)
{
uint8_t regv;
ESP_LOGI (TAG, "Enter into es8311_mute(), mute = %d\n", mute);
regv = es8311_read_reg (ES8311_DAC_REG31) & 0x9f;
if (mute)
{
es8311_codec_get_voice_volume(¤tVolume);
es8311_write_reg (ES8311_SYSTEM_REG12, 0x02);
es8311_write_reg (ES8311_DAC_REG31, regv | 0x60);
es8311_write_reg (ES8311_DAC_REG32, 0x00);
es8311_write_reg (ES8311_DAC_REG37, 0x08);
}
else
{
es8311_write_reg (ES8311_DAC_REG31, regv);
es8311_write_reg (ES8311_SYSTEM_REG12, 0x00);
es8311_codec_set_voice_volume(currentVolume);
}
}
Could you please try this?
Or we can just call audio_hal_set_volume right after unmute, then there will be no need to store volume information with the driver itself, as yourself suggested earlier.
Hi @CarlosDerSeher ,
I store the current volume in my custom board as a variable inside the driver. I update it every time I change the volume. I will try your changes. and update here.
So.. Some Minutes later I tested your code above:
Here was the old song playing:
I (17062) PLAYER: initial sync age: 2us, chunk duration: 24000us
Now I started a new Song:
I (32353) SC: fLaC sampleformat: 48000:16:2
I (32361) SC: fLaC sampleformat: 48000:16:2
W (34961) PLAYER: RESYNCING HARD 2: age -740416us, latency 621172902900us, free 4194582, largest block 3997696, 28, rssi: -46
I (34963) DRV8311: Enter into es8311_mute(), mute = 1
I (35776) DRV8311: Enter into es8311_mute(), mute = 0
I (35778) PLAYER: initial sync age: 2us, chunk duration: 24000us
The Song plays for 2sec makes half a second a brake (silence) and then goes forward. So the Lyrat Board has a complete different behaviour than my custom board LOL.
Where does this take us now?
That the Lyrat board is different from the other boards. I can't hear that silence on my custom board. I will check that and why it's caused.
Hi @CarlosDerSeher .. What information do you need from my side to fix this issue?
I don't really understand what's the issue. Also I can't test
My custom board (TAS5805M) starts playing immediately and doesn't mute after 2sec...
I will test it today again and try to describe it a bit more.
Hi,
the issue can be marked as resolved. The Problem is the volume control. Below 60% the audio output is not useable. It's only noise. But no music. The Mute thing was a problem related to my snap cast installation. But the Volume is really buggy. IF I increase it above 80% it becomes noisy again. So I only have around 20% of the useable volume settings available....
Do you have an Idea here?
Maybe check adf driver as a reference? Also you can try adjusting analog gain settings
Hi,
I will skip that Board and just use it with the current limitations. I will focus more on the TOSLINK-Way. Issue can be closed.
I have the same mute issue on that board. Could you share what you changed in your snapserver config? Thanks
@ReasonableHippo .. Where does your music come from. Do you use a standard snapcast server?
Yeah its a standard server, but I'm getting the data from a pipe which is probably the issue.
Hmm.. I use MusicAssistant.. so maybe it's serversided. But let's see.
If you find the time test also MusicAssistant. I think it's much comfortable than those pipe configuration.
i came back to this after months and have found a working solution on a lyrat mini v1.2. using the config from here: https://github.com/sonocotta/esparagus-snapclient/blob/master/configs/sdkconfig.lyra-t-mini
The mute bug is caused by
es8311_write_reg(ES8311_DAC_REG32, 0x00);
in the es8311.c mute function
commenting that out resulted in wanted behaviour for mute/unmute and starting up unmuted
Great news, thanks for your investigations
Hi @CarlosDerSeher ,
you added in the development branch the support for the Lyrat Mini Board. I found a Bug which should be fixed before merging into master.
If you stop the playback and want to play another song the DAC is not sending the Audio correctly.
Here I paused the Song:
Here I played another Song:
But only if you change the volume up or down the music starts playing.
Only the Lyrat Mini board has the problem. My other Board doesn't have this problem at all. So might be only released to the custom board config of the Lyrat Mini Board 1.1 / 1.2.
Thank you for your great support. I really like the snap cast thing.