Re: Firefox and stuttering USB audio

2022-08-09 Thread Courtney
THANK YOU!! This seems to have solved the issue. Thankfully I had 
already set

/tmp to be an in-memory filesystem so this will do wonders. I'm assuming
you haven't had any issues with the firefox cache being blown away every
reboot? Doesn't really matter anyway, I prefer good audio over firefox 
having

a clean cache every time. Now I can listen to my music while I work and not
have to cringe ;)

On 8/7/22 14:44, Mihai Popescu wrote:

Courtney, I will try to suggest something.

First, I was having problems in the past with Firefox. I use to let
mpv play in the background ( a stream of internet radio) and the sound
has stuttering and pauses whenever Firefox loaded some pages. I was
told to use sndio for mpv as an option with ao=sndio in the mpv.conf.
I did this and the problem was gone.

Next, you could try something just to check. It is a shoot in the
dark, but I use it for something else.
I have an old computer, and the browsing was very slow. The disk (
mechanical) was spinning like hell whenever a page was loaded, both
Firefox and Chromium. Looking on internet, I found that browsers are
using caching on the disk a lot. I see you are using SSD, but here it
is anyway;

Do a backup:
# cp /etc/fstab /etc/fstab.install

Change the entry for the /tmp partition to look like this:
swap /tmp mfs rw,nodev,nosuid,-s=1g 0 0

Reboot in single user mode, using -s at boot prompt and do this on the shell:
# mount -uw /
#chmod 1777 /tmp
# reboot

Let it boot normally and issue this inside a terminal:
$ XDG_CACHE_HOME=/tmp firefox

Then do your job with sound and check for stuttering. If it is fine
now, use it like this. If not, just reverse the fstab backup and try
something else. Please report here, too :).





Re: Firefox and stuttering USB audio

2022-08-07 Thread Mihai Popescu
Courtney, I will try to suggest something.

First, I was having problems in the past with Firefox. I use to let
mpv play in the background ( a stream of internet radio) and the sound
has stuttering and pauses whenever Firefox loaded some pages. I was
told to use sndio for mpv as an option with ao=sndio in the mpv.conf.
I did this and the problem was gone.

Next, you could try something just to check. It is a shoot in the
dark, but I use it for something else.
I have an old computer, and the browsing was very slow. The disk (
mechanical) was spinning like hell whenever a page was loaded, both
Firefox and Chromium. Looking on internet, I found that browsers are
using caching on the disk a lot. I see you are using SSD, but here it
is anyway;

Do a backup:
# cp /etc/fstab /etc/fstab.install

Change the entry for the /tmp partition to look like this:
swap /tmp mfs rw,nodev,nosuid,-s=1g 0 0

Reboot in single user mode, using -s at boot prompt and do this on the shell:
# mount -uw /
#chmod 1777 /tmp
# reboot

Let it boot normally and issue this inside a terminal:
$ XDG_CACHE_HOME=/tmp firefox

Then do your job with sound and check for stuttering. If it is fine
now, use it like this. If not, just reverse the fstab backup and try
something else. Please report here, too :).



Re: Firefox and stuttering USB audio

2022-08-02 Thread Courtney

Hi Alexandre,

I did your test, I don't see a pause cycle when I have firefox play a video.
I do get those messages every time there is an audio glitch. At some times
with chromium open I will get far fewer of these messages but no interrupt.
When I say far fewer, I mean I could maybe get 1 of those messages at any
given time but no interruption. With Firefox, all these outputs are from me
opening sites in a couple tabs. This is the output I get when I run audio in
firefox from start to stop:


snd1 pst=ini: device started
snd1 pst=run: started
firefox0 vol=127,pst=rdy: attached at -7680 + 0/480
firefox0 vol=127,pst=rdy: set weight: 8388608/8388608
snd1 pst=run: play hw xrun, pused = 6240/7680
snd1 pst=run: play hw xrun, pused = 6720/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 6240/7680
snd1 pst=run: play hw xrun, pused = 6720/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 6720/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 6240/7680
snd1 pst=run: play hw xrun, pused = 6720/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 6240/7680
snd1 pst=run: play hw xrun, pused = 6720/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 6720/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 6240/7680
snd1 pst=run: play hw xrun, pused = 6720/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
snd1 pst=run: play hw xrun, pused = 6720/7680
snd1 pst=run: play hw xrun, pused = 7200/7680
firefox0 vol=127,pst=run,rmsg,widl: STOP message
firefox0 vol=127,pst=run: stopping
firefox0 vol=127,pst=ini,rmsg,widl: stopped

So the behavior is the same whether I play audio IN Firefox or
outside of Firefox. any opening of tabs or doing something from within
a website that may require loading data will cause any audio
to stutter. Sometimes even simply having firefox running in the background
will create these messages. Like now, I have Clementine running
but from time to time I will get a glitch and get 2-3 of those messages.
The interval is pretty inconsistent.

On 7/31/22 00:34, Alexandre Ratchov wrote:

On Sat, Jul 30, 2022 at 02:39:08PM -0700, Courtney wrote:

I hope it isn't in bad etiquette to resurrect an old piece of mail.


OK for me, your mail is attached to the thread.


Since May I mitigated the stuttering audio issue with Firefox running
by using Firefox ESR 91. Clearly something beyond 91 added something
that doesn't jive well with OpenBSD. Now that 91 ESR is gone and it is 102
the issue has returned.

I have been playing around with a different issue, but in the process
of messing with that issue I came across something. I ran sndiod in
debug mode with these flags:

sndiod -dd -f rsnd/0 -F rsnd/1

I then went to try out opening tabs in firefox which then triggered
a whole bunch of this getting spat out

snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680

I'm wondering if someone has more of a clue as to what all
this means.

This confirms that sndiod woke up too late, probably because another
process is using the CPU. The fraction is the portion of the buffer
containing samples. For the play direction, we see that the buffer is
not entierly full, but there are enough samples to continue playing
smoothly. So these are just warnings, there are no underruns at sndiod
level.

I'd suggest you quickly check if there are underruns at firefox level:
Use "-ddd" sndiod options. Whenever firefox underruns, sndiod will
log:

firefox0 vol=127,pst=run: xrun, pause cycle

Is there a new message every time you hear a glitch?

(note that certain programs just stop providing data to sndiod in
order to pause, which will flood you with above messages, but it is
not a problem)




Re: Firefox and stuttering USB audio

2022-07-31 Thread Alexandre Ratchov
On Sat, Jul 30, 2022 at 02:39:08PM -0700, Courtney wrote:
> I hope it isn't in bad etiquette to resurrect an old piece of mail.
> 

OK for me, your mail is attached to the thread.

> Since May I mitigated the stuttering audio issue with Firefox running
> by using Firefox ESR 91. Clearly something beyond 91 added something
> that doesn't jive well with OpenBSD. Now that 91 ESR is gone and it is 102
> the issue has returned.
> 
> I have been playing around with a different issue, but in the process
> of messing with that issue I came across something. I ran sndiod in
> debug mode with these flags:
> 
> sndiod -dd -f rsnd/0 -F rsnd/1
> 
> I then went to try out opening tabs in firefox which then triggered
> a whole bunch of this getting spat out
> 
> snd1: rec hw xrun, rused = 1440/7680
> snd1: play hw xrun, pused = 6240/7680
> snd1: rec hw xrun, rused = 960/7680
> snd1: play hw xrun, pused = 6720/7680
> snd1: rec hw xrun, rused = 480/7680
> snd1: play hw xrun, pused = 7200/7680
> snd1: rec hw xrun, rused = 960/7680
> snd1: play hw xrun, pused = 6720/7680
> snd1: rec hw xrun, rused = 480/7680
> snd1: play hw xrun, pused = 7200/7680
> snd1: rec hw xrun, rused = 1440/7680
> snd1: play hw xrun, pused = 6240/7680
> snd1: rec hw xrun, rused = 960/7680
> snd1: play hw xrun, pused = 6720/7680
> snd1: rec hw xrun, rused = 480/7680
> snd1: play hw xrun, pused = 7200/7680
> snd1: rec hw xrun, rused = 960/7680
> snd1: play hw xrun, pused = 6720/7680
> snd1: rec hw xrun, rused = 480/7680
> snd1: play hw xrun, pused = 7200/7680
> snd1: rec hw xrun, rused = 1440/7680
> snd1: play hw xrun, pused = 6240/7680
> snd1: rec hw xrun, rused = 960/7680
> snd1: play hw xrun, pused = 6720/7680
> snd1: rec hw xrun, rused = 480/7680
> snd1: play hw xrun, pused = 7200/7680
> snd1: rec hw xrun, rused = 960/7680
> snd1: play hw xrun, pused = 6720/7680
> snd1: rec hw xrun, rused = 480/7680
> snd1: play hw xrun, pused = 7200/7680
> 
> I'm wondering if someone has more of a clue as to what all
> this means.

This confirms that sndiod woke up too late, probably because another
process is using the CPU. The fraction is the portion of the buffer
containing samples. For the play direction, we see that the buffer is
not entierly full, but there are enough samples to continue playing
smoothly. So these are just warnings, there are no underruns at sndiod
level.

I'd suggest you quickly check if there are underruns at firefox level:
Use "-ddd" sndiod options. Whenever firefox underruns, sndiod will
log:

firefox0 vol=127,pst=run: xrun, pause cycle

Is there a new message every time you hear a glitch?

(note that certain programs just stop providing data to sndiod in
order to pause, which will flood you with above messages, but it is
not a problem)



Re: Firefox and stuttering USB audio

2022-07-30 Thread Courtney

I hope it isn't in bad etiquette to resurrect an old piece of mail.

Since May I mitigated the stuttering audio issue with Firefox running
by using Firefox ESR 91. Clearly something beyond 91 added something
that doesn't jive well with OpenBSD. Now that 91 ESR is gone and it is 102
the issue has returned.

I have been playing around with a different issue, but in the process
of messing with that issue I came across something. I ran sndiod in
debug mode with these flags:

sndiod -dd -f rsnd/0 -F rsnd/1

I then went to try out opening tabs in firefox which then triggered
a whole bunch of this getting spat out

snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680

I'm wondering if someone has more of a clue as to what all
this means.

On 5/26/22 05:25, Peter Fröhlich wrote:

Just FYI, when I updated from a smooth 7.0 to 7.1 about a week ago, I
started experiencing audio/video stuttering that I did not before. I
am unclear on what exactly the problem is, whether it's the kernel, a
driver, Firefox, etc. I just know that I went from a "no audio/video
issues whatsoever" X230 to a "I get about 20 seconds before the next
stutter will happen" X230. :-/

On Fri, May 6, 2022 at 9:31 AM Courtney  wrote:

Hello all,

First time on the mailing list, please forgive me if I am missing any
"netiquette". I've been using OpenBSD on my desktop these last few
weeks. I have been trying to solve an issue with Only Firefox causing
stuttering issues with my audio output. Some things I have tried are:

* Setting dom.ipc.processCount to a lower number in about:config
* Muddled with sndiod -b and -z flags
* Set softdep,noatime for my different partitions in fstab (NVMe drive)
* Tried with/without SMT (Intel 10700k)
* Set some sysctl flags:

kern.shminfo.shmall=3145728
kern.shminfo.shmmax=2147483647
kern.shminfo.shmmni=2048
kern.shminfo.shmseg=2048
kern.seminfo.semmns=4096
kern.seminfo.semmni=2048
kern.maxproc=32768
kern.maxfiles=65535
kern.bufcachepercent=80
kern.maxvnodes=32
kern.somaxconn=4096

It would seem some things might work at first and pretty quickly I
would realize none of these things worked. The only solution has
been to not use Firefox. Tried chromium but it saddens me to see
that keepassxc-proxy & u2f doesn't work there.

