-
Notifications
You must be signed in to change notification settings - Fork 189
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
Integration of echo-cancelling #532
Comments
To be honest I'm not sure whether AEC should be a part of bluealsa itself. The case is that the BlueALSA service should be treated as a sound card with many PCM devices (playback and capture). It is not a telephony application. One can build a telephony-like application on top of bluealsa - using it as an audio backend for mic and speaker (in the same way a standard audio card would be used). Do you know of any sound card which has build-in echo cancelation? If there are sound cards like that, maybe we can try to mimic such solution in BlueALSA service. But for now, I'm not sure how it should work from the user point of view - BlueALSA service might have many capture PCMs and many playback PCMs... |
I think echo cancellation is a function that is applied to the stream from the local microphone, not the remote bluetooth one. It should be performed by an application that handles the local microphone and speaker (or by the local soundcard that produces/consumes those streams). So I think that the |
It all depends how BlueALSA is used - what kind of setup we are talking about. Because remote Bluetooth device might be a local device, e.g. BT speaker. So, echo cancelation will be done on a "local" BT device, and audio from the BT speaker mic will be transferred over VoIP. Anyway, I do agree that it's not a BlueALSA job to perform echo cancelation, but rather an application which is using PCM audio device. |
Hi again, and sorry for my late answer. https://github.com/dr-ni/aec_cmdline.git Such tool can be easily used with files:
or in combination with bluez-alsa arecord and aplay:
and
The tool is reading a stereo track, holding the local recording on the left and the parasitic reference signal (here bluealsa remote) on the right. The required input stereo track is being supplied from a loopback device as described in: https://github.com/SaneBow/alsa-aec.git Cheers Uwe |
Update: So
and
should now be working with ofono |
Do you think you can integrate an echo-cancelling option for hfp ofono?
There is already a very well working speexdsp example for mono raw audio files:
https://github.com/xiph/speexdsp/blob/master/libspeexdsp/testecho.c
The example
./testecho ~/local_mic_recording.raw ~/incomming_bluealsa.raw ~/outgoing_to_bluealsa.raw
is working pretty good:
incomming_bluealsa
is completely removed from the recording mixture. However, smaller stream-frames for real-time-processing will not allow to remove allincomming_bluealsa
if not in sync - but should be possible at all.I used https://github.com/voice-engine/ec.git and https://github.com/voice-engine/alsa_plugin_fifo.git to write out the necessary files (playing audio
incomming_bluealsa
and recordinglocal_mic_recording
- all with 16 kHz sampling-rate and recording at the same time). Theec
tool is somehow working but there are some problems - maybe mixing up stereo and mono. And the used alsa configuration is not very practical becauseec
is closing after stopping the recording and the LOOPBACK device is blocked. After stereo to mono conversion of all output of~/ec/ec -i plughw:1 -o plughw:1 -d 200 -s
and runningtestecho
the resulting audio is much better than usingec
directly.The text was updated successfully, but these errors were encountered: