osspd no longer works: ERR: failed to connect context, state=5 (Bad state)

Bug #1857810 reported by Leonardo Müller
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
osspd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After the upgrade to 20.04 daily, osspd no longer works. While the systemd service is starting, no program is being able to use it, giving warnings and errors when trying to use /dev/dsp. For the program that tried to play the sound, the following appears:

/dev/dsp: Input/output error

In the systemd logs of osspd, the following appears:

dez 29 10:32:42 Lenovo-ideapad-310-14ISK osspd[23849]: ossp-padsp[usuario:23849] WARN: pa_context_subscribe() failed (Bad state)
dez 29 10:32:42 Lenovo-ideapad-310-14ISK osspd[23849]: ossp-padsp[usuario:23849] WARN: failed to subscribe to context events (Bad state)
dez 29 10:32:42 Lenovo-ideapad-310-14ISK osspd[23849]: ossp-padsp[usuario:23849] ERR: failed to connect context, state=5 (Bad state)

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: osspd 1.3.2-11
ProcVersionSignature: Ubuntu 5.3.0-24.26-generic 5.3.10
Uname: Linux 5.3.0-24-generic x86_64
ApportVersion: 2.20.11-0ubuntu15
Architecture: amd64
CurrentDesktop: XFCE
Date: Sun Dec 29 10:29:47 2019
InstallationDate: Installed on 2017-06-13 (928 days ago)
InstallationMedia: Xubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
SourcePackage: osspd
UpgradeStatus: Upgraded to focal on 2019-12-22 (6 days ago)
mtime.conffile..etc.apport.crashdb.conf: 2019-08-29T08:39:36.787240

Revision history for this message
Leonardo Müller (leozinho29-eu) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in osspd (Ubuntu):
status: New → Confirmed
Revision history for this message
tlk (sarcasticskull) wrote :

Present in Ubuntu Mate 20.04

Everything is almost vanilla, no site config of anything possibly involved.
OSSPD has just been installed (rebooted).

$ ls -l /dev/dsp
crw-rw-rw- 1 root root 14, 3 May 7 17:54 /dev/dsp
$ echo asdasdafasfasdfasdf > /dev/dsp
bash: /dev/dsp: Input/output error

$ systemctl status osspd
● osspd.service - OSS Proxy Daemon
     Loaded: loaded (/lib/systemd/system/osspd.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2020-05-07 17:54:34 +05; 23min ago
       Docs: man:osspd
   Main PID: 863 (osspd)
      Tasks: 12 (limit: 9353)
     Memory: 1.6M
     CGroup: /system.slice/osspd.service
             └─863 /usr/sbin/osspd -f --dsp-slave=/usr/lib/osspd/ossp-slave

May 07 17:54:34 desktop systemd[1]: Started OSS Proxy Daemon.
May 07 17:54:34 desktop osspd[863]: osspd: OSS Proxy v1.3.2 (C) 2008-2010 by Tejun Heo <email address hidden>
May 07 17:54:34 desktop osspd[863]: osspd: Creating dsp (14:3), adsp (14:12), mixer (14:0)
May 07 17:55:47 desktop osspd[1959]: ossp-padsp[user:1959] WARN: pa_context_subscribe() failed (Bad state)
May 07 17:55:47 desktop osspd[1959]: ossp-padsp[user:1959] WARN: failed to subscribe to context events (Bad state)
May 07 17:55:47 desktop osspd[1959]: ossp-padsp[user:1959] ERR: failed to connect context, state=5 (Bad state)

Revision history for this message
Mario Di Nicola (warp99) wrote :

I have a workaround for this issue. First make sure that packages pulseaudio-utils and osspd-alsa are installed, the run update-alternatives and choose ossp-alsap as the option:

$ sudo update-alternatives --config ossp-slave

There are 2 choices for the alternative ossp-slave (providing /usr/lib/osspd/ossp-slave).

  Selection Path Priority Status
------------------------------------------------------------
  0 /usr/lib/osspd/ossp-padsp 70 auto mode
* 1 /usr/lib/osspd/ossp-alsap 60 manual mode
  2 /usr/lib/osspd/ossp-padsp 70 manual mode

Then use pulseaudio utility pasuspender in-front of your program:

$ pasuspender /path/to/your/program

Revision history for this message
Mario Di Nicola (warp99) wrote :

You may not need to run pasuspender on some machines. My ASRock 970 MB doesn't need pasuspender to work. However on my ideapad 320 the slave will not open without pasuspender.

Revision history for this message
tlk (sarcasticskull) wrote :

thx for the advice, but it doesn't work for me either

starting osspd shows

ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave

in syslog. attempting to open /dev/dsp results in a no such file (the dev file itself is there).

alsa tools such as aplay and speaker-test work fine however (through a pulse-plugin AFAIU)

Revision history for this message
Douglas Wiedemann (ventman) wrote :

Wasn't able to get this working. but found that padsp is still working for 64-bit binaries.

32-bit binaries will need the libpulsedsp:i386 package and to create a "padsp32" binary by copying the padsp in /usr/bin back as padsp32, and editing the binary to point the LD_PRELOAD to /usr/lib/i386-linux-gnu/pulseaudio/libpulsedsp.so instead of /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsedsp.so

After that, just use either padsp or padsp32 in front of the program and it should work.

Revision history for this message
Virus666 (rea-987) wrote :

This is still an ongoing issue despite the fact there has been a new Ubuntu release Ubuntu 20.10 (Groovy Gorilla).

@warp99 https://bugs.launchpad.net/ubuntu/+source/osspd/+bug/1857810/comments/4

This suggests using osspd-alsa but it's pretty much the same with alsa-oss (aoss) which causes crackling/popping noises and echoes on OSS mode of ETQW, most probably due to OSS to ALSA to PulseAudio nature of the process.

ETQW (OSS) with osspd-pulseaudio:

------ OSS Sound Initialization ------
WARNING: failed to open output sound device '/dev/dsp': Input/output error
WARNING: sound subsystem disabled
--------------------------------------

@ventman https://bugs.launchpad.net/ubuntu/+source/osspd/+bug/1857810/comments/7

Installing and utilizing libpulsedsp:i386 does make sense and indeed it returned a different warning but the result is the same, no sound on ETQW (OSS).

ETQW (OSS) with libpulsedsp:i386:

------ OSS Sound Initialization ------
opened sound device '/dev/dsp'
ioctl SNDCTL_SYSINFO failed: Invalid argument
this ioctl is only available in OpenSound.com's OSS implementation. If you run Linux kernel OSS or Alsa OSS, don't bother.
WARNING: ioctl OSS_GETVERSION failed
close sound device
WARNING: sound subsystem disabled
--------------------------------------

I am able to get sound with ALSA mode of ETQW but it has issues with microphone, therefore I need to use OSS mode of the game that seems to not working due to osspd-pulseaudio and libpulsedsp:i386 failure. Is there any progress on the issue?

Revision history for this message
Virus666 (rea-987) wrote :
Revision history for this message
Simon McVittie (smcv) wrote :

This is the same issue as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986662 and is fixed in newer versions of the Debian package.

> crackling/popping noises

On Debian, I get similar distortion with the fixed PulseAudio backend too (but at least it's usable).

Revision history for this message
dualshock3nerd (dualshock3nerd) wrote :

Can confirm that the newest patches from the Debian package fix this issue on my 20.04 machine.

Revision history for this message
Virus666 (rea-987) wrote :

I confirm that osspd-pulseaudio_1.3.2-12.2_amd64.deb and osspd_1.3.2-12.2_amd64.deb from Debian Sid fixed the issue on Ubuntu Mate 20.04.

Revision history for this message
Virus666 (rea-987) wrote (last edit ):

Greetings everyone,

I would like to inform you that although latest version of osspd-pulseaudio fixed OSS output issue on pretty much all systems and hardware I tried, sound input is problematic.

Issue:

When Enemy Territory: Quake Wars is set to use OSS; microphone hangs/breaks/jumps/jitters randomly on ALC269VC. When I test it in-game, while I pressing the voice chat button, I witnessed that voice chat icon wasn't remaining still, rather blinks despite the fact I kept pressing.

Test game, ETQW Demo 1.4:

https://cdn.splashdamage.com/downloads/games/etqw/ETQW-demo2-client-full.r1.x86.run
https://www.splashdamage.com/games/enemy-territory-quake-wars/

A) If the game fails to launch with "etqw-rthread", remove libgcc_s.so.1, libjpeg.so.62, libstdc++.so.6 from the game's directory; install libsdl1.2debian:i386, libjpeg62:i386, libstdc++6:i386

B) After launching and creating an account, quit the game. Edit ~/.etqwcl/base/etqwconfig.cfg:

seta s_driver "oss"

c) Relaunch the game with "etqw-rthread", test voice input in Settings and in-game.

Revision history for this message
Virus666 (rea-987) wrote :

Hardware:

1) Onboard Realtek ALC236 on Lenovo Yoga 500-14ISK (Intel)

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC236 Analog [ALC236 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

2) Onboard Realtek ALC269VC on Tuxedo Pulse 15 (AMD)

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Generic_1 [HD-Audio Generic], device 0: ALC269VC Analog [ALC269VC Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ ls -l /dev/dsp
crw-rw-rw- 1 root root 14, 3 Jul 28 21:31 /dev/dsp

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.