Seems there's quite a few play errors:

# audioctl -f /dev/audioctl1 play.{bytes,errors}
play.bytes=242641680
play.errors=130560

play.errors does not go up when firefox is closed. According to the faq
it seems it could mean that the device has underrun samples. Whatever
that means, I'm unsure how to fix it. This has been a big headache for
me and I'm hoping someone could guide me to a solution here.

My DAC is a FiiO E10k
Running -current branch

$ uname -a
OpenBSD towerDefense 7.1 GENERIC.MP#492 amd64

I'm on the latest firefox (100.0)

Audio device is rsnd/1
Here is my system's dmesg below:

OpenBSD 7.1-current (GENERIC.MP) #492: Tue May  3 08:40:53 MDT 2022
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 34261110784 (32673MB)
avail mem = 33205428224 (31667MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.2 @ 0x7eb5a000 (94 entries)
bios0: vendor American Megatrends Inc. version "A.A0" date 10/22/2021
bios0: Micro-Star International Co., Ltd. MS-7C75
acpi0 at bios0: ACPI 6.2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP MCFG SSDT SSDT FIDT SSDT SSDT HPET APIC SSDT
SSDT NHLT LPIT SSDT SSDT DBGP DBG2 SSDT VFCT TPM2 WSMT FPDT BGRT
acpi0: wakeup devices PEG2(S4) PEGP(S4) PEG3(S4) PEGP(S4) PEGP(S4)
PEG1(S4) PEGP(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4)
RP04(S4) PXSX(S4) RP05(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0
acpimcfg0: addr 0xe000, bus 0-255
acpihpet0 at acpi0: 2399 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) 

Re: Firefox and stuttering USB audio

2022-06-04 Thread Courtney

TFW your software is so complicated it might as well be proprietary.
I'll be sticking with Firefox ESR for now and hope by the time the time
the ESR version bumps this will be resolved. Otherwise I'll have to
play the worlds smallest violin. ESR doesn't have the issue.

On 6/1/22 16:02, Raul Miller wrote:

On Wed, Jun 1, 2022 at 6:13 PM Mihai Popescu  wrote:

I am not able to understand why a simple application like mpv for
example is able to play videos and streams at high resolutions with
good performance, but a "browser" needs 10 times the CPU cores and
memory and it still does it wrong enough to annoy users.

If you look at the build details for chromium:

It's layers and layers of indirection where no one really understands
how the browser works.





Re: Firefox and stuttering USB audio

2022-06-01 Thread Raul Miller
On Wed, Jun 1, 2022 at 6:13 PM Mihai Popescu  wrote:
> I am not able to understand why a simple application like mpv for
> example is able to play videos and streams at high resolutions with
> good performance, but a "browser" needs 10 times the CPU cores and
> memory and it still does it wrong enough to annoy users.

If you look at the build details for chromium:

It's layers and layers of indirection where no one really understands
how the browser works.

-- 
Raul



Re: Firefox and stuttering USB audio

2022-06-01 Thread Mihai Popescu
The idea of changing the OS implementation in order to suit an
internet browser is hilarious at least. The browsers developers are
not interested in proper implementation and inbreed of browser with OS
internals, no! All that matters is to make something work for the
browser itself.

I am not able to understand why a simple application like mpv for
example is able to play videos and streams at high resolutions with
good performance, but a "browser" needs 10 times the CPU cores and
memory and it still does it wrong enough to annoy users.

So use what you have. I enabled mfs file system. See the list for details.



Re: Firefox and stuttering USB audio

2022-06-01 Thread Geoff Steckel




On 6/1/22 4:34 PM, Courtney wrote:

I have not found it to be an issue with the number of tabs being
open, but rather anything that spikes the processor causing these
interruptions. Oddly, even on my 8 core box, just having 1 or 2
cores spiking to 100% (which FF does on demanding sites) causes
these interruptions the most. I have also simply had firefox idling
with one tab open on the new tab page causing these interruptions
sometimes even. I have a buddy using Arch Linux and said even now
with newer versions of ff he's been having some strange behavior
too.


When audio stutters on my machines I can hear the disk drive rattling.
All machines have at least 4 CPUs and sufficient memory.

Adding nice(1) to the program playing helps but
doesn't eliminate the problem.
When sndiod gets in the way things are worse.
Adding nice to it helps but again doesn't eliminate the problem.

Moving the mouse on a slower system causes stuttering.
I haven't paid attention when X isn't running.

Firefox, Chrome, Thunderbird etc. constantly execute syscalls
and very frequently do disk I/O.

I -suspect- that some lock blocks the CPU playing the audio
when other programs execute syscalls.
dt/bt probably could test this but I haven't studied them yet
nor have I studied kernel locking in any detail (big and subtle area).

I have also seen pretty certain disk I/O delays when audio is
playing and other programs compete.
The BSDs have CPU priority scheduling.
I don't think any have I/O priority scheduling.
That problem isn't simple.

Ubuntu linux successfully runs mixxx which plays & records
multichannel audio in real time with no stutteron a 1.6 GHz Celeron.
even through [adjectives deleted] pulseaudio.
This is while OBS Studio is webcasting USB video.
Keystroke/mouseclick to audio start/stop is always well under 100ms,
probably 30 ms or less

Getting that to work probably requires significant
twisty kernel & program optimization.

Geoff Steckel



Re: Firefox and stuttering USB audio

2022-06-01 Thread Courtney

I have not found it to be an issue with the number of tabs being
open, but rather anything that spikes the processor causing these
interruptions. Oddly, even on my 8 core box, just having 1 or 2
cores spiking to 100% (which FF does on demanding sites) causes
these interruptions the most. I have also simply had firefox idling
with one tab open on the new tab page causing these interruptions
sometimes even. I have a buddy using Arch Linux and said even now
with newer versions of ff he's been having some strange behavior
too.

On 5/29/22 05:24, Alexandre Ratchov wrote:

On Thu, May 26, 2022 at 02:25:16PM +0200, Peter Fröhlich wrote:

Just FYI, when I updated from a smooth 7.0 to 7.1 about a week ago, I
started experiencing audio/video stuttering that I did not before. I
am unclear on what exactly the problem is, whether it's the kernel, a
driver, Firefox, etc. I just know that I went from a "no audio/video
issues whatsoever" X230 to a "I get about 20 seconds before the next
stutter will happen" X230. :-/


How many tabs/windows do you have? With -current firefox:

$ ps ax | grep firefox | wc -l
   40

which might increase the probability of stuttering.




Re: Firefox and stuttering USB audio

2022-06-01 Thread Courtney

Wonder what happened in that time. I'm on current right now.

I haven't tried firefox in a couple weeks to see if this has changed.

However, I have started using firefox-esr and strangely the

problem is more or less entirely gone. It's incredibly rare

that I hear a stutter now. Maybe switching to ESR could be a

solution for you?

Courtney

On 5/26/22 05:25, Peter Fröhlich wrote:

Just FYI, when I updated from a smooth 7.0 to 7.1 about a week ago, I
started experiencing audio/video stuttering that I did not before. I
am unclear on what exactly the problem is, whether it's the kernel, a
driver, Firefox, etc. I just know that I went from a "no audio/video
issues whatsoever" X230 to a "I get about 20 seconds before the next
stutter will happen" X230. :-/

On Fri, May 6, 2022 at 9:31 AM Courtney  wrote:

Hello all,

First time on the mailing list, please forgive me if I am missing any
"netiquette". I've been using OpenBSD on my desktop these last few
weeks. I have been trying to solve an issue with Only Firefox causing
stuttering issues with my audio output. Some things I have tried are:

* Setting dom.ipc.processCount to a lower number in about:config
* Muddled with sndiod -b and -z flags
* Set softdep,noatime for my different partitions in fstab (NVMe drive)
* Tried with/without SMT (Intel 10700k)
* Set some sysctl flags:

kern.shminfo.shmall=3145728
kern.shminfo.shmmax=2147483647
kern.shminfo.shmmni=2048
kern.shminfo.shmseg=2048
kern.seminfo.semmns=4096
kern.seminfo.semmni=2048
kern.maxproc=32768
kern.maxfiles=65535
kern.bufcachepercent=80
kern.maxvnodes=32
kern.somaxconn=4096

It would seem some things might work at first and pretty quickly I
would realize none of these things worked. The only solution has
been to not use Firefox. Tried chromium but it saddens me to see
that keepassxc-proxy & u2f doesn't work there.

Seems there's quite a few play errors:

# audioctl -f /dev/audioctl1 play.{bytes,errors}
play.bytes=242641680
play.errors=130560

play.errors does not go up when firefox is closed. According to the faq
it seems it could mean that the device has underrun samples. Whatever
that means, I'm unsure how to fix it. This has been a big headache for
me and I'm hoping someone could guide me to a solution here.

My DAC is a FiiO E10k
Running -current branch

$ uname -a
OpenBSD towerDefense 7.1 GENERIC.MP#492 amd64

I'm on the latest firefox (100.0)

Audio device is rsnd/1
Here is my system's dmesg below:

OpenBSD 7.1-current (GENERIC.MP) #492: Tue May  3 08:40:53 MDT 2022
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 34261110784 (32673MB)
avail mem = 33205428224 (31667MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.2 @ 0x7eb5a000 (94 entries)
bios0: vendor American Megatrends Inc. version "A.A0" date 10/22/2021
bios0: Micro-Star International Co., Ltd. MS-7C75
acpi0 at bios0: ACPI 6.2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP MCFG SSDT SSDT FIDT SSDT SSDT HPET APIC SSDT
SSDT NHLT LPIT SSDT SSDT DBGP DBG2 SSDT VFCT TPM2 WSMT FPDT BGRT
acpi0: wakeup devices PEG2(S4) PEGP(S4) PEG3(S4) PEGP(S4) PEGP(S4)
PEG1(S4) PEGP(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4)
RP04(S4) PXSX(S4) RP05(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0
acpimcfg0: addr 0xe000, bus 0-255
acpihpet0 at acpi0: 2399 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz, 4800.05 MHz, 06-a5-05
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,PKU,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 24MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz, 4800.05 MHz, 06-a5-05
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,PKU,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 

Re: Firefox and stuttering USB audio

2022-05-29 Thread Alexandre Ratchov
On Thu, May 26, 2022 at 02:25:16PM +0200, Peter Fröhlich wrote:
> Just FYI, when I updated from a smooth 7.0 to 7.1 about a week ago, I
> started experiencing audio/video stuttering that I did not before. I
> am unclear on what exactly the problem is, whether it's the kernel, a
> driver, Firefox, etc. I just know that I went from a "no audio/video
> issues whatsoever" X230 to a "I get about 20 seconds before the next
> stutter will happen" X230. :-/
> 

How many tabs/windows do you have? With -current firefox:

$ ps ax | grep firefox | wc -l
  40

which might increase the probability of stuttering.



Re: Firefox and stuttering USB audio

2022-05-26 Thread Peter Fröhlich
Just FYI, when I updated from a smooth 7.0 to 7.1 about a week ago, I
started experiencing audio/video stuttering that I did not before. I
am unclear on what exactly the problem is, whether it's the kernel, a
driver, Firefox, etc. I just know that I went from a "no audio/video
issues whatsoever" X230 to a "I get about 20 seconds before the next
stutter will happen" X230. :-/

On Fri, May 6, 2022 at 9:31 AM Courtney  wrote:
>
> Hello all,
>
> First time on the mailing list, please forgive me if I am missing any
> "netiquette". I've been using OpenBSD on my desktop these last few
> weeks. I have been trying to solve an issue with Only Firefox causing
> stuttering issues with my audio output. Some things I have tried are:
>
> * Setting dom.ipc.processCount to a lower number in about:config
> * Muddled with sndiod -b and -z flags
> * Set softdep,noatime for my different partitions in fstab (NVMe drive)
> * Tried with/without SMT (Intel 10700k)
> * Set some sysctl flags:
>
> kern.shminfo.shmall=3145728
> kern.shminfo.shmmax=2147483647
> kern.shminfo.shmmni=2048
> kern.shminfo.shmseg=2048
> kern.seminfo.semmns=4096
> kern.seminfo.semmni=2048
> kern.maxproc=32768
> kern.maxfiles=65535
> kern.bufcachepercent=80
> kern.maxvnodes=32
> kern.somaxconn=4096
>
> It would seem some things might work at first and pretty quickly I
> would realize none of these things worked. The only solution has
> been to not use Firefox. Tried chromium but it saddens me to see
> that keepassxc-proxy & u2f doesn't work there.
>
> Seems there's quite a few play errors:
>
> # audioctl -f /dev/audioctl1 play.{bytes,errors}
> play.bytes=242641680
> play.errors=130560
>
> play.errors does not go up when firefox is closed. According to the faq
> it seems it could mean that the device has underrun samples. Whatever
> that means, I'm unsure how to fix it. This has been a big headache for
> me and I'm hoping someone could guide me to a solution here.
>
> My DAC is a FiiO E10k
> Running -current branch
>
> $ uname -a
> OpenBSD towerDefense 7.1 GENERIC.MP#492 amd64
>
> I'm on the latest firefox (100.0)
>
> Audio device is rsnd/1
> Here is my system's dmesg below:
>
> OpenBSD 7.1-current (GENERIC.MP) #492: Tue May  3 08:40:53 MDT 2022
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 34261110784 (32673MB)
> avail mem = 33205428224 (31667MB)
> random: good seed from bootblocks
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 3.2 @ 0x7eb5a000 (94 entries)
> bios0: vendor American Megatrends Inc. version "A.A0" date 10/22/2021
> bios0: Micro-Star International Co., Ltd. MS-7C75
> acpi0 at bios0: ACPI 6.2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP MCFG SSDT SSDT FIDT SSDT SSDT HPET APIC SSDT
> SSDT NHLT LPIT SSDT SSDT DBGP DBG2 SSDT VFCT TPM2 WSMT FPDT BGRT
> acpi0: wakeup devices PEG2(S4) PEGP(S4) PEG3(S4) PEGP(S4) PEGP(S4)
> PEG1(S4) PEGP(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4)
> RP04(S4) PXSX(S4) RP05(S4) [...]
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpimcfg0 at acpi0
> acpimcfg0: addr 0xe000, bus 0-255
> acpihpet0 at acpi0: 2399 Hz
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz, 4800.05 MHz, 06-a5-05
> cpu0:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,PKU,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
> cpu0: 256KB 64b/line 8-way L2 cache
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
> cpu0: apic clock running at 24MHz
> cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
> cpu1 at mainbus0: apid 2 (application processor)
> cpu1: Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz, 4800.05 MHz, 06-a5-05
> cpu1:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,PKU,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
> cpu1: 256KB 64b/line 8-way L2 cache
> cpu1: smt 0, core 1, package 0
> cpu2 at mainbus0: apid 4 (application processor)
> cpu2: Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz, 4800.05 MHz, 06-a5-05
> cpu2:
> 

Re: Firefox and stuttering USB audio

2022-05-09 Thread Michael Stolovitzsky



On 5/6/22 10:29, Courtney wrote:

Hello all,

[snip]

* Setting dom.ipc.processCount to a lower number in about:config
* Muddled with sndiod -b and -z flags
* Set softdep,noatime for my different partitions in fstab (NVMe drive)
* Tried with/without SMT (Intel 10700k)
* Set some sysctl flags:


[snip]

uaudio0: play xfer, err = 6

This may be a driver bug, but before anything else, check the output of 
apm(1) for your performance mode.