# YT videos stuttering in firefox when OSS enabled



## Pouyoux (Aug 16, 2022)

Hello,

I'm trying to setup a desktop environment on FreeBSD 13.1 on my main PC (ryzen 5600X, RTX 3090, Asus Xonar D2X sound card). To make my sound card to work I had to drop sound support from the kernel, recompile it and install OSS with pkg ( oss-4.2.b2019_2 ). Now sound is working fine in videos with no stuttering using xfce default video player, on deezer with firefox but when I'm playing YouTube videos sound is working but picture is stuttering a lot.

The only thing that make the video lag free is to remove "oss_enable="YES"" in /etc/rc.conf but, of course, I have no sound.

Can you help me to have lag free videos in YouTube with sound enabled ?

thanks,


```
[root@freebsd ~]# pkg info |grep firefox
firefox-103.0.2,2              Web browser based on the browser portion of Mozilla
```


```
[root@freebsd ~]# cat /dev/sndstat
OSS 4.2 (b 2019/202208111648)BSD (C) 4Front Technologies 1996-2011
Kernel: FreeBSD 13.1-RELEASE-p1 GENERIC


Audio devices:
0: Asus Xonar D2X (AV200) (MultiChannel) (DUPLEX)
   Engine 1 opened INOUT by VMIX/0 @ 48000/48000 Hz Fragment: 2048/192000 (10.6 msec)
   Engine 2 opened OUT by firefox/1629 @ 48000/48000 Hz Fragment: 32768/192000 (170.6 msec)
1: Asus Xonar D2X (AV200) (SPDIF) (DUPLEX)

MIDI devices:
0: CMI8788 UART

Mixers:
0: CMedia CMI8788
1: AC97 Input Mixer (CMI9780)

History:
/dev/oss/oss_cmi878x0/pcm0.01: pid 1481 cmd 'firefox' OUT 5 underruns
/dev/oss/oss_cmi878x0/pcm0.01: pid 1481 cmd 'firefox' OUT
/dev/oss/oss_cmi878x0/pcm0.01: pid 1481 cmd 'firefox' OUT
/dev/oss/oss_cmi878x0/pcm0.02: pid 1597 cmd 'firefox' OUT
```


```
[root@freebsd ~]# ossinfo
Version info: OSS 4.2 (b 2019/202208111648) (0x00040100) BSD
Platform: FreeBSD/amd64 13.1-RELEASE-p1 FreeBSD 13.1-RELEASE-p1 GENERIC (freebsd.maizon.net)

Number of audio devices:    2
Number of audio engines:    7
Number of MIDI devices:        1
Number of mixer devices:    2

Device objects
 0: oss_cmi878x0 Asus Xonar D2X (AV200) interrupts=361584 (361584)

MIDI devices (/dev/midi*)
0: CMI8788 UART (MIDI port 1 of device object 0)

Mixer devices
 0: CMedia CMI8788 (Mixer 0 of device object 0)
 1: AC97 Input Mixer (CMI9780) (Mixer 1 of device object 0)

Audio devices
Asus Xonar D2X (AV200) (MultiChannel)  /dev/oss/oss_cmi878x0/pcm0  (device index 0)
Asus Xonar D2X (AV200) (SPDIF)    /dev/oss/oss_cmi878x0/pcm1  (device index 1)

Nodes
  /dev/dsp -> /dev/oss/oss_cmi878x0/pcm0
  /dev/dsp_in -> /dev/oss/oss_cmi878x0/pcm0
  /dev/dsp_out -> /dev/oss/oss_cmi878x0/pcm0
  /dev/dsp_ac3 -> /dev/oss/oss_cmi878x0/pcm1
  /dev/dsp_mmap -> /dev/oss/oss_cmi878x0/pcm0
  /dev/dsp_multich -> /dev/oss/oss_cmi878x0/pcm0
```


----------



## Partmedia (Nov 19, 2022)

As far as I'm aware, FreeBSD's firefox is built with PulseAudio output by default.

I had this problem myself a while ago, and I had to add an explicit fragment size to the PulseAudio OSS output sink. In /usr/local/etc/pulse/default.pa:


```
load-module module-oss device="/dev/dsp" sink_name=output fragment_size=8192
```

You may have to disable auto-drive load.


----------



## Pouyoux (Nov 19, 2022)

thanks for your answer but I get rid of the problem by replacing the sound card by an USB DAC (topping d10s).


----------

