How do I give microphone permission to Desktop App (Linux, XFCE, USB mic)?

Hi,

Our new teammate introduced Mattermost as chat platform. Most things work easily and well. The only problem (so far) is that I can’t use my extermal USB microphone with the Desktop App and the call plugin. I’m using Mattermost on a PC that has no internal microphone, so the external one is the only option.

When I run Mattermost in the browser, it asks for microphone permission, and after that it works. But the Desktop App never aks and then complains about missing permissson. Because of the notifications in the system tray, I’d still like to use the Desktop App and not the browser. I only used the browser for testing.

The teammate who introduced Mattermost said he assumes it’s somewhere in the system settings, but he is a Windows uer and so he does not know where to look for these settings in Linux. That’s why I’m here to ask. :slightly_smiling_face:

I’m using Arch Linux with XFCE desktop environment, potentially switching to KDE in the near future. So I need to know where to look for both DE’s.

Thanks and Regards,
Markus

Hi Markus and welcome to the Mattermost forums!

The desktop app should write some logfiles which might give us hints about the problem. I recall people having problems with audio devices when the applications were sandboxed, maybe this is also the case for you.

You can find the logfiles in different locations, depending on your deployment, some are listed here.
You could also try to enable debug logging in the application if the logs do not contain helpful information and restart the app then.

Hi and thanks for the reply.

I am not knowingly running Mattermost in a sandbox. I am in fact using firejail, but it’s not set up to sandbox Mattermost.

Edit:
I’ve just verified that electron also is not firejailed.
/Edit

Below is the log of one attempt to start a call. It does not seem to contain info about the microphone permission. I’ve also tried to upload a screenshot, but it filed multiple times, so I gave up.

I also had to remove the server address from the logs, because the forum software misinterpreted it as me trying to post links.

[2022-11-27 11:48:43.279] [warn] In development mode, autostart config never effects
[2022-11-27 11:48:43.280] [info] Log level set to: verbose
[2022-11-27 11:48:43.288] [verbose] Config.loadRegistry { registryData: { teams: } }
[2022-11-27 11:48:43.289] [warn] In development mode, autostart config never effects
[2022-11-27 11:48:43.290] [info] Log level set to: verbose
[2022-11-27 11:48:43.292] [info] config.autostart has been configured: false
[2022-11-27 11:48:43.292] [info] config.autostart has been configured: false
[2022-11-27 11:48:43.294] [info] In development mode, deeplinking is disabled
[2022-11-27 11:48:43.383] [info] Autoupgrade disabled: false
[2022-11-27 11:48:43.422] [info] BrowserView created for server SERVERNAME___TAB_MESSAGING
[2022-11-27 11:48:43.426] [info] [SERVERNAME…] Loading servername
[2022-11-27 11:48:43.429] [info] BrowserView created for server SERVERNAME___TAB_FOCALBOARD
[2022-11-27 11:48:43.430] [info] [SERVERNAME…] Loading servername
[2022-11-27 11:48:43.434] [info] BrowserView created for server SERVERNAME___TAB_PLAYBOOKS
[2022-11-27 11:48:43.434] [info] [SERVERNAME…] Loading servername
[2022-11-27 11:48:43.438] [warn] couldn’t show SERVERNAME___TAB_MESSAGING, not ready
[2022-11-27 11:48:43.696] [info] opening SERVERNAME___TAB_FOCALBOARD on hasFocalboard
[2022-11-27 11:48:43.697] [info] opening SERVERNAME___TAB_PLAYBOOKS on hasPlaybooks
[2022-11-27 11:48:43.699] [info] Can’t send reload-config, will retry
[2022-11-27 11:48:43.700] [warn] In development mode, autostart config never effects
[2022-11-27 11:48:43.700] [info] Log level set to: verbose
[2022-11-27 11:48:43.707] [info] config.autostart has been configured: false
[2022-11-27 11:48:43.858] [info] [SERVERNAME…] finished loading servername/playbooks
[2022-11-27 11:48:43.859] [info] Can’t send load_success, will retry
[2022-11-27 11:48:43.859] [info] Can’t send update_mentions, will retry
[2022-11-27 11:48:43.865] [info] [SERVERNAME…] finished loading servername
[2022-11-27 11:48:43.866] [info] Can’t send load_success, will retry
[2022-11-27 11:48:43.866] [info] Can’t send update_mentions, will retry
[2022-11-27 11:48:43.969] [info] [SERVERNAME…] finished loading servername
[2022-11-27 11:48:47.861] [info] SERVERNAME___TAB_PLAYBOOKS timeout expired will show the browserview
[2022-11-27 11:48:47.868] [info] SERVERNAME___TAB_FOCALBOARD timeout expired will show the browserview

Thanks for the logs, although they’re not very helpful.
Could you please enable debug logging in the app, restart it and immediately try to make a call so that we can see all the logs from the application start up to the call attempt?

Also, just to rule that out: Your server is using https, right?

Interesting … I would have thought that “Verbose” also implies “Debug” …

Here is the log with level set to “Debug”, but I’m afraid it won’t be much more helpful. I’ve split the log at the position when I started the call attempt, so you can see what was startup and wht was call related.

However … I noticed the warning in the first line … how do I turn off development mode? I could not find it in the settings.

[2022-11-28 13:46:48.782] [warn] In development mode, autostart config never effects
[2022-11-28 13:46:48.783] [info] Log level set to: debug
[2022-11-28 13:46:48.783] [debug] Utils.handleUpdateMenuEvent
[2022-11-28 13:46:48.791] [verbose] Config.loadRegistry { registryData: { teams: } }
[2022-11-28 13:46:48.792] [debug] App.Config.handleConfigUpdate
[2022-11-28 13:46:48.793] [warn] In development mode, autostart config never effects
[2022-11-28 13:46:48.793] [info] Log level set to: debug
[2022-11-28 13:46:48.793] [debug] Utils.handleUpdateMenuEvent
[2022-11-28 13:46:48.795] [info] config.autostart has been configured: false
[2022-11-28 13:46:48.795] [info] config.autostart has been configured: false
[2022-11-28 13:46:48.797] [info] In development mode, deeplinking is disabled
[2022-11-28 13:46:48.883] [info] Autoupgrade disabled: false
[2022-11-28 13:46:48.884] [debug] WindowManager.showMainWindow undefined
[2022-11-28 13:46:48.912] [debug] App.handleAppBrowserWindowCreated
[2022-11-28 13:46:48.913] [debug] Utils.resizeScreen.handle
[2022-11-28 13:46:48.922] [info] BrowserView created for server SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:48.924] [info] [SERVERNAME…] Loading servername/mattermost
[2022-11-28 13:46:48.927] [info] BrowserView created for server SERVERNAME___TAB_FOCALBOARD
[2022-11-28 13:46:48.927] [info] [SERVERNAME…] Loading servername/mattermost/boards
[2022-11-28 13:46:48.930] [info] BrowserView created for server SERVERNAME___TAB_PLAYBOOKS
[2022-11-28 13:46:48.930] [info] [SERVERNAME…] Loading servername/mattermost/playbooks
[2022-11-28 13:46:48.933] [debug] viewManager.showByName SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:48.935] [warn] couldn’t show SERVERNAME___TAB_MESSAGING, not ready
[2022-11-28 13:46:48.940] [debug] Utils.handleUpdateMenuEvent
[2022-11-28 13:46:49.102] [debug] ServerInfo.trySendRemoteInfo SERVERNAME { name: ‘SERVERNAME’, hasFocalboard: true, hasPlaybooks: true }
[2022-11-28 13:46:49.105] [debug] ServerInfo.trySendRemoteInfo SERVERNAME {
name: ‘SERVERNAME’,
hasFocalboard: true,
hasPlaybooks: true,
serverVersion: ‘7.1.3’
}
[2022-11-28 13:46:49.106] [info] opening SERVERNAME___TAB_FOCALBOARD on hasFocalboard
[2022-11-28 13:46:49.107] [info] opening SERVERNAME___TAB_PLAYBOOKS on hasPlaybooks
[2022-11-28 13:46:49.111] [debug] App.Config.handleConfigUpdate
[2022-11-28 13:46:49.113] [debug] viewManager.showByName SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:49.113] [info] Can’t send reload-config, will retry
[2022-11-28 13:46:49.114] [warn] In development mode, autostart config never effects
[2022-11-28 13:46:49.114] [info] Log level set to: debug
[2022-11-28 13:46:49.114] [debug] Utils.handleUpdateMenuEvent
[2022-11-28 13:46:49.122] [info] config.autostart has been configured: false
[2022-11-28 13:46:49.143] [debug] Config.handleGetConfiguration undefined
[2022-11-28 13:46:49.145] [debug] ServerInfo.trySendRemoteInfo SERVERNAME { name: ‘SERVERNAME’, serverVersion: ‘7.1.3’ }
[2022-11-28 13:46:49.148] [debug] ServerInfo.trySendRemoteInfo SERVERNAME {
name: ‘SERVERNAME’,
serverVersion: ‘7.1.3’,
hasFocalboard: true,
hasPlaybooks: true
}
[2022-11-28 13:46:49.181] [debug] ServerInfo.trySendRemoteInfo SERVERNAME { name: ‘SERVERNAME’, serverVersion: ‘7.1.3’ }
[2022-11-28 13:46:49.182] [debug] ServerInfo.trySendRemoteInfo SERVERNAME {
name: ‘SERVERNAME’,
serverVersion: ‘7.1.3’,
hasFocalboard: true,
hasPlaybooks: true
}
[2022-11-28 13:46:49.279] [debug] MattermostView.did-finish-load SERVERNAME___TAB_FOCALBOARD
[2022-11-28 13:46:49.279] [info] [SERVERNAME…] finished loading servername/mattermost/boards
[2022-11-28 13:46:49.280] [info] Can’t send load_success, will retry
[2022-11-28 13:46:49.280] [info] Can’t send update_mentions, will retry
[2022-11-28 13:46:49.281] [debug] viewManager.activateView SERVERNAME___TAB_FOCALBOARD
[2022-11-28 13:46:49.283] [debug] MattermostView.did-finish-load SERVERNAME___TAB_PLAYBOOKS
[2022-11-28 13:46:49.284] [info] [SERVERNAME…] finished loading servername/mattermost/playbooks
[2022-11-28 13:46:49.284] [info] Can’t send load_success, will retry
[2022-11-28 13:46:49.285] [info] Can’t send update_mentions, will retry
[2022-11-28 13:46:49.285] [debug] viewManager.activateView SERVERNAME___TAB_PLAYBOOKS
[2022-11-28 13:46:49.293] [debug] MattermostView.did-finish-load SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:49.293] [info] [SERVERNAME…] finished loading servername/mattermost
[2022-11-28 13:46:49.294] [info] Can’t send load_success, will retry
[2022-11-28 13:46:49.294] [info] Can’t send update_mentions, will retry
[2022-11-28 13:46:49.295] [debug] viewManager.activateView SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:49.295] [debug] viewManager.showByName SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:49.348] [debug] WindowManager.focusBrowserView
[2022-11-28 13:46:49.937] [debug] Initialize.UserActivityMonitor.on(status) { userIsActive: true, idleTime: 0, isSystemEvent: false }
[2022-11-28 13:46:49.985] [debug] WwindowManager.handleBrowserHistoryPush {
viewName: ‘SERVERNAME___TAB_MESSAGING’,
pathName: ‘/users/channels/off-topic’
}
[2022-11-28 13:46:49.987] [debug] EindowManager.handleBrowserHistoryButton SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:49.997] [debug] webContentEvents.did-start-navigation {
webContentsId: 3,
url: ‘servername/mattermost/users/channels/off-topic’
}
[2022-11-28 13:46:50.114] [debug] Config.handleGetConfiguration undefined
[2022-11-28 13:46:52.544] [debug] webContentEvents.did-start-navigation {
webContentsId: 5,
url: ‘servername/mattermost/boards/’
}
[2022-11-28 13:46:52.596] [debug] webContentEvents.did-start-navigation {
webContentsId: 5,
url: ‘servername/mattermost/boards/welcome’
}
[2022-11-28 13:46:52.673] [debug] WindowManager.handleAppLoggedIn SERVERNAME___TAB_FOCALBOARD
[2022-11-28 13:46:52.688] [debug] WindowManager.handleAppLoggedIn SERVERNAME___TAB_PLAYBOOKS
[2022-11-28 13:46:52.695] [debug] WindowManager.handleAppLoggedIn SERVERNAME___TAB_PLAYBOOKS
[2022-11-28 13:46:52.719] [debug] webContentEvents.did-start-navigation {
webContentsId: 6,
url: ‘servername/mattermost/playbooks/runs’
}
[2022-11-28 13:46:52.722] [debug] WindowManager.handleAppLoggedIn SERVERNAME___TAB_FOCALBOARD
[2022-11-28 13:46:52.741] [debug] WindowManager.handleAppLoggedIn SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:52.751] [debug] WindowManager.handleAppLoggedIn SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:52.752] [debug] MattermostView.handleTitleUpdate {
tabName: ‘SERVERNAME___TAB_PLAYBOOKS’,
title: ‘Playbooks - pi-data’
}
[2022-11-28 13:46:52.765] [debug] MattermostView.handleTitleUpdate {
tabName: ‘SERVERNAME___TAB_MESSAGING’,
title: ‘Off-Topic - Users pi-data’
}
[2022-11-28 13:46:52.766] [debug] webContentEvents.did-start-navigation {
webContentsId: 6,
url: ‘servername/mattermost/playbooks/runs?sort=last_status_update_at&direction=desc&participant_or_follower_id=me&statuses%5B%5D=InProgress’
}
[2022-11-28 13:46:52.844] [debug] webContentEvents.did-start-navigation {
webContentsId: 6,
url: ‘servername/mattermost/playbooks/start’
}
[2022-11-28 13:46:52.951] [debug] WindowManager.handleReactAppInitialized SERVERNAME___TAB_PLAYBOOKS
[2022-11-28 13:46:52.952] [debug] EindowManager.handleBrowserHistoryButton SERVERNAME___TAB_PLAYBOOKS
[2022-11-28 13:46:52.953] [debug] WindowManager.handleReactAppInitialized SERVERNAME___TAB_FOCALBOARD
[2022-11-28 13:46:52.954] [debug] EindowManager.handleBrowserHistoryButton SERVERNAME___TAB_FOCALBOARD
[2022-11-28 13:46:52.987] [debug] WindowManager.handleReactAppInitialized SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:52.988] [debug] EindowManager.handleBrowserHistoryButton SERVERNAME___TAB_MESSAGING
[2022-11-28 13:46:53.310] [debug] WindowManager.handleLoadingScreenAnimationFinished
[2022-11-28 13:46:55.780] [debug] Utils.flushCookiesStore

call attempt started here:

[2022-11-28 13:47:21.021] [debug] WindowManager.focusBrowserView
[2022-11-28 13:47:21.215] [debug] TeamDropdownView.handleClose
[2022-11-28 13:47:26.492] [debug] TeamDropdownView.handleClose
[2022-11-28 13:47:33.794] [debug] Utils.flushCookiesStore
[2022-11-28 13:47:49.982] [debug] Initialize.UserActivityMonitor.on(status) { userIsActive: true, idleTime: 0, isSystemEvent: false }
[2022-11-28 13:48:50.022] [debug] Initialize.UserActivityMonitor.on(status) { userIsActive: true, idleTime: 0, isSystemEvent: false }
[2022-11-28 13:49:25.116] [debug] App.handleAppBeforeQuit
[2022-11-28 13:49:25.117] [debug] Utils.flushCookiesStore
[2022-11-28 13:49:25.118] [debug] MainWindow.on.close
[2022-11-28 13:49:25.123] [warn] main window closed

I just found out that MM ist indeed running in a sandbox … in electron’s sandbox:
In the process list, I found that MM is running with the parameter –enable-sandbox. Then I’ve searched the whole filesystem for the term enable-sandbox and it was only found in the electron binary /usr/lib/electron/electron. So my hope to find it in a config file or a script is now gone.

