linphone-desktop icon indicating copy to clipboard operation
linphone-desktop copied to clipboard

Strange sound noise on headset

Open Rainson12 opened this issue 4 years ago • 9 comments

I have a very strange sound when using my headset however it works perfectly fine when playing the sound via my laptop built in speakers. I am using a G933 Logitech headset. I attached a sample recording.zip which i recorded using my phone and the noise from my headphones when running the default ringtone located at Linphone\share\sounds\linphone\rings.

here is the log:

2021-02-16 17:22:54:749 [/mediastreamer] MESSAGE Card 'WASAPI: Mikrofon (Logitech G933 Gaming Headset)--{0.0.1.00000000}.{2134811c-b493-41f7-a43e-c300f950251e}' added
2021-02-16 17:22:54:749 [/mediastreamer] MESSAGE Card 'WASAPI: Mikrofon (Realtek(R) Audio)--{0.0.1.00000000}.{23108b23-0ac4-453f-9d1c-f371cb364ca7}' added
2021-02-16 17:22:54:749 [/mediastreamer] MESSAGE Card 'WASAPI: Lautsprecher (Logitech G933 Gaming Headset)--{0.0.0.00000000}.{6b2750de-c6ba-4fa0-97a4-4e8929f738eb}' added
2021-02-16 17:22:54:750 [/mediastreamer] MESSAGE Card 'WASAPI: DELL UP2516D (2- Intel(R) Display-Audio)--{0.0.0.00000000}.{096dbb5d-0bf2-469d-a0c3-daa09e7f3f8b}' added
2021-02-16 17:22:54:750 [/mediastreamer] MESSAGE Card 'WASAPI: Lautsprecher (Realtek(R) Audio)--{0.0.0.00000000}.{aedf5dd2-54ea-4936-95da-a09a261543d0}' added
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No capture card with id WASAPI: Lautsprecher (Logitech G933 Gaming Headset)--{0.0.0.00000000}.{6b2750de-c6ba-4fa0-97a4-4e8929f738eb}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No capture card with id WASAPI: DELL UP2516D (2- Intel(R) Display-Audio)--{0.0.0.00000000}.{096dbb5d-0bf2-469d-a0c3-daa09e7f3f8b}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No capture card with id WASAPI: Lautsprecher (Realtek(R) Audio)--{0.0.0.00000000}.{aedf5dd2-54ea-4936-95da-a09a261543d0}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No capture card with id WASAPI: Lautsprecher (Logitech G933 Gaming Headset)--{0.0.0.00000000}.{6b2750de-c6ba-4fa0-97a4-4e8929f738eb}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No capture card with id WASAPI: DELL UP2516D (2- Intel(R) Display-Audio)--{0.0.0.00000000}.{096dbb5d-0bf2-469d-a0c3-daa09e7f3f8b}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No capture card with id WASAPI: Lautsprecher (Realtek(R) Audio)--{0.0.0.00000000}.{aedf5dd2-54ea-4936-95da-a09a261543d0}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No playback card with id WASAPI: Mikrofon (Logitech G933 Gaming Headset)--{0.0.1.00000000}.{2134811c-b493-41f7-a43e-c300f950251e}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No playback card with id WASAPI: Mikrofon (Realtek(R) Audio)--{0.0.1.00000000}.{23108b23-0ac4-453f-9d1c-f371cb364ca7}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No playback card with id WASAPI: Mikrofon (Logitech G933 Gaming Headset)--{0.0.1.00000000}.{2134811c-b493-41f7-a43e-c300f950251e}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No playback card with id WASAPI: Mikrofon (Realtek(R) Audio)--{0.0.1.00000000}.{23108b23-0ac4-453f-9d1c-f371cb364ca7}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No playback card with id WASAPI: Mikrofon (Logitech G933 Gaming Headset)--{0.0.1.00000000}.{2134811c-b493-41f7-a43e-c300f950251e}
2021-02-16 17:22:54:750 [/mediastreamer] WARNING No playback card with id WASAPI: Mikrofon (Realtek(R) Audio)--{0.0.1.00000000}.{23108b23-0ac4-453f-9d1c-f371cb364ca7}
2021-02-16 17:22:54:768 [/bctbx] MESSAGE MSWASAPI audio input interface buffer size: 12000
2021-02-16 17:22:54:768 [/bctbx] MESSAGE Wasapi capture initialized at 48000 Hz, 1 channels, with buffer size 12000 (125 ms), frames are on 16 bits
2021-02-16 17:22:54:795 [/bctbx] MESSAGE Wasapi playback output initialized at 48000 Hz, 8 channels, with buffer size 96000 (125 ms), device period is 10, frames are on 128 bits
2021-02-16 17:22:54:795 [/mediastreamer] MESSAGE ms_filter_link: MSWASAPIRead:128B76A0,0-->MSVolume:128B7660,0
2021-02-16 17:22:54:795 [/mediastreamer] MESSAGE ms_filter_link: MSVolume:128B7660,0-->MSVolume:128B7260,0
2021-02-16 17:22:54:795 [/mediastreamer] MESSAGE ms_filter_link: MSVolume:128B7260,0-->MSWASAPIWrite:128B73A0,0
2021-02-16 17:22:54:795 [/mediastreamer] MESSAGE MSVolume set gain to [0.000000] linear
2021-02-16 17:22:54:795 [/mediastreamer] MESSAGE MSTicker priority left to normal.
2021-02-16 17:22:54:798 [/mediastreamer] MESSAGE ms_ticker_set_time_func: ticker's time method updated.
2021-02-16 17:22:55:771 [/mediastreamer] MESSAGE Opening C:\Program Files (x86)\Linphone\share/sounds/linphone/rings/notes_of_the_optimistic.mkv
2021-02-16 17:22:55:771 [/mediastreamer] MESSAGE MKVPlayer: opening C:\Program Files (x86)\Linphone\share/sounds/linphone/rings/notes_of_the_optimistic.mkv
2021-02-16 17:22:55:772 [/mediastreamer] WARNING MKVPlayer: no default video track. Looking for first video track
2021-02-16 17:22:55:772 [/mediastreamer] WARNING MKVPlayer: no video track found
2021-02-16 17:22:55:800 [/bctbx] MESSAGE Wasapi playback output initialized at 48000 Hz, 8 channels, with buffer size 96000 (125 ms), device period is 10, frames are on 128 bits
2021-02-16 17:22:55:800 [/mediastreamer] WARNING The sound card (Lautsprecher (Logitech G933 Gaming Headset)--{0.0.0.00000000}.{6b2750de-c6ba-4fa0-97a4-4e8929f738eb}) does not support 48000Hz
2021-02-16 17:22:55:800 [/mediastreamer] WARNING The sound card (Lautsprecher (Logitech G933 Gaming Headset)--{0.0.0.00000000}.{6b2750de-c6ba-4fa0-97a4-4e8929f738eb}) does not support 2 channels
2021-02-16 17:22:55:800 [/mediastreamer] MESSAGE Resampling from (48000Hz, 2ch) to (48000Hz, 8ch)
2021-02-16 17:22:55:800 [/mediastreamer] MESSAGE speex_lib_ctl init with neon ? 0
2021-02-16 17:22:55:800 [/mediastreamer] MESSAGE ms_filter_link: MSMKVPlayer:128B6420,1-->MSOpusDec:128B7720,0
2021-02-16 17:22:55:800 [/mediastreamer] MESSAGE ms_filter_link: MSOpusDec:128B7720,0-->MSResample:128B72E0,0
2021-02-16 17:22:55:800 [/mediastreamer] MESSAGE ms_filter_link: MSResample:128B72E0,0-->MSWASAPIWrite:128B73E0,0
2021-02-16 17:22:55:800 [/mediastreamer] MESSAGE Initializing speex resampler in mode [voip] 
2021-02-16 17:22:55:801 [/mediastreamer] MESSAGE Player priority left to normal.
2021-02-16 17:22:58:974 [/mediastreamer] MESSAGE MSMediaPlayer: closing file.
2021-02-16 17:22:58:974 [/mediastreamer] MESSAGE opus decoder stats: fec 0 packets - plc 0 packets.
2021-02-16 17:22:58:981 [/mediastreamer] MESSAGE Player thread exiting
2021-02-16 17:22:58:981 [/mediastreamer] MESSAGE ms_filter_unlink: MSMKVPlayer:128B6420,1-->MSOpusDec:128B7720,0
2021-02-16 17:22:58:981 [/mediastreamer] MESSAGE ms_filter_unlink: MSOpusDec:128B7720,0-->MSResample:128B72E0,0
2021-02-16 17:22:58:981 [/mediastreamer] MESSAGE ms_filter_unlink: MSResample:128B72E0,0-->MSWASAPIWrite:128B73E0,0
2021-02-16 17:22:59:507 [/mediastreamer] MESSAGE ms_ticker_set_time_func: ticker's time method updated.
2021-02-16 17:22:59:508 [/mediastreamer] MESSAGE ms_filter_unlink: MSVolume:128B7260,0-->MSWASAPIWrite:128B73A0,0
2021-02-16 17:22:59:508 [/mediastreamer] MESSAGE ms_filter_unlink: MSVolume:128B7660,0-->MSVolume:128B7260,0
2021-02-16 17:22:59:508 [/mediastreamer] MESSAGE ms_filter_unlink: MSWASAPIRead:128B76A0,0-->MSVolume:128B7660,0
2021-02-16 17:22:59:509 [/mediastreamer] MESSAGE ms_ticker_synchronizer_destroy(): sound/wall clock skew was in average=-5.443479 ms
2021-02-16 17:22:59:517 [/mediastreamer] MESSAGE MSTicker thread exiting

