Starting SuperDirt -- ALSA: Cannot open PCM device alsa_pcm for playback

I'm following the installation/get started guide, and I got as far as Start Tidal | Tidal Cycles

I'm on Linux (Ubuntu Cinnamon 23.10) and I type the following in the terminal:

$ sclang

Followed by this at the SuperCollider prompt:

sc3> SuperDirt.start;

I then get the following:

-> SuperDirt
sc3> Booting server 'localhost' on address 127.0.0.1:57110.
Found 0 LADSPA plugins
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
no message buffer overruns
no message buffer overruns
no message buffer overruns
jackdmp 1.9.21
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2022 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
JackTemporaryException : now quits...
Released audio card Audio0
audio_reservation_finish
Cannot initialize driver
JackServer::Open failed with -1
Failed to open server
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
terminate called without an active exception
could not initialize audio.
Server 'localhost' exited with exit code 0.

Not sure what to do at this point, any help appreciated!

what happens if you start jack manually, before starting sclang? I use qjackctl, it's a widget where you can configure jack server settings (setup - parameters - advanced)

Also - sometimes another program is hogging the sound device, so jack can't get it. Often, that was firefox. (Although every-one, including jack and pulseaudio, going through pipewire could have fixed this?) Anyway, try this: close browser, start jack, open browser (if you need it).

I had qjackctl installed, so I launched it and tried to start the jack server.

I got the same basic error stack in the messages window, with:

ALSA: Cannot open PCM device alsa_pcm for playback

Closing all other GUI programs on my machine and trying again didn't seem to help. Is there a way I can explicitly see which programs are hogging my device? Thanks!

generally, lsof should do, but I have not used it for that.

another thought: I observe your error "Cannot open PCM device" when I have the wrong device name in qjackctl (some device that not is not connected). So try changing (it's a drop-down menu).

Thanks so much for your help so far!

Explicitly changing the audio device in the qjackctl settings seemed to help! The server seemed to start without any visible issues!

After that, running the commands I originally posted (sclang followed by SuperDirt.start;) seemed to have started the server! I see:

SuperDirt: listening to Tidal on port 57120

Thanks again!

Yup I have sound in my IDE when I CTL+ENTER on d1 $ sound "bd sn"

Resolved!