Skip to content

Bad AEC performance. Tips? #70

@RafigRzayev

Description

@RafigRzayev

Hello, I am using the mic for smart-speaker application.

Microphone is connected to a single board computer via USB. Sound system is connected to 3.5mm audio jack on the microphone for AEC to work. Below is the demonstration of setup:
scheme

I have watched your video showing the AEC performance, and it seems very good. I hoped that I will have similar results, but unfortunately microphone recording gets distorted by the signal emitted through speaker more than on your video. When I compared recording of single-channel firmware vs the first-channel of 6-channel firmware(processed for AEC), the quality of the latter is much better. But still it is not sufficient. I need to understand what is wrong with my setup, and why it doesn't work as in your video.

For my application I am using Linux, and this is what I do for audio settings:

pactl load-module module-remap-source master=alsa_input.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.multichannel-input master_channel_map=front-left channel_map=front-left remix=false
pactl set-default-sink alsa_output.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.analog-stereo
pactl set-default-source alsa_input.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.multichannel-input.remapped

Through this, I make sure that only the first channel is used for my voice detection application(clear of noise), and that audio output is streamed into the microphone for the filtering purpose.

  • Below are various logs from pulse-audio regarding sampling rate and etc. Could you please check if it they are ok for good AEC performance?
  • What can I do to improve the noise cancellation?
  • May it be that amplifier induces a delay which worsens the filtering? If yes, what would you suggest?
  • Which tuning parameters could help?

from pacmd stat:

Default sample spec: s16le 2ch 44100Hz
Default channel map: front-left,front-right
Default sink name: alsa_output.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.ag-stereo
Default source name: alsa_input.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.ichannel-input.remapped

from pacmd list-sources:

  • index: 5
    name: <alsa_input.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.multichannel-input.remapped>
    driver: <module-remap-source.c>
    flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: RUNNING
    suspend cause: (none)
    priority: 1000
    volume: front-left: 65536 / 100% / 0.00 dB
    balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 1.03 ms
    max rewind: 0 KiB
    sample spec: s16le 1ch 16000Hz
    channel map: front-left
    used by: 2
    linked by: 2
    configured latency: 8.69 ms; range is 0.50 .. 2000.00 ms
    module: 25
    properties:
    device.master_device = "alsa_input.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.multichannel-input"
    device.class = "filter"
    device.description = "Remapped ReSpeaker 4 Mic Array (UAC1.0) Multichannel"
    device.icon_name = "audio-input-microphone"

from pacmd list-sinks:

  • index: 1
    name: <alsa_output.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE
    priority: 9549
    volume: front-left: 55000 / 84% / -4.57 dB, front-right: 55000 / 84% / -4.57 dB
    balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 0.00 ms
    max request: 0 KiB
    max rewind: 0 KiB
    monitor source: 2
    sample spec: s24le 2ch 16000Hz
    channel map: front-left,front-right
    Stereo
    used by: 0
    linked by: 0
    configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
    card: 1 <alsa_card.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00>
    module: 8
    properties:
    alsa.resolution_bits = "24"
    device.api = "alsa"
    device.class = "sound"
    alsa.class = "generic"
    alsa.subclass = "generic-mix"
    alsa.name = "USB Audio"
    alsa.id = "USB Audio"
    alsa.subdevice = "0"
    alsa.subdevice_name = "subdevice #0"
    alsa.device = "0"
    alsa.card = "0"
    alsa.card_name = "ReSpeaker 4 Mic Array (UAC1.0)"
    alsa.long_card_name = "SEEED ReSpeaker 4 Mic Array (UAC1.0) at usb-fe3e0000.usb-1, full speed"
    alsa.driver_name = "snd_usb_audio"
    device.bus_path = "platform-fe3e0000.usb-usb-0:1:1.0"
    sysfs.path = "/devices/platform/fe3e0000.usb/usb4/4-1/4-1:1.0/sound/card0"
    udev.id = "usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00"
    device.bus = "usb"
    device.vendor.id = "2886"
    device.vendor.name = "SEEED"
    device.product.id = "0018"
    device.product.name = "ReSpeaker 4 Mic Array (UAC1.0)"
    device.serial = "SEEED_ReSpeaker_4_Mic_Array__UAC1.0_"
    device.form_factor = "speaker"
    device.string = "front:0"
    device.buffering.buffer_size = "192000"
    device.buffering.fragment_size = "96000"
    device.access_mode = "mmap+timer"
    device.profile.name = "analog-stereo"
    device.profile.description = "Analog Stereo"
    device.description = "ReSpeaker 4 Mic Array (UAC1.0) Analog Stereo"
    module-udev-detect.discovered = "1"
    device.icon_name = "audio-speakers-usb"
    ports:
    analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
    properties:

     active port: <analog-output>
    

P.S. If you want I can make a video which shows performance on audacity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions