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

No audio/sound at all in snap version #2179

Open
1 task done
geekley opened this issue Dec 30, 2024 · 7 comments
Open
1 task done

No audio/sound at all in snap version #2179

geekley opened this issue Dec 30, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@geekley
Copy link

geekley commented Dec 30, 2024

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

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 geekley added the bug Something isn't working label Dec 30, 2024
@daiyam
Copy link
Member

daiyam commented Dec 30, 2024

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

@geekley
Copy link
Author

geekley commented Dec 31, 2024

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"

@Shadow1363
Copy link

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

@daiyam
Copy link
Member

daiyam commented Feb 13, 2025

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

@geekley
Copy link
Author

geekley commented Feb 14, 2025

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?

@daiyam
Copy link
Member

daiyam commented Feb 14, 2025

No, I haven't changed anything...

@geekley
Copy link
Author

geekley commented Feb 14, 2025

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants