Bug 258711 - New mixer(8) fails with virtual channels: mixer_open: /dev/dsp%d.vp%d: Invalid argument
Summary: New mixer(8) fails with virtual channels: mixer_open: /dev/dsp%d.vp%d: Invali...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Hans Petter Selasky
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2021-09-25 03:44 UTC by Jan Beich
Modified: 2021-10-12 12:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2021-09-25 03:44:38 UTC
$ mpv foo.mp3
$ sysctl hw.snd.verbose=2
$ fgrep -A3 mpv /dev/sndstat
        pcm3:play:dsp3.p0[pcm3:virtual:dsp3.vp0]: spd 48000, fmt 0x00201000/0x00200010, flags 0x1000010c, 0x00000023, pid 1585 (mpv)
        interrupts 0, underruns 0, feed 119173, ready 6912 [b:0/0/0|bs:8192/1024/8]
        channel flags=0x1000010c<RUNNING,TRIGGERED,BUSY,VIRTUAL>
        {userland} -> feeder_root(0x00201000) -> feeder_format(0x00201000 -> 0x00200010) -> feeder_volume(0x00200010) -> {hardware}

$ mixer -f /dev/dsp3.vp0
mixer: mixer_open: /dev/dsp3.vp0: Invalid argument

$ mixer.old -f /dev/dsp3.vp3
Mixer pcm      is currently set to  45:45

Real example: https://people.freebsd.org/~ariff/utils/appsmixer
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2021-09-26 17:09:38 UTC
Although the virtual channels are not fully fledged mixers, they should support the main volume at least.

@christos: Is this something you could work on?

--HPS
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2021-09-26 17:45:10 UTC
Just talked with christos@ and the issues shall be addressed soon.

Thanks for reporting Jan!

--HPS
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2021-09-28 09:26:01 UTC
FYI - new syntax is:

mixer -f /dev/dsp0.vp0 pcm.volume=0.45
mixer -f /dev/dsp0.vr0 rec.volume=0.45

--HPS
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2021-09-28 09:27:38 UTC
And new:

mixer -f /dev/dsp0.vp0 pcm.mute=0
mixer -f /dev/dsp0.vp0 rec.mute=0

--HPS
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-09-28 09:28:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3984400149a53982f1254cfaf7b73fd2acda460a

commit 3984400149a53982f1254cfaf7b73fd2acda460a
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-09-28 07:53:44 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-09-28 09:20:23 +0000

    mixer(3): Add support for controlling mixer mute and volume on feeder channels.

    PR:     258711
    Reported by:    jbeich@FreeBSD.org
    Differential Revision:  https://reviews.freebsd.org/D31636
    Sponsored by:   NVIDIA Networking

 lib/libmixer/mixer.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-09-28 09:28:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4a83ca1078e3ec70159741b51a6b48e844ada9f5

commit 4a83ca1078e3ec70159741b51a6b48e844ada9f5
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-09-28 07:41:18 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-09-28 09:20:09 +0000

    sound(4): Implement mixer mute control for feeder channels.

    PR:     258711
    Differential Revision:  https://reviews.freebsd.org/D31636
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking

 sys/dev/sound/pcm/channel.c       |  71 ++++++++++++++++++++++
 sys/dev/sound/pcm/channel.h       |   8 ++-
 sys/dev/sound/pcm/dsp.c           | 121 +++++++++++++++++++++++---------------
 sys/dev/sound/pcm/feeder_volume.c |  19 ++++--
 4 files changed, 167 insertions(+), 52 deletions(-)
Comment 7 Hans Petter Selasky freebsd_committer freebsd_triage 2021-09-28 09:30:03 UTC
Let me know if there are more issues.
Comment 8 commit-hook freebsd_committer freebsd_triage 2021-10-12 12:14:39 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1f1aa1aa96513b7385ff89f6b6f3e1501d9cea87

commit 1f1aa1aa96513b7385ff89f6b6f3e1501d9cea87
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-09-28 07:41:18 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-10-12 12:10:59 +0000

    sound(4): Implement mixer mute control for feeder channels.

    PR:     258711
    Differential Revision:  https://reviews.freebsd.org/D31636
    Sponsored by:   NVIDIA Networking

    (cherry picked from commit 4a83ca1078e3ec70159741b51a6b48e844ada9f5)

 sys/dev/sound/pcm/channel.c       |  71 ++++++++++++++++++++++
 sys/dev/sound/pcm/channel.h       |   8 ++-
 sys/dev/sound/pcm/dsp.c           | 121 +++++++++++++++++++++++---------------
 sys/dev/sound/pcm/feeder_volume.c |  19 ++++--
 4 files changed, 167 insertions(+), 52 deletions(-)