Bug 237472 - emulators/virtualbox-ose: fix "no sound"
Summary: emulators/virtualbox-ose: fix "no sound"
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Virtualbox Team (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-22 14:16 UTC by Martin Birgmeier
Modified: 2021-03-15 19:35 UTC (History)
10 users (show)

See Also:
rkoberman: maintainer-feedback-


Attachments
port option changes to enable PULSEAUDIO (6.33 KB, patch)
2019-04-22 14:16 UTC, Martin Birgmeier
no flags Details | Diff
Path to make OS audio work (1.23 KB, patch)
2020-08-01 05:18 UTC, rkoberman
rkoberman: maintainer-approval? (multimedia)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2019-04-22 14:16:44 UTC
Created attachment 203898 [details]
port option changes to enable PULSEAUDIO

I have not had working sound in VirtualBox for a long time.

Scenario:
- Host OS: FreeBSD 12.0-RELEASE-p3 #6 r343805M
- Host HW: Core i7 2630QM, Conexant CX20590
- x11/kde5 installed, all ports latest
- Various client machines (Win 10, FreeBSD 12 & 13, openSUSE, Debian, CentOS,...)
- Today I recompiled all ports with PULSEAUDIO enabled (where it was off before), to be exact the following: kde5-5.15.4.19.04.0 virtualbox-ose-5.2.26_4 alsa-plugins-1.1.1_4 kmix-19.04.0 openal-soft-1.19.1_2 ffmpeg-4.1.3_2,1 mplayer-1.3.0.20190329_1 mpv-0.29.1_6,1 phonon-qt5-4.10.2_3 qt5-multimedia-5.12.2 QtAV-1.12.0_7 speech-dispatcher-0.8.8 espeak-1.48.04_6 libao-1.2.0_4 sdl-1.2.15_13,2 sdl2-2.0.9_2 vlc-3.0.6_12,4 freerdp-2.0.0.r4_2 plasma5-plasma-desktop-5.15.4_1 plasma5-plasma-5.15.4 qt5-webengine-5.12.2 (precise list of changes attached)
- VirtualBox now supports Pulseaudio, Alsa, and OSS

Result:
- Sound in the VM basically never works
- Tried with OSS, Alsa, and Pulseaudio backends
- Today, and only once, sound worked haltingly in openSUSE Leap 15.0 when using Pulseaudio (now it does not anymore)

Note:
- Sound from native applications works without problem
- A few years ago, sound did work. I believe the last VirtualBox version where it was working was something like 4.0.8.

Just curious:
- Since enabling PULSEAUDIO (see above) I now have two audio volume mixers in my panel. Can anybody explain what is going on?
- Does anybody have sound working in VirtualBox clients? If yes, what magic are you using?

-- Martin
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2019-04-28 22:17:27 UTC
See bug 233301 – emulators/virtualbox-ose - multimedia issues on 13-current
Comment 2 Martin Birgmeier 2019-04-29 15:46:49 UTC
(In reply to Graham Perrin from comment #1)

Thank you, yes I have seen that PR.

For me not even pulseaudio works (except for exactly one time), and I did switch to it in the VM config.

-- Martin
Comment 3 Mario Lobo 2020-07-11 15:23:30 UTC
Please see if

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233301

applies to you.
Comment 4 Martin Birgmeier 2020-07-11 18:51:26 UTC
I applied the patch in comment #19 of bug #233301 and indeed audio output now works using OSS.

I have yet to get audio input working as well. Should that also work using OSS, or do I need pulseaudio on the host for it to work?

-- Martin
Comment 5 Martin Birgmeier 2020-07-12 07:26:33 UTC
Update: In a Windows 10 client audio input is working as well. It is not yet working in openSUSE Tumbleweed and Leap clients.

So indeed the patch in bug #233301 seems to solve this longstanding issue with the OSS audio backend not working.

-- Martin
Comment 6 Martin Birgmeier 2020-07-12 08:28:35 UTC
O.k. so openSUSE Tumbleweed and Leap 15.1 clients microphone input works using an emulated audio device of "ICH AC97" but not "HDA".

Windows 10 works with "HDA"

-- Martin
Comment 7 rkoberman 2020-08-01 05:18:52 UTC
Created attachment 216925 [details]
Path to make OS audio work

This patch from bug #233301 fixed OSS audio. It does not fix pulseaudio, but makes plain old OSS work. Just drop it into the files folder and build the port. Several people, including myself, have reported that it fixed the rather old problem with OSS audio. Thanks to ruan@mail.univ.kiev.ua for writing the patch which was closed  as "overcome by events" since the real problem was fixed by the recent update to the port, but not the OSS problem.
Comment 8 rkoberman 2020-08-20 22:54:09 UTC
This has been awaiting action with multiple reports that it fixes OSS audio.
I believe ti not qualifies for commit as maintainer timeout. Could someone please commit?
Comment 9 Graham Perrin freebsd_committer freebsd_triage 2020-10-14 06:55:44 UTC
If there's uncertainty about the patch for OSS, then as an interim measure can we (please) have the PulseAudio option available in emulators/virtualbox-ose in ports? 

Thanks

----

Building one's own with the PulseAudio option can take so long, it's a real drag …

[11:03:02] [01] [00:00:00] Building devel/llvm90 | llvm90-9.0.1_2
load: 1.46  cmd: sh 50573 [vlruwk] 288.93r 0.00u 7.25s 3% 4608k
mi_switch+0xc1 sleepq_timedwait+0x2f _sleep+0x1ab vn_alloc_hard+0x2a2 getnewvnode_reserve+0x8c zfs_zget+0x1f zfs_dirent_lookup+0x169 zfs_dirlook+0x80 zfs_lookup+0x440 zfs_freebsd_cachedlookup+0x6b vfs_cache_lookup+0xb4 lookup+0x6cc namei+0x5c1 kern_statat+0xe7 sys_fstatat+0x2f amd64_syscall+0x10c fast_syscall_common+0xf8 
[head-default] [2020-10-13_17h49m15s] [parallel_build:] Queued: 267 Built: 176 Failed: 0   Skipped: 0   Ignored: 0   Tobuild: 91   Time: 13:37:14
        [01]: devel/llvm90              | llvm90-9.0.1_2            build           (01:10:30 / 02:35:06)
        [02]: devel/llvm10              | llvm10-10.0.1_1           build           (10:22:14 / 12:00:59)
        [03]: lang/rust                 | rust-1.47.0               build           (08:24:17 / 08:32:53)
[13:38:08] Logs: /usr/local/poudriere/data/logs/bulk/head-default/2020-10-13_17h49m15s
^C[13:39:20] Error: Signal SIGINT caught, cleaning up and exiting
[13:39:20] Cleaning up
[13:40:03] Unmounting file systems
root@momh167-gjp4-8570p:~ #
Comment 10 Ivan Rozhuk 2020-12-23 06:00:07 UTC
OSS now works for me.
Comment 11 robert.ayrapetyan 2021-02-23 03:53:40 UTC
Could this patch be finally merged? Thanks.
Comment 12 robert.ayrapetyan 2021-02-23 05:34:52 UTC
However sorry, nevermind, the only way sound works for me in the Ubuntu Guest is: 

Host: enabled PulseAudio + [Intel HD Audio or ICH AC97] selected
Guest: installed and running PulseAudio
Comment 13 robert.ayrapetyan 2021-03-11 02:42:38 UTC
UPD: finally, default OSS driver works right away in 6.1.18 appeared today in FreeBSD ports!
Comment 14 commit-hook freebsd_committer freebsd_triage 2021-03-14 21:45:05 UTC
A commit references this bug:

Author: madpilot
Date: Sun Mar 14 21:44:14 UTC 2021
New revision: 568418
URL: https://svnweb.freebsd.org/changeset/ports/568418

Log:
  Add patch to fix OSS audio to virtualbox-ose-legacy

  PR:		237472
  Submitted by:	Martin Birgmeier <d8zNeCFG@aon.at>

Changes:
  head/emulators/virtualbox-ose-legacy/Makefile
  head/emulators/virtualbox-ose-legacy/files/patch-src_VBox_Devices_Audio_DrvHostOSSAudio.cpp
Comment 15 Guido Falsi freebsd_committer freebsd_triage 2021-03-15 19:35:35 UTC
Patch committed.

Thanks!