tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

Can't change recording device under Linux/PulseAudio

Open meltylang opened this issue 10 years ago • 21 comments

Steps to reproduce

  1. Install external sound card or webcam
  2. Make this external card default (fallback) recording device using pavucontrol
  3. Make old card output-only (e.g. analog stereo output instead of analog stereo duplex)
  4. Launch Telegram
  5. Try to record audio message

Expected behaviour

Message recorded from webcam mic.

Actual behaviour

Telegram will use old device or show error message "Could not send an empty file :(" . Skype on this machine works just fine.

Configuration

Operating system: Debian 8.5+backports, Linux 4.6.1-1~bpo8+1 x86_64, pulseaudio 7.1, KDE 4.14

Version of Telegram Desktop: 0.9.51

Logs

Console messages:

Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number AL lib: (EE) LoadHrtf: Could not open default-48000.mhr AL lib: (EE) GetHrtf: Incompatible format: Stereo 48000hz QXcbWindow: Unhandled client message: "QTCURVE_ACTIVE_WINDOW" [libopus @ 0x7fd1fc017b10] Warning: not compiled with thread support, using thread emulation [opus @ 0x7fd1fc017140] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.

log_20_45.txt

meltylang avatar Jul 06 '16 11:07 meltylang

Does changing the output device of Telegram work for you?

z3ntu avatar Jul 12 '16 10:07 z3ntu

No, I can't change output device for Telegram.

meltylang avatar Jul 12 '16 12:07 meltylang

Okay then I also experienced this issue (Arch Linux).

z3ntu avatar Jul 12 '16 13:07 z3ntu

Kind of solution: Updated to Debian Testing + Pulseaudio 9.0, and then old caches break PA. Cleaned old caches by next command: $ rm -r ~/.pulse ~/.pulse-cookie ~/.config/pulse Now when you set fallback device and restart telegram it will respect new settings.

meltylang avatar Aug 16 '16 05:08 meltylang

After reboot TG again forget about selected device and do not want to user fallback device.

meltylang avatar Aug 16 '16 05:08 meltylang

Probably duplicate of #776

z3ntu avatar Sep 02 '16 15:09 z3ntu

Version 1.0.5 seems to respect pulseaudio settings. PA version 10.0 Debian Testing (aka 9.0 Stretch)

meltylang avatar Feb 02 '17 02:02 meltylang

Problem persists on 1.2.6 alpha. Cleaning caches solves until next reboot only.

dariox2 avatar Feb 19 '18 21:02 dariox2

I also have this problem with Telegram 1.2.8 on Manjaro Linux. I can't get it to record from my 'real' mic. It always starts recording from my 'Monitor of ...'. If I go into pavuctl and change it to my mic, it directly resets itself to the 'Monitor of ...' input. So Telegram forces this. I can't change the input device for that recording stream. With other applications, this is possible, but not with Telegram.

Also an option in Telegram to choose a mic would be nice. Because I for example have my webcam and my 'real' mic and there is currently no way to switch between them.

Bleuzen avatar Mar 09 '18 15:03 Bleuzen

I also can't use my external mic for Telegram voice messages.

Can't this be fixed?

stefan-reich avatar Aug 24 '18 12:08 stefan-reich

This issue can't be fixed until it's not affecting core developers, as it is for many other projects running on linux desktop. My workaround is just switching to macOS and forgeting about desktop linux like it was a bad dream.

meltylang avatar Aug 24 '18 13:08 meltylang

Same problem here on Ubuntu 18.04 in Pulse Audio trying to select audio output device. Works for another person on KDE Neon.. (which also has an ubuntu base) The only solution is to disable all but the wanted device completely.

0xpr03 avatar Dec 10 '18 17:12 0xpr03

Bug persists on Ubuntu 18.04 with Telegram 1.5.8

iKoze avatar Jan 29 '19 08:01 iKoze

Same issue with pulseaudio 12.2 and telegram 1.5.15 on Manjaro. Other programs use the fallback device but telegram ignores pavuctrl options

