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

M5 Atom Echo quiet microphone #63

Open
whinis opened this issue Jun 14, 2021 · 1 comment
Open

M5 Atom Echo quiet microphone #63

whinis opened this issue Jun 14, 2021 · 1 comment

Comments

@whinis
Copy link

whinis commented Jun 14, 2021

I alluded to this issue in #53 and think I may have found the issue for this but cannot confirm the comment. The following code is as mentioned in the previous example from issue directly from the example however on the bits per sample there is a comment saying even though its set to 16 bit it's fixed at 12 bit.

i2s_config_t i2s_config = {

            .mode = (i2s_mode_t)(I2S_MODE_MASTER),
  
  
            .sample_rate = 16000,
  
  
            .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, // is fixed at 12bit, stereo, MSB
  
  
            .channel_format = I2S_CHANNEL_FMT_ALL_RIGHT,
  
  
            .communication_format = I2S_COMM_FORMAT_I2S,
  
  
            .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
  
  
            .dma_buf_count = 6,
  
  
            .dma_buf_len = 60,
  
  
        };

It doesn't really sense for the mic to be stereo in this case and from what I can tell from the amplifier datasheet it also doesn't make much sense so is likely either a copied comment from something else whenever they made the example or a software limitation of the SDK.

Going on the idea it was 12 bit and not 16 bit I tried to multiply the audio by various powers of 2 initially just to increase the loudness but was all overly loud and led to clipping. Trying to multiply by anything except a power of 2 leads to a crash that I cannot pin point.

I sadly lack the audio knowledge to figure out if its actually taking the PDM audio and making it 12 bit or 16 bit but a gain function would be nice. However due to the relative lack of power in the esp32 I am unsure if its smarter here or at rhasspy.

@Romkabouter
Copy link
Owner

Nice find, I have no idea if this could cause the issue.
In any case it is a strange comment indeed and I will see if I can find some more info on it. Thanks

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

2 participants