processing-sound icon indicating copy to clipboard operation
processing-sound copied to clipboard

No sound on Linux distributions using pavucontrol

Open liquidev opened this issue 7 years ago • 11 comments

When I try to play a sound file, there's no sound at all. pavucontrol doesn't list my sketch as an audio source.

  • OS: Ubuntu 18.10
  • Processing: 3.4

liquidev avatar Nov 15 '18 17:11 liquidev

Same issue here:

  • OS: Archlinux
  • Processing 3.5.3

Uninstalling pavucontrol and its dependencies causes the program to have sound again, however the sound is distorted. The sound seems to be stuttering and it takes more time for the sample to be fully played out in Processing than using mplayer (about twice as long). Uninstalling pulseaudio (since it sometimes conflicts with direct ALSA usage) neither improves nor makes the situation worse.

import processing.sound.*;

SoundFile soundFile;

void setup() {
  size(800, 600);
  soundFile = new SoundFile(this, "dump_truck.wav");
  soundFile.play();
}

void draw() {
}

Sound sample taken from: http://soundbible.com/1909-Dump-Truck.html Converted from mp3 to wav using: ffmpeg -i Dump_Truck-Mike_Koenig.mp3 dump_truck.wav Using mplayer on dump_truck.wav yields the expected sound.

Removing the draw() function also causes Processing to be silent. Although this function is present in the reference docs it is not stated in the text that it is necessary to overwrite it.

Edit: The uninstalled packages (along with pavucontrol) are:

  • atkmm-2.28.0-1
  • cairomm-1.12.2-3
  • glibmm-2.60.0-1
  • gtkmm3-3.24.1-1
  • libsigc++-2.10.1-1
  • pangomm-2.42.0-1
  • pavucontrol-1:4.0-1

WysokiStudent avatar May 04 '19 20:05 WysokiStudent

why is there still not a solution to this?!

cybergrunge-ops avatar Sep 05 '21 14:09 cybergrunge-ops

Same issue here? No error, no indication of failure. Upon opening Catia (which shows connections, sources, etc in ALSA) it is not even there. Like the program does not exist, or at least, does not play sound. Hope this helps! :)

robog-two avatar Sep 02 '22 02:09 robog-two

haha just kidding, it actually does show up, and connects properly to the respective output channels (pictured) yet there is still no sound. (Using SimplePlayback example) image

robog-two avatar Sep 02 '22 02:09 robog-two

@robog-two could you try calling Sound.list() and copy-pasting the output of the sketch here? I wonder if the problem is that the virtual interface provides a lot of channels, and the output is simply sent to the wrong channel. You could also try selecting the correct output device using the outputDevice() method, maybe ALSA isn't selected as the default.

Also, are you using pavucontrol or is this a general ALSA problem?

kevinstadler avatar Sep 04 '22 20:09 kevinstadler

image

  1. no dice with outputDevice(), though there is an audible pop on the speakers from device 1 (working? sort of?) And that was using the sin oscillator SinOsc sin = new SinOsc(this); sin.play(200, 0.2); sin = new SinOsc(this); sin.play(205, 0.2);

  2. Pavucontrol is sort of... not the problem. Pavucontrol is actually just the GUI frontend for configuring PulseAudio, and, I actually don't use pulse at all - though I believe it is emulated by PipeWire (and probably that is what Processing is connected to). Catia is actually an interface for the JACK audio subsystem which is why it only shows information gathered from ALSA through JACK. Welcome to linux audio. 💩

Also, seeing as this issue is from 2018 - it is likely a pulse issue since PipeWire wasn't the default in Ubuntu & derivatives until last year, and its emulation is often less buggy than pulse itself, as crazy as that sounds.

  1. From my investigation with Catia (manually forcing the outputs to speakers) audio does not play from any of the outputs it exposed.

robog-two avatar Sep 04 '22 21:09 robog-two

woah no way, I actually DID have pavucontrol installed? anyways, uninstalled it, same issue listed above

Uninstalling pavucontrol and its dependencies causes the program to have sound again, however the sound is distorted. The sound seems to be stuttering and it takes more time for the sample to be fully played out in Processing than using mplayer (about twice as long).

robog-two avatar Sep 04 '22 21:09 robog-two

this is the strangest thing I have ever experienced

robog-two avatar Sep 04 '22 21:09 robog-two

And now sound is gone again when trying the SimplePlayback example, and again again when going back to the sine oscillator.

robog-two avatar Sep 04 '22 21:09 robog-two

So the current state is no sound at all, or distorted sound?

kevinstadler avatar Sep 06 '22 12:09 kevinstadler

Yes, and apparently shifting between the two at random. I wonder if installing or uninstalling pavucontrol restarts a service that may be freeing memory (?) or something similar, thus creating a temporary fix.

robog-two avatar Sep 06 '22 12:09 robog-two