Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ALSA and microphone in discord-bin
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
imbaled
n00b
n00b


Joined: 23 Aug 2018
Posts: 8

PostPosted: Fri Sep 28, 2018 11:46 am    Post subject: ALSA and microphone in discord-bin Reply with quote

Hello,

my mic works in steam and discords browser version, but not in audacity or discord-bin(apulse shows defaults, but no sound).
Code:

imbaled@Purgatory ~ $ apulse discord
Discord 0.0.5
Starting updater.
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: enabled
[Modules] Module updates: enabled
[Modules] Module install path: /home/imbaled/.config/discord/0.0.5/modules
[Modules] Module installed file path: /home/imbaled/.config/discord/0.0.5/modules/installed.json
[Modules] Module download path: /home/imbaled/.config/discord/0.0.5/modules/pending
[Modules] No updates to install
[Modules] Checking for host updates.
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discordapp.com/api/modules/stable/versions.json
[Modules] No module updates available.
[000:000] [19820] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {stereo: 0, usedtx: 0, useinbandfec: 0}}
[000:000] [19820] (audio_send_stream.cc:261): Failed to set up send codec state.
[000:048] [19820] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {stereo: 0, usedtx: 0, useinbandfec: 1}}
[000:048] [19820] (audio_send_stream.cc:261): Failed to set up send codec state.
[000:048] [19820] (audio_device_generic.cc:31): BuiltInAECIsAvailable: Not supported on this platform
[000:105] [19820] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {stereo: 0, usedtx: 0, useinbandfec: 1}}
[000:105] [19820] (audio_send_stream.cc:261): Failed to set up send codec state.

If i set input mode to Voice Activity it starts to loop
Code:

[028:876] [23938] (audio_coding_module.cc:1210): Add10MsData failed: No send codec is registered.
[028:876] [23938] (channel.cc:1323): ACM::Add10MsData() failed.

Code:
imbaled@Purgatory ~ $ cat .asoundrc
pcm.primary {
        type hw
        card 0
        device 0
}


pcm.capture {
        type plug
        card 2
        device 0

}

