Bug 249519

Summary: www/firefox audio/virtual_oss_ctl no visible TX in the bar for dsp Ch1 for some Firefox profiles
Product: Ports & Packages Reporter: Graham Perrin <grahamperrin>
Component: Individual Port(s)Assignee: Graham Perrin <grahamperrin>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: gecko, grahamperrin
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Screenshot
none
screenshot, r366136 none

Description Graham Perrin freebsd_committer freebsd_triage 2020-09-22 04:18:58 UTC
Created attachment 218168 [details]
Screenshot

If I recall correctly, this began on my first day of using the application …
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2020-09-22 04:21:46 UTC
grahamperrin@momh167-gjp4-8570p:~ % date ; uname -v
Tue 22 Sep 2020 05:15:01 BST
FreeBSD 13.0-CURRENT #64 r365364: Sun Sep  6 01:38:18 BST 2020     root@momh167-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG 
grahamperrin@momh167-gjp4-8570p:~ % pkg info -x virtual_oss
virtual_oss-1.2.6_1
virtual_oss_ctl-1.2.1
grahamperrin@momh167-gjp4-8570p:~ % cat /dev/sndstat
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <IDT 92HD81B1X (Analog 2.0+HP/2.0)> (play/rec)
pcm2: <IDT 92HD81B1X (Analog)> (play/rec) default
Installed devices from userspace:
dsp: <Virtual OSS> (play/rec)
grahamperrin@momh167-gjp4-8570p:~ % 

----

From /usr/local/etc/rc.d/virtual_oss

name=virtual_oss
desc="Virtual OSS device manager"
rcvar=${name}_enable
start_precmd="${name}_precmd"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
virtual_oss_default_args="\
  -T /dev/sndstat \
  -S \
  -i 8 \
  -C 2 -c 2 \
  -r 48000 \
  -b 24 \
  -s 8.0ms \
  -f /dev/dsp1 \
  -c 2 \
  -d dsp \
  -t vdsp.ctl"
configs=
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2020-09-22 07:33:56 UTC
Can you explain or point in the picture where the missing bar is?
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2020-09-22 07:47:50 UTC
TX/RX is only for DSP devices. Maybe you had one more DSP device previously.
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2020-09-25 03:23:39 UTC
Interesting, thanks. 

Some days have passed (with multiple restarts of the OS) since I experimented with a USB audio device. 

Now with analogue desktop loudspeakers connected to the traditional jack socket: when I click the + button for each channel: 

* there's audible increase left and right

* 'dsp - Ch1' shows nothing (no fluctuating bar) in the app.
Comment 5 Hans Petter Selasky freebsd_committer freebsd_triage 2020-09-25 07:40:44 UTC
It sounds like the application is only feeding mono stream.

You can mirror the stream manually by adding an output monitor, which can copy the audio from Ch0 to Ch1.

-M o,<src>,<dst>,<pol>,<mute>,<amp>

-M o,0,1,0,0,0

--HPS
Comment 6 Graham Perrin freebsd_committer freebsd_triage 2020-09-26 22:45:27 UTC
Created attachment 218343 [details]
screenshot, r366136

(In reply to Hans Petter Selasky from comment #5)

> It sounds like the application is only feeding mono stream.

As in, silence from one channel? (Not so. There's an audible increase in volume when I click the plus button to the right of the TX bar that shows nothing.)

Following an OS upgrade: at one time, the symptom was no longer reproducible (see attached) …
Comment 7 Graham Perrin freebsd_committer freebsd_triage 2020-09-26 22:46:36 UTC
… now again the symptom is reproducible, whilst listening to: 

James Geary: Metaphorically speaking | TED Talk
<https://www.ted.com/talks/james_geary_metaphorically_speaking>

– with Firefox 81, media.cubeb.backend set to oss
Comment 8 Hans Petter Selasky freebsd_committer freebsd_triage 2020-09-27 07:59:49 UTC
I cannot reproduce this using the latest virtual_oss :-(
Comment 9 Graham Perrin freebsd_committer freebsd_triage 2020-10-02 09:46:49 UTC
(In reply to Hans Petter Selasky from comment #8)

FreeBSD-CURRENT, yes?
Comment 10 Graham Perrin freebsd_committer freebsd_triage 2020-10-04 04:23:42 UTC
I narrowed this down to two Firefox profiles – 'default' and 'test'.

With both profiles, the symptom (in virtual_oss_ctl) occurs in normal mode. 

With my default profile, the symptom also occurs in safe mode. 

With my test profile, the symptom does not occur in safe mode. 

--

Not reproducible with a clean (refreshed) profile with media.cubeb.backend set to oss.

--

What Firefox advanced preference (if any) might cause the symptom to occur in safe mode?
Comment 11 Mark Linimon freebsd_committer freebsd_triage 2023-07-25 18:38:41 UTC
Graham, is this PR still valid?
Comment 12 Graham Perrin 2023-07-26 21:46:35 UTC
(In reply to Mark Linimon from comment #11)

Re: comment 10, I planned four tests (two profiles, normal mode and safe mode). 

First test (default profile, normal mode), in a nutshell: 

service virtual_oss onestart

virtual_oss_ctl -f /dev/vdsp.ctl

YouTube video in Firefox. 

At a glance: 

- the Virtual OSS Control window appeared OK. 

Downsides: 

- nothing audible (internal loudspeakers, headset on USB)

- after closing virtual_oss_ctl and stopping the virtual_oss service, 
  playback in Firefox was impossible

- a restart of Firefox did not resolve the situation

- reboot -r 
  without attempting to start the virtual_oss service 
  did not resolve the situation (still, no playback in Firefox)

- a full restart of the system 
  without attempting to start the virtual_oss service 
  was enough to restore playback in Firefox.
  in Firefox (without attempting to start virtual_oss service
Comment 13 Graham Perrin 2023-07-26 21:57:54 UTC
(In reply to Graham Perrin ◐ from comment #12)

> I planned four tests

The disruptions caused by the first test were significant. 

I don't plan to reuse virtual_oss or virtual_oss_ctl. 

IIRC my past use of virtual_oss_ctl was solely for pushing beyond maximum levels, to make hearing loss more bearable (in the same way that I use an 'up-to-eleven' extension with Firefox). 

System restarts aside, audio on FreeBSD makes me feel uneasy. I don't plan to complete the other tests. Let's close this as overcome by events.