vscodium icon indicating copy to clipboard operation
vscodium copied to clipboard

No audio/sound at all in snap version

Open geekley opened this issue 1 year ago • 7 comments

Describe the bug Audio does not play at all on the snap version of codium. It plays normally on the flathub version.

Please confirm that this problem is VSCodium-specific

  • This bug doesn't happen in the flathub version of Microsoft's Visual Studio Code either.
  • I don't know if it happens in the snap version of MS VSCode (I won't install it) but some issues seem to indicate it happens:
    • https://github.com/microsoft/vscode/issues/179385
    • https://github.com/microsoft/vscode/issues/229786.

Please confirm that the issue/resolution isn't already documented

To Reproduce Just open some music file e.g. .mp3, .ogg in the IDE and click play in the widget.

Alternatively, open the developer tools and paste this in the console to play a beep:

const audioContext = new AudioContext();
const oscillator = audioContext.createOscillator();
oscillator.type = 'sine';
oscillator.frequency.value = 440;
oscillator.connect(audioContext.destination);
oscillator.start();
setTimeout(() => { oscillator.stop(); }, 1000);

Expected behavior You get audio normally (music or the beep).

Desktop (please complete the following information):

  • OS: Kubuntu 24.04
  • Architecture: x64
  • Version: 1.96.2
  • App Manager: Snap
  • Sandboxed: no? Snap was installed with --classic

Additional context

$ snap connections codium
# shows nothing

$ snap info codium
name:      codium
summary:   Code editing. Redefined.
publisher: VSCodium
store-url: https://snapcraft.io/codium
contact:   https://github.com/VSCodium/vscodium/issues
license:   unset
description: |
  Binary releases of Visual Studio Code without branding/telemetry/licensing
commands:
  - codium
  - codium.url-handler
snap-id:      lIZWXTqmo6LFSts5Cgk2VPlNwtysZAeH
tracking:     latest/stable
refresh-date: 9 days ago, at 14:21 -03
channels:
  latest/stable:    1.96.2.24355 2024-12-21 (436) 321MB classic
  latest/candidate: ^                                   
  latest/beta:      ^                                   
  latest/edge:      1.95.3.24321 2024-11-16 (428) 320MB classic
installed:          1.96.2.24355            (436) 321MB classic

geekley avatar Dec 30 '24 23:12 geekley

I thinks it's a permission issue.

Have you tried snap connect codium:audio-playback?

It seems like it would need the following in the snapcraft.yaml:

apps:
  codium:
    plugs:
      - audio-playback

daiyam avatar Dec 30 '24 23:12 daiyam

I think I can't even try it without the changes in snapcraft, unless there's another way?

$ sudo snap connect codium:audio-playback
error: snap "codium" has no plug named "audio-playback"

geekley avatar Dec 31 '24 00:12 geekley

+1, I have the exact same issue. Got the same error of no plug.

Shadow1363 avatar Jan 07 '25 03:01 Shadow1363

It doesn't work! It won't publish because snap doesn't allow slots/plugs in classic confinement. (https://launchpad.net/bugs/1655369)

Errors
------
 - lint-snap-v2:confinement_classic_with_interfaces
	confinement 'classic' not allowed with plugs/slots
	https://launchpad.net/bugs/1655369
codium_1.97.1.[25](https://github.com/VSCodium/vscodium/actions/runs/13312119161/job/37177884081#step:7:26)044_amd64.snap: FAIL
Error: The process '/snap/bin/review-tools.snap-review' failed with exit code 2

https://github.com/VSCodium/vscodium/actions/runs/13312119161/job/37177884081

daiyam avatar Feb 13 '25 17:02 daiyam

Just checked v1.97.1 (snap) and audio is working for me! I tested a .ogg file and the code above in the devtools. I'm curious, how did you solve it @daiyam ? Or did something change upstream? Unless running that snap connect command solved it for me despite the error or something? Can someone else that didn't run this command confirm that audio works now?

geekley avatar Feb 14 '25 16:02 geekley

No, I haven't changed anything...

daiyam avatar Feb 14 '25 17:02 daiyam

OK, I have no idea what is going on. Sometimes the audio just works, sometimes it just doesn't. I can't understand if there is any pattern, like another app (such as Godot) using audio too or something. Or that web behavior of "you have to click the page first to play audio" (doesn't seem to be the case? or at least in any consistent pattern?)

In any case it doesn't seem to be a snap permission issue. In fact, I'm not even sure anymore that is necessarily snap-specific... that would require extensive testing...

geekley avatar Feb 14 '25 18:02 geekley

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, and we'll keep it open. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Aug 14 '25 01:08 github-actions[bot]

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue, please open a new issue.

github-actions[bot] avatar Sep 14 '25 01:09 github-actions[bot]