Code:
imbaled@Purgatory ~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC1150 Analog [ALC1150 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC1150 Alt Analog [ALC1150 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Snowball [Blue Snowball], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Code:
imbaled@Purgatory ~ $ arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=PCH
    HDA Intel PCH, ALC1150 Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, ALC1150 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Analog
    Front speakers
default:CARD=Snowball
    Blue Snowball, USB Audio
    Default Audio Device
sysdefault:CARD=Snowball
    Blue Snowball, USB Audio
    Default Audio Device
front:CARD=Snowball,DEV=0
    Blue Snowball, USB Audio
    Front speakers
surround21:CARD=Snowball,DEV=0
    Blue Snowball, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Snowball,DEV=0
    Blue Snowball, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Snowball,DEV=0
    Blue Snowball, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Snowball,DEV=0
    Blue Snowball, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Snowball,DEV=0
    Blue Snowball, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Snowball,DEV=0
    Blue Snowball, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

Code:
imbaled@Purgatory ~ $ lsmod | grep snd
snd_seq_dummy          16384  0
snd_seq                81920  1 snd_seq_dummy
snd_usb_audio         221184  2
snd_usbmidi_lib        32768  1 snd_usb_audio
snd_rawmidi            36864  1 snd_usbmidi_lib
snd_seq_device         16384  2 snd_seq,snd_rawmidi
snd_hda_codec_hdmi     57344  1
snd_hda_codec_realtek   102400  1
snd_hda_codec_generic    81920  1 snd_hda_codec_realtek
snd_hda_intel          40960  12
snd_hda_codec         135168  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core           90112  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hwdep              16384  2 snd_usb_audio,snd_hda_codec
snd_pcm               110592  10 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,snd_hda_core
snd_timer              36864  7 snd_seq,snd_pcm
snd                    90112  31 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,
snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm,
snd_rawmidi
soundcore              16384  1 snd

Code:
imbaled@Purgatory ~ $ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:5734 Standard Microsystems Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0424:274a Standard Microsystems Corp.
Bus 001 Device 005: ID 05af:0802 Jing-Mold Enterprise Co., Ltd
Bus 001 Device 004: ID 046d:c531 Logitech, Inc. C-U0007 [Unifying Receiver]
Bus 001 Device 003: ID 0424:2734 Standard Microsystems Corp.
Bus 001 Device 008: ID 0d8c:0005 C-Media Electronics, Inc. Blue Snowball
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


[Moderator edit: broke long whitespace-free lines in code tags to fix thread layout. -Hu]


Last edited by imbaled on Thu Oct 25, 2018 4:42 am; edited 1 time in total
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1655

PostPosted: Sat Oct 20, 2018 1:58 am    Post subject: Reply with quote

What USE flags did you use for media-sound/audacity ?
Did you check your alsamixer settings and see if the mic is muted?
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
Muso
Veteran
Veteran


Joined: 22 Oct 2002
Posts: 1052
Location: The Holy city of Honolulu

PostPosted: Sat Oct 20, 2018 2:10 am    Post subject: Reply with quote

turtles wrote:
What USE flags did you use for media-sound/audacity ?
Did you check your alsamixer settings and see if the mic is muted?


++

The M key will mute/unmute in alsamixer.
_________________
"You can lead a horticulture but you can't make her think" ~ Dorothy Parker
2021 is the year of the Linux Desktop!
Back to top
View user's profile Send private message
imbaled
n00b
n00b


Joined: 23 Aug 2018
Posts: 8

PostPosted: Tue Oct 23, 2018 8:20 pm    Post subject: Reply with quote

turtles wrote:
What USE flags did you use for media-sound/audacity ?
Did you check your alsamixer settings and see if the mic is muted?

Muso wrote:
The M key will mute/unmute in alsamixer.


Thanks your for replys.

I forgot to set USE flags for audacity, it seems working now.
I mentioned mic works in steam so it's not muted, i also checked alsamixer and i can't even mute my mic.

Discord updated but failed to download discord_cloudsync(it should not effect to mic?)
Discord still won't show any audio device. Except when i run it with apulse, still no audio from mic and loops same thing when i set input mode to Voice Activity.

Code:
Purgatory /etc/portage/package.use # discord
Discord 0.0.5
Starting updater.
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: enabled
[Modules] Module updates: enabled
[Modules] Module install path: /root/.config/discord/0.0.5/modules
[Modules] Module installed file path: /root/.config/discord/0.0.5/modules/installed.json
[Modules] Module download path: /root/.config/discord/0.0.5/modules/pending
[Modules] No updates to install
[Modules] Checking for host updates.
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discordapp.com/api/modules/stable/versions.json
[Modules] No module updates available.
[000:000] [11127] (audio_device_pulse_linux.cc:1549): failed to load symbol table
[000:000] [11127] (audio_device_pulse_linux.cc:151): failed to initialize PulseAudio
[000:000] [11127] (audio_device_impl.cc:321): Audio device initialization failed.
[Modules] Starting to install discord_cloudsync...
[Modules] Fetching discord_cloudsync@0 from https://discordapp.com/api/modules/stable/discord_clo
[Modules] Streaming discord_cloudsync@0 [255 bytes] to /root/.config/discord/0.0.5/modules/pending/discord_cloudsync-0.zip
[Modules] Finished module downloads. [success: 0] [failure: 1]
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Wed Oct 24, 2018 12:06 am    Post subject: Reply with quote

I'm pretty sure discord-bin is just plain broken. On my computer it won't output sound reliably (it's scratchy and distorted), but the browser version works fine. Nothing can be done about that until upstream fixes it.
Back to top
View user's profile Send private message
imbaled
n00b
n00b


Joined: 23 Aug 2018
Posts: 8

PostPosted: Wed Oct 24, 2018 12:35 am    Post subject: Reply with quote

Ant P. wrote:
I'm pretty sure discord-bin is just plain broken. On my computer it won't output sound reliably (it's scratchy and distorted), but the browser version works fine. Nothing can be done about that until upstream fixes it.


Yes, but without push to talk... Any idea if it works with pulseaudio? Not sure if I even want try, had so much trouble with it before
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Wed Oct 24, 2018 12:55 am    Post subject: Reply with quote

I'm using PA, so you probably wouldn't escape the bugs by switching.

But if you want push-to-talk, you could use a global (desktop) keyboard shortcut to mute/unmute the microphone. PA would make it possible to mute only the browser input while leaving the mic active for other things, if needed.
Back to top
View user's profile Send private message
imbaled
n00b
n00b


Joined: 23 Aug 2018
Posts: 8

PostPosted: Wed Oct 24, 2018 1:13 am    Post subject: Reply with quote

Ant P. wrote:
I'm using PA, so you probably wouldn't escape the bugs by switching.

But if you want push-to-talk, you could use a global (desktop) keyboard shortcut to mute/unmute the microphone. PA would make it possible to mute only the browser input while leaving the mic active for other things, if needed.


That would be great, but i don’t know how to do it. I also can't mute my mic in alsamixer
Back to top
View user's profile Send private message
Ralphred
Guru
Guru


Joined: 31 Dec 2013
Posts: 495

PostPosted: Wed Oct 24, 2018 6:04 am    Post subject: Reply with quote

imbaled wrote:
Ant P. wrote:
I'm pretty sure discord-bin is just plain broken. On my computer it won't output sound reliably (it's scratchy and distorted), but the browser version works fine. Nothing can be done about that until upstream fixes it.
Yes, but without push to talk... Any idea if it works with pulseaudio? Not sure if I even want try, had so much trouble with it before

My discord stopped working with apulse, and pulseaudio doesn't play nicely with my sound card regarding capture.
It's not too hard to neuter pulseaudio and force it to just use specific modules/devices as source and sink, this gives the advantage of allowing pulseaudio to resample client connections.

Before you go that route though, discord needs pulseaudio to work, either fully fledged or via apulse. Apulse uses the two environment variables APULSE_CAPTURE_DEVICE and APULSE_PLAYBACK_DEVICE, which default (aptly) to "default".
You may have success with my old discord wrapper script
Code:
#!/bin/bash
export APULSE_CAPTURE_DEVICE=hw:0,0
export APULSE_PLAYBACK_DEVICE=plug:speakers
/usr/bin/apulse /usr/bin/discord
if you tailor it to match your input and output devices. Technically, it still works here, but doesn't allow me to fix the underlying issues I have with alsa.

If you have no luck with it, say so and I can post what I did to tame pulseaudio, though it's a lot more involved.
Back to top
View user's profile Send private message
imbaled
n00b
n00b


Joined: 23 Aug 2018
Posts: 8

PostPosted: Wed Oct 24, 2018 11:08 am    Post subject: Reply with quote

Ralphred wrote:
imbaled wrote:
Ant P. wrote:
I'm pretty sure discord-bin is just plain broken. On my computer it won't output sound reliably (it's scratchy and distorted), but the browser version works fine. Nothing can be done about that until upstream fixes it.
Yes, but without push to talk... Any idea if it works with pulseaudio? Not sure if I even want try, had so much trouble with it before

My discord stopped working with apulse, and pulseaudio doesn't play nicely with my sound card regarding capture.
It's not too hard to neuter pulseaudio and force it to just use specific modules/devices as source and sink, this gives the advantage of allowing pulseaudio to resample client connections.

Before you go that route though, discord needs pulseaudio to work, either fully fledged or via apulse. Apulse uses the two environment variables APULSE_CAPTURE_DEVICE and APULSE_PLAYBACK_DEVICE, which default (aptly) to "default".
You may have success with my old discord wrapper script
Code:
#!/bin/bash
export APULSE_CAPTURE_DEVICE=hw:0,0
export APULSE_PLAYBACK_DEVICE=plug:speakers
/usr/bin/apulse /usr/bin/discord
if you tailor it to match your input and output devices. Technically, it still works here, but doesn't allow me to fix the underlying issues I have with alsa.

If you have no luck with it, say so and I can post what I did to tame pulseaudio, though it's a lot more involved.


Thanks for reply. I will try this soon as i get home.


Edit. It seems that my .asoundrc got wrong type changed plug:2,0 to hw:2,0(as it shows in audacity).

I tried script, but still now working and export APULSE_PLAYBACK_DEVICE=hw:0,0 stops output audio too.

Code:
imbaled@Purgatory ~ $ cat discord.sh
#!/bin/bash
export APULSE_CAPTURE_DEVICE=hw:2,0
#export APULSE_PLAYBACK_DEVICE=hw:0,0

/usr/bin/apulse /usr/bin/discord
imbaled@Purgatory ~ $ ./discord.sh
Discord 0.0.5
Starting updater.
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: enabled
[Modules] Module updates: enabled
[Modules] Module install path: /home/imbaled/.config/discord/0.0.5/modules
[Modules] Module installed file path: /home/imbaled/.config/discord/0.0.5/modules/installed.json
[Modules] Module download path: /home/imbaled/.config/discord/0.0.5/modules/pending
[Modules] No updates to install
[Modules] Checking for host updates.
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discordapp.com/api/modules/stable/versions.json
[Modules] No module updates available.
[Modules] Starting to install discord_cloudsync...
[Modules] Fetching discord_cloudsync@0 from https://discordapp.com/api/modules/stable/discord_cloudsync/0
[Modules] Streaming discord_cloudsync@0 [255 bytes] to /home/imbaled/.config/discord/0.0.5/modules/pending/discord_cloudsync-0.zip
[Modules] Finished module downloads. [success: 0] [failure: 1]
[000:000] [18766] (audio_coding_module.cc:1210): Add10MsData failed: No send codec is registered.
[000:000] [18766] (channel.cc:1323): ACM::Add10MsData() failed.
[002:572] [18769] (audio_coding_module.cc:1210): Add10MsData failed: No send codec is registered.
[002:572] [18769] (channel.cc:1323): ACM::Add10MsData() failed.
[002:582] [18769] (audio_coding_module.cc:1210): Add10MsData failed: No send codec is registered.
[002:582] [18769] (channel.cc:1323): ACM::Add10MsData() failed.
[002:592] [18769] (audio_coding_module.cc:1210): Add10MsData failed: No send codec is registered.
[002:592] [18769] (channel.cc:1323): ACM::Add10MsData() failed.
[002:603] [18769] (audio_coding_module.cc:1210): Add10MsData failed: No send codec is registered.
[002:603] [18769] (channel.cc:1323): ACM::Add10MsData() failed.
[002:612] [18769] (audio_coding_module.cc:1210): Add10MsData failed: No send codec is registered.


This happens when I join voice channel

Code:
[[963:167] [18206] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {stereo: 0, usedtx: 0, useinbandfec: 0}}
[963:167] [18206] (audio_send_stream.cc:261): Failed to set up send codec state.
[963:252] [18206] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {stereo: 0, usedtx: 0, useinbandfec: 1}}
[963:252] [18206] (audio_send_stream.cc:261): Failed to set up send codec state.
[963:252] [18206] (audio_device_generic.cc:31): BuiltInAECIsAvailable: Not supported on this platform
[963:334] [18206] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {stereo: 0, usedtx: 0, useinbandfec: 1}}
[963:334] [18206] (audio_send_stream.cc:261): Failed to set up send codec state.
Back to top
View user's profile Send private message
Ralphred
Guru
Guru


Joined: 31 Dec 2013
Posts: 495

PostPosted: Mon Nov 05, 2018 8:12 pm    Post subject: Reply with quote

So, is the general consensus that apulse doesn't work with Discord anymore?

This basically leaves you with the option of using pulseaudio proper. I have done this, and I have tamed pulseaudio to my every whim, but I use jack (for other reasons) and this seems to be key in my success in taming pulse.

If you are interested in going down that rabbit hole, say so and I'll explain what's going on here.
Also, I recently built a system for my son, who joins me on discord and plays the same games I do, so my theories about a simple jack/pulse layer do work too.
Back to top
View user's profile Send private message
TechwoIf
n00b
n00b


Joined: 06 Aug 2007
Posts: 38

PostPosted: Sun Dec 16, 2018 4:54 am    Post subject: Reply with quote

Ralphred wrote:
So, is the general consensus that apulse doesn't work with Discord anymore?


I use apulse with discord and its working for me. The command line I use is:

Code:
APULSE_CAPTURE_DEVICE=plug:headsnooped APULSE_PLAYBACK_DEVICE=plug:dmixs51headphone apulse discord


I have separate entries in the asound.conf for the card that playback via speakers and the card that is hooked up to the headphones. I found out that telling apulse to use hw:2,0 results in my mic sounding like a chipmunk.

Note: My headphone card is a Sennheiser GTX 1000 headphone device. This is why I have the plugin configure for surround sound on the headphones.
Back to top
View user's profile Send private message
lorschy
Apprentice
Apprentice


Joined: 16 Jul 2002
Posts: 191

PostPosted: Fri Feb 01, 2019 10:44 pm    Post subject: Reply with quote

Hi guys,

i had the same problem - turning off noise suppression solved it for me .

Credits go to:
https://aur.archlinux.org/packages/discord/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum