You are not logged in.
I can't get sonic-pi to start, with the server error log showing the problem is related to the jack daemon. I've run out of ideas on what to try, so am appealing to the forum.
The error message in ~/.sonic-pi/logs/server-errors.log has evolved over time as I've installed various packages. The last one is this:
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
cannot load driver module alsa
no message buffer overruns
connect(2) call to /dev/shm/jack-1001/default/jack_0 failed (err=No such file or directory)
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
cannot load driver module alsa
no message buffer overrunsI use pulseaudio, and installed the pulseaudio-jack package (not sure this is necessary, and it didn't help. I also had to install realtime-privileges (and add myself to the realtime group) and libffado. These removed other errors from the log file, but I'm still left with the last one shown above.
Edit: Solved
This isn't terribly elegant, but it works. Looking forward to the day when pulseaudio, jack, and ALSA are all replaced by pipewire. The solution was to launch jackd in a separate terminal first. For the benefit of someone using this post for debugging, here are the steps I used to find the right syntax for jackd:
[pgoetz@frog ~]$ cat /proc/asound/cards
0 [HDMI ]: HDA-Intel - HDA Intel HDMI
HDA Intel HDMI at 0xdca34000 irq 65
1 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xdca30000 irq 63
2 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0xdc080000 irq 18
3 [C525 ]: USB-Audio - HD Webcam C525
HD Webcam C525 at usb-0000:00:14.0-3.3.3, high speedMy speakers are connected to the system board audio connector, which is wired to HDA-Intel. In the parlance of ALSA, this tells me I need to be using this device: hw:1. One might also need to check for a subdevice:
[pgoetz@frog ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC1150 Analog [ALC1150 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC1150 Digital [ALC1150 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
...I tried using hw:1,1, but got no audio output from this. In the end, this command, launched in a separate terminal, worked:
$ jackd -R -d alsa -d hw:1 --period 256The period determines the latency. The lower the number, the shorter the latency. A period of 128 frames would introduce a latency of 5.8 milliseconds for 2 buffers. I tried using a period of 128, but this resulted in a large number of xruns, so stepped it back to 256.
With this jackd command running in a another terminal sonic-pi launches and has audio output.
Last edited by pgoetz (2021-01-03 16:23:41)
Offline
After experimenting with the software a bit, I'm still getting xruns and weird audio tearing using 256 frames, so dropped back to the default of 1024:
$ jackd -R -d alsa -d hw:1Offline
Thanks for this. I was able to get my sonic-pi to work following your instructions. Though I had to make a change:
jackd -R -d alsa -d hw:1 --period 4096
Even with the default 1024, I was getting xruns, so I upped it. Guess I'll have to live with the latency unless I can figure something else out.
Offline
Though I had to make a change:
jackd -R -d alsa -d hw:1 --period 4096
Even with the default 1024, I was getting xruns, so I upped it. Guess I'll have to live with the latency unless I can figure something else out.
Yeah, I'm very curious about this myself. Is it because there's a lot of other stuff going on on my desktop? Is the kernel not optimized for real time processing? Do you really need a dedicated audio card for this to work properly? I'm wondering how all of this will be impacted by pipewire, if at all.
Offline
Thank you so much, I managed to make it run thanks to this post.
Offline