Ardour 8.7 - unable to connect to audio backend

with 8.7’s way of handling the audio backend connection, there must be either something wrong, or very different, which triggers some hidden error on my system. i just cannot get it working, always ending up with an announcement “The audio backend was shutdown because: ALSA I/O error.”

just tested it with the last nightly, the situation is the same as with official 8.7 build.

ardour log says:
2024-09-26T23:11:26 [INFO]: Scanning folders for bundled LV2s: /opt/Ardour-8.7.38/lib/LV2
2024-09-26T23:11:30 [WARNING]: LV2http://ssj71.github.io/infamousPlugins/plugs.html#envfollowerCV: Port 2 (‘CV Out’) has unsupported data type.
2024-09-26T23:11:31 [INFO]: xjadeo version: 0.8.14
2024-09-26T23:11:32 [INFO]: harvid version: 901
2024-09-26T23:11:33 [INFO]: Loading menus from /opt/Ardour-8.7.38/etc/ardour.menus
2024-09-26T23:11:33 [INFO]: Cannot set I/O Priority for disk read/write thread
2024-09-26T23:11:33 [ERROR]: No MCP device info files found using /home/tomas/.config/ardour8/us2400:/opt/Ardour-8.7.38/share/us2400
2024-09-26T23:11:34 [INFO]: Loading user ui scripts file /home/tomas/.config/ardour8/ui_scripts
2024-09-26T23:11:34 [INFO]: Loading plugin order file /home/tomas/.config/ardour8/plugin_metadata/plugin_order
2024-09-26T23:11:34 [INFO]: Loading history from /home/tomas/data/audio_projects/hugo_a_zoe/all_watched_over/all_watched_over.history
2024-09-26T23:11:34 [ERROR]: AlsaAudioBackend: I/O error. Audio Process Terminated.

trying to connect with jack (which is my usual way) i’m having the same problems, plus ardour becomes unresponsive (with htop reporting the process using 100% of cpu) and has to be killed.

any ideas? thanks!

other audio software i use (renoise, pd) works fine, as does ardour 8.6 - same sessions, same hardware. arch linux, amd64 machine

What buffersize do you use?

“ALSA I/O error” could also mean a lot of consecutive dropouts (xruns).

288, 2 periods/buffer. long proven as failsafe so far…

Download https://ardour.org/files/adevices.sh

Please run Ardour with both 8.6 and 8.7. While each version is running (if possible), run adevices.sh and then paste the output

8.6

========================================
Part I: ALSA
Advanced Linux Sound Architecture Driver Version k6.6.48-rt40-arch1-2-rt-lts.

Card 0 (SB):

  • Playback Device 0 (ALC889 Analog):

    • Subdevice 0 (hw:SB,0,0):
      closed
  • Playback Device 1 (ALC889 Digital):

    • Subdevice 0 (hw:SB,1,0):
      closed
  • Recording Device 0 (ALC889 Analog):

    • Subdevice 0 (hw:SB,0,0):
      closed
  • Recording Device 2 (ALC889 Alt Analog):

    • Subdevice 0 (hw:SB,2,0):
      closed

    • Subdevice 1 (hw:SB,2,1):
      closed

Card 1 (HDMI):

  • Playback Device 3 (HDMI 0):
    • Subdevice 0 (hw:HDMI,3,0):
      closed

Card 2 (Driv):

  • Playback Device 0 (USB Audio):

    • Subdevice 0 (hw:Driv,0,0):
      closed
  • Recording Device 0 (USB Audio):

    • Subdevice 0 (hw:Driv,0,0):
      closed

Card 3 (US2400):

Card 4 (AudioFire12):

  • Playback Device 0 (AudioFire12 PCM):

    • Subdevice 0 (hw:AudioFire12,0,0):
      used by: ArdourGUI (PID 3820)
      access: MMAP_INTERLEAVED
      format: S32_LE
      subformat: STD
      channels: 12
      rate: 48000 (48000/1)
      period_size: 288
      buffer_size: 576
  • Recording Device 0 (AudioFire12 PCM):

    • Subdevice 0 (hw:AudioFire12,0,0):
      used by: ArdourGUI (PID 3820)
      access: MMAP_INTERLEAVED
      format: S32_LE
      subformat: STD
      channels: 12
      rate: 48000 (48000/1)
      period_size: 288
      buffer_size: 576

========================================
Part II: jack/pipewire
jackdmp version 1.9.22 tmpdir /dev/shm protocol 9

8.7

========================================
Part I: ALSA
Advanced Linux Sound Architecture Driver Version k6.6.48-rt40-arch1-2-rt-lts.

Card 0 (SB):
  * Playback Device 0 (ALC889 Analog):
    - Subdevice 0 (hw:SB,0,0):
      closed

  * Playback Device 1 (ALC889 Digital):
    - Subdevice 0 (hw:SB,1,0):
      closed

  * Recording Device 0 (ALC889 Analog):
    - Subdevice 0 (hw:SB,0,0):
      closed

  * Recording Device 2 (ALC889 Alt Analog):
    - Subdevice 0 (hw:SB,2,0):
      closed

    - Subdevice 1 (hw:SB,2,1):
      closed

Card 1 (HDMI):
  * Playback Device 3 (HDMI 0):
    - Subdevice 0 (hw:HDMI,3,0):
      closed

Card 2 (Driv):
  * Playback Device 0 (USB Audio):
    - Subdevice 0 (hw:Driv,0,0):
      closed

  * Recording Device 0 (USB Audio):
    - Subdevice 0 (hw:Driv,0,0):
      closed

Card 3 (US2400):

Card 4 (AudioFire12):
  * Playback Device 0 (AudioFire12 PCM):
    - Subdevice 0 (hw:AudioFire12,0,0):
      used by: ArdourGUI (PID 4242)
      access: MMAP_INTERLEAVED
      format: S32_LE
      subformat: STD
      channels: 12
      rate: 48000 (48000/1)
      period_size: 288
      buffer_size: 576

  * Recording Device 0 (AudioFire12 PCM):
    - Subdevice 0 (hw:AudioFire12,0,0):
      used by: ArdourGUI (PID 4242)
      access: MMAP_INTERLEAVED
      format: S32_LE
      subformat: STD
      channels: 12
      rate: 48000 (48000/1)
      period_size: 288
      buffer_size: 576

========================================
Part II: jack/pipewire
jackdmp version 1.9.22 tmpdir /dev/shm protocol 9

OK, that certainly clarifies that the hardware settings in use are the same for both versions.

How does the DSP load (upper right corner of main window) compare between versions?

with the actual session i’m doing these tests:
8.6 - around 10%
8.7 - currently 0% (audio is off, attempts to start it via audio/midi setup keep introducing the “The audio backend was shutdown because: ALSA I/O error.” tab

Is there anything in Menu > Window > Log?

Does using a larger buffersize help?

hmm, just found this robin’s comment here:

tried it and it seems to solve the problem. don’t know what exactly does it mean tho.

the log now says:

024-09-27T00:17:06 [INFO]: Scanning folders for bundled LV2s: /opt/Ardour-8.7.38/lib/LV2
2024-09-27T00:17:10 [WARNING]: LV2<http://ssj71.github.io/infamousPlugins/plugs.html#envfollowerCV>: Port 2 ('CV Out') has unsupported data type.
2024-09-27T00:17:11 [INFO]: xjadeo version: 0.8.14
2024-09-27T00:17:12 [INFO]: harvid version: 901
2024-09-27T00:17:13 [INFO]: Loading menus from /opt/Ardour-8.7.38/etc/ardour.menus
2024-09-27T00:17:13 [INFO]: Cannot set I/O Priority for disk read/write thread
2024-09-27T00:17:13 [ERROR]: No MCP device info files found using /home/tomas/.config/ardour8/us2400:/opt/Ardour-8.7.38/share/us2400
2024-09-27T00:17:13 [INFO]: Loading user ui scripts file /home/tomas/.config/ardour8/ui_scripts
2024-09-27T00:17:14 [INFO]: Loading plugin order file /home/tomas/.config/ardour8/plugin_metadata/plugin_order
2024-09-27T00:17:14 [INFO]: Loading history from /home/tomas/data/audio_projects/hugo_a_zoe/all_watched_over/all_watched_over.history

could the 2024-09-27T00:17:13 [INFO]: Cannot set I/O Priority for disk read/write thread line be related?

No. In the past Ardour never tried to raise I/O priority, so if that fails it’s just like old times.

However the threading is apparently a problem. The new I/O threads (when used) have an elevated scheduler priority, but still it should not be able to interfere with Audio I/O.

Possibly system or kernel specific. Thanks for bringing this issue to our attention, time to investigate further. Would you be available and willing to help with that?

sure. thanks to you too! now i have to get some sleep, tomorrow we can continue troubleshooting

OK. when you wake up there should be a nightly build of Ardour 8.7-40 (or later).

Please run it from a terminal and using an environment variable as such

ARDOUR_IO_SCHED=1 Ardour8

Then in Preferences > Performance > Disk-I/O … Disk I/O configure “all but two”.

If there are still dropouts, please try

ARDOUR_IO_SCHED=0 Ardour8

Thanks in advance.

PS. if others want to chime in and post results, those are welcome as well.


tech details:
By default Ardour uses SCHED_RR for I/O thread with a priority of 70.
Audio thread use SCHED_FIFO with a priority of 80.

The first test ARDOUR_IO_SCHED=1 also makes I/O threads use SCHED_FIFO.
and the 2nd test ARDOUR_IO_SCHED=0` changes them to use default low priority SCHED_OTHER.

I tested this here on my system and DSP load does not increase (Linux 6.1.0-0.deb11.21-amd64 #1 SMP PREEMPT_DYNAMIC)

1 Like

ok. testing nightly 8.7.42 with Disk I/O threads set to “all but two processor”. amd64 8core, arch linux, 6.10.2-rt kernel, bare alsa (no jack etc.):

  • immediate ALSA I/O error. after several attempts to reconnect i got it playing for several seconds, ardour reported heavy dsp load (30-40%), lot of xrun glitches, followed by the same error and no audio again
  • audio works normally, dsp load is still peaking surprisingly high considering how simple the session is (40%), but with no apparent audio problems, xruns etc.

Thanks for testing!

and when you set parallel disk I/O to “1 processor” DSP load goes back down to 10% (like 8.6)?

yes, exactly. had to restart ardour ofc, after that, the load for the same session is roughly where it used to be with 8.6

Interesting. I don’t understand how a low priority I/O thread can interfere with realtime audio I/O. It is certainly not the case here on 2 machines that I tried.

Just to be certain: your user has permissions to set realtime scheduling up to a priority of at least 80?

ulimit -r

should ideally return 95.

and Ardor > Menu > Window > Log does not show a warning
“AlsaAudioBackend: cannot acquire realtime permissions.”

[tomas@archstudio ~]$ ulimit -r
99

no such warning in ardour log