ghost avatar Mar 12 '19 11:03 ghost

Same issue with pulseaudio 13 and telegram 1.8.8 on Archlinux.

logicinu avatar Sep 25 '19 13:09 logicinu

This seems to be an inherent issue depending on the audio engine you use. I know exactly one other system that has this problem: Minecraft, java edition. Every other system seems to use the pulse audio API, except these two, where you have to disable all other devices except for the one you want them to use. Then these applications will stick with them forever (accidentally unplugged your device ? restart the application ).

0xpr03 avatar Sep 25 '19 14:09 0xpr03

This seems to be an inherent issue depending on the audio engine you use. I know exactly one other system that has this problem: Minecraft, java edition. Every other system seems to use the pulse audio API, except these two, where you have to disable all other devices except for the one you want them to use. Then these applications will stick with them forever (accidentally unplugged your device ? restart the application ).

I do not agree, I solve the problem that has an issue with some programs. In the case of MC/Steam and Telegram issue is simple you need to enable this configuration in your system:

Create a config file for openalsoft (~/.alsoftrc or /etc/openal/alsoft.conf). This will allow to seamsly change your sound output/input on the fly.

[pulse] allow-moves=yes

After this you can switch on the fly ACTIVE streams, but may not really changes default option in some cases, e.g. calls is easy because the stream do not depend of your mouse, different is when you need to change device of a recording audio. In KDE/Plasma you can change it but only if its active, when I release the audio record button, stream stops and I cannot change the stream device input, and the funny thing is that stream is not using even the default device, is so weird.

May some of you do not notice but, there is a call specific options that are not in global settings, you need to go to call-> and then setting. This settings are useful to change device streams using test microphone option either with system device switch or the telegram option listed there, this may solve call issue, but there is no option for test recording audio, not even here or in general settings.

I leave this half solution that may will be useful. I'm still with the issue of recording audios with correct device.

I do not agree with you because Telegram IS NOT using default device, and telegram uses two different configurations for call and record, so I dont think this is an SO or audio engine issue, is the way that telegram handles devices, may they should have a similar test and options for recording audio like they have with call settings.

PS: I'm using Manjaro Linux & Plasma

arlyoneel avatar Oct 19 '19 21:10 arlyoneel

Now they have settings and ability to change recording device, and you know what? Test works great! But it still records with internal microphone...

sTiKyt avatar Mar 01 '20 19:03 sTiKyt

https://github.com/telegramdesktop/tdesktop/issues/5380 My issue 5380 was recognized as a duplicate of this and still does not work for me. Should I have a new issue?

13ilya-old avatar Sep 23 '20 09:09 13ilya-old

Create a config file for openalsoft (~/.alsoftrc or /etc/openal/alsoft.conf). This will allow to seamsly change your sound output/input on the fly.

[pulse] allow-moves=yes

After this you can switch on the fly ACTIVE streams, but may not really changes default option in some cases, e.g. calls is easy because the stream do not depend of your mouse, different is when you need to change device of a recording audio. In KDE/Plasma you can change it but only if its active, when I release the audio record button, stream stops and I cannot change the stream device input, and the funny thing is that stream is not using even the default device, is so weird.

May some of you do not notice but, there is a call specific options that are not in global settings, you need to go to call-> and then setting. This settings are useful to change device streams using test microphone option either with system device switch or the telegram option listed there, this may solve call issue, but there is no option for test recording audio, not even here or in general settings.

I leave this half solution that may will be useful. I'm still with the issue of recording audios with correct device.

I do not agree with you because Telegram IS NOT using default device, and telegram uses two different configurations for call and record, so I dont think this is an SO or audio engine issue, is the way that telegram handles devices, may they should have a similar test and options for recording audio like they have with call settings.

PS: I'm using Manjaro Linux & Plasma

@arlyoneel Thanks! I didn't see this reply until now.. (And yes that full quote is on purpose, it's the solution.) I think it just uses the first device on the list. Which is why the default is ignored.

0xpr03 avatar Sep 23 '20 11:09 0xpr03