BASS_ERROR_DRIVER on Linux

Started by saga,

saga

A colleague on Kubuntu 25.10 is having issues with using the "Default" output device in BASS.

The device is initialized like this:
BASS_Init(dev, 48000, BASS_DEVICE_STEREO | BASS_DEVICE_DMIX, nullptr, nullptr);

With dev=1, the "Default" device on Linux, the call fails with BASS_ERROR_DRIVER. All of the other real hardware devices work as intended. The "Default" recording device does not produce the same error, although it doesn't seem to deliver audio from the chosen default device.

Do you have any idea what could be the issue here?

Ian @ un4seen

On Linux, BASS's "Default" device uses ALSA's "default" output. If that's failing with BASS_ERROR_DRIVER then it may be a problem in ALSA's "default" config. Is it working with the "aplay" tool, eg. "aplay -D default test.wav"? And what does "aplay -L" say about the "default" output?

saga

aplay appears to fail:

ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
aplay: main:850: audio open error: No such file or directory

Here's the list output:
null
    Discard all samples (playback) or generate zero samples (capture)
hw:CARD=Generic,DEV=3
    HD-Audio Generic, LEN T27i-10
    Direct hardware device without any conversions
hw:CARD=Generic,DEV=7
    HD-Audio Generic, LEN T27i-10
    Direct hardware device without any conversions
hw:CARD=Generic,DEV=8
    HD-Audio Generic, HDMI 2
    Direct hardware device without any conversions
plughw:CARD=Generic,DEV=3
    HD-Audio Generic, LEN T27i-10
    Hardware device with all software conversions
plughw:CARD=Generic,DEV=7
    HD-Audio Generic, LEN T27i-10
    Hardware device with all software conversions
plughw:CARD=Generic,DEV=8
    HD-Audio Generic, HDMI 2
    Hardware device with all software conversions
hdmi:CARD=Generic,DEV=0
    HD-Audio Generic, LEN T27i-10
    HDMI Audio Output
hdmi:CARD=Generic,DEV=1
    HD-Audio Generic, LEN T27i-10
    HDMI Audio Output
hdmi:CARD=Generic,DEV=2
    HD-Audio Generic, HDMI 2
    HDMI Audio Output
dmix:CARD=Generic,DEV=3
    HD-Audio Generic, LEN T27i-10
    Direct sample mixing device
dmix:CARD=Generic,DEV=7
    HD-Audio Generic, LEN T27i-10
    Direct sample mixing device
dmix:CARD=Generic,DEV=8
    HD-Audio Generic, HDMI 2
    Direct sample mixing device
hw:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    Direct hardware device without any conversions
plughw:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    Hardware device with all software conversions
default:CARD=Generic_1
    HD-Audio Generic, SN6140 Analog
    Default Audio Device
sysdefault:CARD=Generic_1
    HD-Audio Generic, SN6140 Analog
    Default Audio Device
front:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    Front output / input
surround21:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Generic_1,DEV=0
    HD-Audio Generic, SN6140 Analog
    Direct sample mixing device

Ian @ un4seen

That looks like ALSA's "default" output is configured to use the "Generic_1" device (SN6140 Analog), but it's unable to do so. I guess they get the same error message when using "-D Generic_1" with aplay?

ALSA's default device can be set in the /etc/asound.conf file:

    www.alsa-project.org/main/index.php/Setting_the_default_device

saga

Quote from: Ian @ un4seenThat looks like ALSA's "default" output is configured to use the "Generic_1" device (SN6140 Analog), but it's unable to do so. I guess they get the same error message when using "-D Generic_1" with aplay?

The result is slightly different:
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM Generic_1
aplay: main:850: audio open error: No such file or directory

Ian @ un4seen

Oh right, you probably can't use the card ID ("Generic_1") by itself. Try "hw:CARD=Generic_1" or "dmix:CARD=Generic_1".

saga

Two different results! ;D

With hw:
aplay: main:850: audio open error: Device or resource busy
And with dmix:
Playing WAVE './Downloads/speaker_test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1387: Sample format non available
Available formats:
- S32_LE

Ian @ un4seen

Ah. It looks like the device is already being used with "dmix", so any other users need to go through dmix too. I believe dmix requires a hardware device, ie. "dmix:default" won't work. So you would need to use the real device number and BASS_DEVICE_DMIX flag in your BASS_Init call, and then it should work.

saga

Yep, that does indeed work. We usually recommend people to just stick with the Default device though, as usually even with the DMIX flag provided, it appears that BASS audio will only work with the non-Default devices if no other app is using them. Do you have any idea what might have changed here that it's basically the other way around compared to how it used to be?

Ian @ un4seen

Because it won't work, BASS_Init ignores the BASS_DEVICE_DMIX flag on any non-hardware device (any not beginning with "hw:"). I believe that has always been the case, so you shouldn't see any difference in this compared to older versions. Are you definitely seeing a difference if you swap out the libbass.so file for an older version?

saga

#10
Ok, that was maybe a bit poorly worded. I didn't mean how it used to be in an older BASS version (those behave the same indeed), but I was worried that something changed in Ubuntu 25.10 that would make the Default device unusable in BASS - and since that is what 99% of our users will use for output, it would be quite a regression that I would hope BASS could somehow work around. However, we apparently have two more machines on Ubuntu 25.10 where the problem does not appear. That being said - I know it has been asked multiple times in the past, but can you please consider adding support for a modern multi-client audio API for BASS Linux builds? Pipewire seems to be pretty common now, so it might be worth focussing on just that.

Ian @ un4seen

The underlying cause of the problem in this case is that neither Pipewire or PulseAudio is running. They allow multiple apps to use the output device at the same time (without dmix), and will appear in BASS's and aplay's device lists when available, as well as being the "default" output option. Ubuntu (and probably pretty much all other Linux distros) usually comes with one or the other installed, so I guess they were uninstalled or disabled in this particular case?

saga

That's the weird part: it doesn't look like either of them is missing / uninstalled:

***@***:~$ pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 2574
Tile Size: 65472
User Name: ***
Host Name: ***
Server Name: PulseAudio (on PipeWire 1.4.7)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_65_00.6.analog-stereo
Default Source: alsa_input.pci-0000_65_00.6.analog-stereo
Cookie: 3917:6462

***@***:~$ systemctl --user status pipewire.service
● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; enabled; preset: enabled)
     Active: active (running) since Tue 2026-03-31 15:07:07 CEST; 4min 44s ago
 Invocation: a22009de58a64d18abe4f6b4673585ce
TriggeredBy: ● pipewire.socket
   Main PID: 2524 (pipewire)
      Tasks: 3 (limit: 75841)
     Memory: 8.9M (peak: 12.5M)
        CPU: 251ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─2524 /usr/bin/pipewire

mar 31 15:07:07 *** systemd[2457]: Started pipewire.service - PipeWire Multimedia Service.

Ian @ un4seen

Is the pipewire-alsa package also installed?

saga

Well well well. Turns out that indeed, for some reason the pipewire-alsa package was missing. Installing that fixes the issue. However, I just set up a fresh Kubuntu 25.10 installation in a VM and indeed this package is not (or no longer) installed by default - but audio output via the Default device in BASS still works regardless. Odd!

Ian @ un4seen

I just checked this myself. pipewire-alsa is still installed by default with Ubuntu 25.10, but indeed not with Kubuntu 25.10 for some reason.

I'll look into the possibility of BASS using Pipewire directly (instead of going through ALSA), which would avoid this issue.

saga

That would be great. Let me know if you have something to test, I have a few people that can try it out in our company.