EDIT: Tried it with different versions from 4.0 up to Linphone-4.3.0-alpha.75+d1e5f386-win32 all have more or less the same issue. 4.0 sounds best however but still not even close to be comparable with orginal playback

Edit2: Tried with an ASTRO A50 Headset and the it worked here. I compared the logs and it seems the issue is with the wrong channel count. The logitech g933 for what ever reason shows up as 8 channel headset while in reality its only 2.

Rainson12 avatar Feb 16 '21 16:02 Rainson12

I patched the assembler code for the libmswasapi libmswasapi.zip so that it always assumes 2 channels. That way i was able to fix the issue for me. The lib which has to replaced can be found under C:\Program Files (x86)\Linphone\plugins\mediastreamer. @BelledonneComm sorry I was to lazy to setup all the dev environment so that just patching the binary with some asm opcode was quicker :)

For anyone who is interested on how to do it. I used IDA Pro to open the lib, and then searched for the string Could not get the mix format of the since it was the closest string to reading the available channels according to the original source code. I then compared the assembler code and patched the data writing at 0x2CC5 to C7 46 24 02 00 00 00. This also replaces the old code from mNChannels = pWfx->nChannels; to something like mNChannels = 2;.

Rainson12 avatar Feb 16 '21 20:02 Rainson12

@BelledonneComm Can we get this merged or even better, have a setting inside the app to override/force the audio channels if required? Maybe by default, set it to auto-detect and then we can override it.

breisig avatar Feb 22 '21 15:02 breisig

Hi What is done is : GetMixFormat then IsFormatSupported and select the supported format. So it should work. Please note that in logs, "Wasapi *** initialized at ... x channels" is a bit wrong as it is about the format from GetMixFormat, and not from the format that is finally use. That lead to this remark : GetMixFormat gives to Linphone the OS settings, you can change the channel by going to the Control Panel of Windows. Check : https://stackoverflow.com/questions/48335752/wasapi-identify-non-active-channels-on-loopback-recording/48336308#48336308

Forcing channel to 2 may work for your case but not in general and adding an option (that the system have) will not be for today ;)

julonexus avatar Apr 22 '21 20:04 julonexus

I tried changing my headphones to 2 channels but it still has the same out. Only the patch @Rainson12 supplied worked and we seriously need to get this added/fixed.

breisig avatar Jun 01 '21 18:06 breisig

g channel to 2 may work for your case but not in general and ad

unfortunately it is not possible to change this setting in the control panel. The setting is disabled. Also the playback works in all other applications beside linphone so I doubt that this is a common issue as I have never experienced this before. image by the way it also shows 2 channels - although linphone uses 8

Rainson12 avatar Jun 01 '21 19:06 Rainson12

I just tried upgrading the latest snapshot [ Linphone-4.3.0-beta.4+39e41a60-win32.exe 2021-08-27] and this issue still exists. This is a HUGE issue that seriously needs to get fixed.

breisig avatar Aug 31 '21 15:08 breisig

Just relating this issue to #470, maybe with some different hardware. Tested now Logitech G533 on Desktop 4.3.0-beta-38-ged52503e - Qt5.14.2 Core 5.0.22-1-g8c5243994.

Same strange noise

fchicout avatar Sep 15 '21 18:09 fchicout

@Rainson12 I just installed the latest LinPhone 4.3.2 windows release and tried installing your patched libmswasapi.zip file and now I cannot hear any audio out of my headset. It was working with earlier versions of LinPhone but it seems its broken in the new version. If I re-install LinPhone 4.3.2, I hear the strange robotic noise from my headset and once I install your patch, No audio comes out anymore. Can you update your patched file and upload it again? [or even better if LinPhone could work correctly work with audio devices > 2 channels]

breisig avatar Nov 30 '21 17:11 breisig

The patched libmswasapi.dll provided by @Rainson12 worked without any problems for me.

Headset: Logitech PRO X Gaming Headset

Linphone Client:
Desktop 4.3.2 - Qt5.14.2
Core 5.0.49

Chrissi2812 avatar Aug 17 '22 11:08 Chrissi2812

The patched libmswasapi.dll also worked for me.

I downgraded my Linphone from latest (5.0.5 x64) to 4.3.2 x86.

easis avatar Jan 10 '23 12:01 easis

Hi

I think I finally get a solution about the robotic voice with some devices. The fix will be available for 5.2.74 (on next SDK nightly).

Regards

julonexus avatar Jun 15 '23 08:06 julonexus