Project

General

Profile

Actions

Bug #9732

open

Pulseaudio always uses the first audio device

Added by Gary Mills almost 4 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
-
Start date:
2018-08-13
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

My system has two audio devices. This is probably a common situation these days. The first (device 0) is for the HDMI audio on a PCIE video card. The second (device 1) is the usual audio device on the motherboard. That's the one I use for a pair of speakers. Consequently, I get no sound in the speakers because pulseudio sends it to the HDMI audio channel.

My first change was to place:

AUDIODEV=/dev/sound/1

into my desktop environment by adding it to my .profile . (/dev/audio is a symlink to /dev/sound/0). Use of AUDIODEV is a standard Solaris strategy that has been inherited by illumos and OI, with fallback to /dev/audio .

Other changes are all made to the OI hipster product in oi-userland. In module-detect.c, the change merely undefines the symbol HAVE_OSS_OUTPUT, fixing bug #9655 . The first result is that the module no longer includes a function to load module-oss. This function and module are only needed for Linux or FreeBSD. module-detect still loads module-solaris as it did before.

In module-oss.c, the change sets up the correct audio device default for illumos and oi-userland, rather than the previous default that was only suitable for Linux. It also selects the correct mixer device instead of always the first one, and changes to comments to describe what it does.

In oss-util.c, the function get_device_number() now resolves a symbolic link to obtain the device number, but only does it if necessary. That's because some device names already have the device number as a trailing digit. As well, it defines the correct mixer name for illumos and oi-userland, rather than the one that works for Linux. Finally, some have the error messages have been improved to include the name of the device that caused the error.

All of these changes are make by patches to the source. New patches are attached to this bug report. You must also remove these patches:

08-oss4.patch 09-sndstat-parse.patch 10-default.patch

All of the changes from these patches are incorporated into new ones. The patch 08-oss4.patch is split into these four new patches to make manipulation easier:
08-default-pa.patch 11-oss-util.patch 14-module-oss.patch 15-oss-util-h.patch

These patches include the changes outlined in the bug report. On patch, 13-module-detect.patch, is completely new. As well, I had to change Makefile to accomodate the patch changes.

With the changes, pulseaudio produces sound in my speakers on the system described above. I also tested it on another system that had only one audio device. It worked there too, with no changes to .profile .


Files

Makefile.diff (447 Bytes) Makefile.diff Gary Mills, 2018-08-13 09:08 PM
14-module-oss.patch (15 KB) 14-module-oss.patch Gary Mills, 2018-08-13 09:08 PM
11-oss-util.patch (10.7 KB) 11-oss-util.patch Gary Mills, 2018-08-13 09:09 PM
08-default-pa.patch (444 Bytes) 08-default-pa.patch Gary Mills, 2018-08-13 09:09 PM
15-oss-util-h.patch (952 Bytes) 15-oss-util-h.patch Gary Mills, 2018-08-13 09:09 PM
13-module-detect.patch (313 Bytes) 13-module-detect.patch Gary Mills, 2018-08-13 09:10 PM
Makefile.diff (469 Bytes) Makefile.diff Gary Mills, 2019-02-04 06:58 PM
08-oss4.patch (22.8 KB) 08-oss4.patch Gary Mills, 2020-09-14 09:32 PM
13-module-detect.patch (2.6 KB) 13-module-detect.patch Gary Mills, 2020-09-14 09:32 PM
15-stdin-util.patch (2.33 KB) 15-stdin-util.patch Gary Mills, 2020-09-14 09:32 PM
16-module-gsettings.patch (1.28 KB) 16-module-gsettings.patch Gary Mills, 2020-09-14 09:32 PM
Actions

Also available in: Atom PDF