Any ideas to switch it off anyway?

Hmm… maybe this is a red herring, so not sure if it will change anything if we find out how to disable the sandbox. It seems to be hardcoded unless the environment is set to “test” (which is not the case for you here).
I’m not using Linux on the desktop, so I’m really unsure about how to pursue this issue further - Thanks for the detailed logs, I’ll try to get some developer attention to this thread, stay tuned!

BTW, you did not answer this question - can you confirm that you’re using https?
Also when you have the desktop app open, you should be able to see the console logs of the app (I think it looks similar on Linux):

grafik

Can you see any errors printed in the console when you try to make a call?

Ooops, sorry, I’ve overlooked the https question …
Yes, I’m using https on the the server.

And I’ve just tested a call with the developer tools open and there were no error messages in the console.

@Markus

Could you please share the output of running the following command in the JS console?

await navigator.mediaDevices.enumerateDevices();

It should include your input device (microphone).

Example

The external USB input device ist the second entry, “Jabra SPEAK 510 Mono”

[
{
“deviceId”: “default”,
“kind”: “audioinput”,
“label”: “Default”,
“groupId”: “d73b68cc0257548e3d41fd261bfca65de5d661262adfa142a1516fee28788644”
},
{
“deviceId”: “73dd56b300ee144f6ea1612e9c9e1660739a8506fc22780fc64cfb409d0b273d”,
“kind”: “audioinput”,
“label”: “Jabra SPEAK 510 Mono”,
“groupId”: “5749ef0e4340765d30b77e02c3fdec414afe5f822637b1906a44c5b9816adbb9”
},
{
“deviceId”: “default”,
“kind”: “audiooutput”,
“label”: “Default”,
“groupId”: “default”
},
{
“deviceId”: “735f81c5ff6444dd810d5047d2dbee2961f5ce224c7161b4e25ce30d4976ece5”,
“kind”: “audiooutput”,
“label”: “Family 17h (Models 00h-0fh) HD Audio Controller Analog Surround 5.1”,
“groupId”: “32955f55b8801ed699b72985cecbe256973caa5fe7e9166890fbacd9a280417f”
}
]

I’ve got one more thing that could be interesting:

We were already using Jitsi for video calls before the new teammate introduced MM. So he configured MM in a way that allows opening a Jitsi session from within MM. And interestingly, the microphone works in that Jitsi session.

Thanks @Markus , so it looks like the app has at least knowledge of it. So how does the problem present to you? Is the list of devices empty in the Microphone menu or do you get an error?

Like this:

Screenshot_Microphone_permission

But wherever I click, I never get asked if I want to grant that permission.

In contrast, when I start MM in the browser, it asks me about that permission and when I click “Allow” it works. Hence the title of my post :slight_smile:

Okay, to confirm, is the input device menu empty (you can open it by clicking on the three dots button) or can you select a different device?

I can’t even open the menu. The > is disabled.

Screenshot_no_audio_input_permissions

Very interesting. Could you try running this command in the console?

await navigator.mediaDevices.getUserMedia({audio: true, video: false});

Tis gives me a

Uncaught DOMException: Could not start audio source

And I can not expand this message to see the stack trace.

Okay that’s the problem we are having then. I’ve seen this error before and likely some issue between the system and electron (see [Bug]: Could not start audio source error on mediaDevices.getUserMedia · Issue #32299 · electron/electron · GitHub for an example).

What I’d like to understand is whether it’s just the default device the problem or something else. To test this we could do something like this:

  1. Fetch the devices like we did before:
await navigator.mediaDevices.enumerateDevices();
  1. Copy the deviceId of the microphone you expect to use and run:
await navigator.mediaDevices.getUserMedia({audio: {deviceId: {exact: '2b4966ead820e4070ce8b67ca5347520604e170d0aba45ef113882378338783b'}}});

Change the id with whatever you get at step 1. And see if the error is gone now.

Yes, the error is gone when I use the exact deviceId:

MediaStream {id: ‘s4athat7axBmH4lTfvoxOCntqGYN7TCVIQSO’, active: true, onaddtrack: null, onremovetrack: null, onactive: null, …}
active: true
id: “s4athat7axBmH4lTfvoxOCntqGYN7TCVIQSO”
onactive: null
onaddtrack: null
oninactive: null
onremovetrack: null
[[Prototype]]: MediaStream