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

bug: input device from call settings should also be used for voice message recording #26489

Closed
voidpointer0x00 opened this issue Jul 8, 2023 · 7 comments
Labels

Comments

@voidpointer0x00
Copy link

Steps to reproduce

  1. Set the input device to anything but system's default device. <= everything works as expected
  2. Record a voice message. <= fallback to default input stream happens

Expected behaviour

Telegram should respect it's own settings :)

Actual behaviour

The application fallbacks to system's default input source avoiding any streams from the configuration.
While changing the settings:
image
image

When recording a vocie message:
image
system settings:
image

Operating system

EndeavourOS Linux 6.4.1-arch2-1

Version of Telegram Desktop

4.8.4-2

Installation source

Other (unofficial) source

Crash ID

No response

Logs

The only related lines:

[2023.07.08 22:21:37] Audio Info: recreating audio device and reattaching the tracks
[2023.07.08 22:21:39] Audio Info: Closing audio playback device.
[2023.07.08 22:21:49] Audio Info: recreating audio device and reattaching the tracks
[2023.07.08 22:21:51] Audio Info: Closing audio playback device.
@voidpointer0x00 voidpointer0x00 changed the title bug: the app does not respect input device from call settings bug: input device from call settings should also be used for voice message recording Jul 8, 2023
@voidpointer0x00
Copy link
Author

voidpointer0x00 commented Jul 8, 2023

A possible solution is to use CurrentAudioInputName() function on alcCaptureOpenDevice(...) call instead of nullptr as the first device argument.

[[nodiscard]] QString CurrentAudioInputName();

// Start OpenAL Capture
d->device = alcCaptureOpenDevice(nullptr, kCaptureFrequency, AL_FORMAT_MONO16, kCaptureFrequency / 5);

#include "settings/settings_calls.h"
// ...
using Settings::CurrentAudioInputName;
d->device = alcCaptureOpenDevice(CurrentAudioInputName().toLatin1().data(), kCaptureFrequency, AL_FORMAT_MONO16, kCaptureFrequency / 5);

It builds, but I cannot test whether it works, because it does not link on my system for the following reason (perhaps, a protobuf 23.4 related issue Cockatrice/Cockatrice#4825):

[ 52%] Linking CXX static library liblib_base_crash_report_writer.a
[ 52%] Built target lib_base_crash_report_writer
/usr/bin/ld: ../cmake/external/cld3/libexternal_cld3_bundled.a(sentence.pb.cc.o): undefined reference to symbol '_ZN4absl12lts_2023012512log_internal21CheckOpMessageBuilder7ForVar2Ev'
/usr/bin/ld: /usr/lib/libabsl_log_internal_check_op.so.2301.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

UPD: fixed by changing find_package(protobuf REQUIRED) to find_package(protobuf REQUIRED CONFIG) in CMakeLists.txt files, but then I'm getting other errors that I don't know how to fix (not a C++ dev) :)

[ 52%] Linking CXX executable ../telegram-desktop
/usr/bin/ld: liblib_tgcalls.a(DesktopInterface.cpp.o): in function `std::enable_if<is_base_of_v<webrtc::webrtc_sequence_checker_internal::SequenceCheckerImpl, webrtc::SequenceChecker>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::type webrtc::webrtc_sequence_checker_internal::ExpectationToString<webrtc::SequenceChecker>(webrtc::SequenceChecker const*)':
DesktopInterface.cpp:(.text._ZN6webrtc32webrtc_sequence_checker_internal19ExpectationToStringINS_15SequenceCheckerEEENSt9enable_ifIX12is_base_of_vINS0_19SequenceCheckerImplET_EENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4typeEPKS5_[_ZN6webrtc32webrtc_sequence_checker_internal19ExpectationToStringINS_15SequenceCheckerEEENSt9enable_ifIX12is_base_of_vINS0_19SequenceCheckerImplET_EENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4typeEPKS5_]+0x2e): undefined reference to `webrtc::webrtc_sequence_checker_internal::SequenceCheckerImpl::ExpectationToString[abi:cxx11]() const'
collect2: error: ld returned 1 exit status
make[2]: *** [Telegram/CMakeFiles/Telegram.dir/build.make:12027: telegram-desktop] Error 1

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Jul 9, 2023

No, it shouldn't as it's clearly specified as call settings.

@ilya-fedin
Copy link
Contributor

DesktopInterface.cpp:(.text.ZN6webrtc32webrtc_sequence_checker_internal19ExpectationToStringINS_15SequenceCheckerEEENSt9enable_ifIX12is_base_of_vINS0_19SequenceCheckerImplET_EENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4typeEPKS5[ZN6webrtc32webrtc_sequence_checker_internal19ExpectationToStringINS_15SequenceCheckerEEENSt9enable_ifIX12is_base_of_vINS0_19SequenceCheckerImplET_EENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4typeEPKS5]+0x2e): undefined reference to `webrtc::webrtc_sequence_checker_internal::SequenceCheckerImpl::ExpectationToStringabi:cxx11 const'

tdesktop's and tg_owt's CMAKE_BUILD_TYPE must match.

@voidpointer0x00
Copy link
Author

voidpointer0x00 commented Jul 9, 2023

No, it shouldn't as it's clearly specified as call settings.

Well, then maybe a "voice message input device" setting should be introduced? 😄

@ilya-fedin
Copy link
Contributor

There's already a feature request for that

@voidpointer0x00
Copy link
Author

There's already a feature request for that

I can't seem to find it, could you please reference the issue or PR?

@ilya-fedin
Copy link
Contributor

Really?
изображение

@voidpointer0x00 voidpointer0x00 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants