DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 14th November 2019
therue therue is offline
Port Guard
 
Join Date: Feb 2018
Posts: 21
Default New to OpenBSD, could use some help on some issues and possible optimization options

Laptop: Thinkpad x230, i7 processor, 8G ram

1. Firefox - when attempting to watch streams from twitch.tv from within "firefox", the video doesn't play. It just shows a black video screen with the symbol showing that the process is still running and attempting to play the video. Is there something I need to configured in firefox for this? And, what are some other general firefox configurations that are recommended when using an OpenBSD machine?

2. mpv - when playing a live stream via mpv, the video lags horribly and seem to have problem buffering. It's pretty much unwatchable as the video/audio stops every 3-5 seconds. Are there any any mpv settings I should configured specifically for openbsd? (i never really had this problem when running archlinux in the past).
In addition, when using mpv to play youtube videos (not live stream), it also seems like the video buffers more slowly compared to my experience from linux. is this normal?
Here is a log file of messages from mpv while playing a stream: https://pastebin.com/3VRWgv3K
Here is a log file of messages from mpv while playing a youtube video: https://pastebin.com/mn0wEXMf

3. In general, whenever i watch videos, the cpu (CPU0, CPU2) spike up really high. both go up to about 35-56% which immediately makes the heatsink/fan/ventilation area of my thinkpad extremely hot.

Do i need to add my user to the 'staff' group? and datasize-cur, datasize-max in /etc/login.conf? Will this solve some of the issues i'm having?

currently, by default this is what my login.conf looks like:
Code:
default:\
        :path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin /usr/local/sbin:\
        :umask=022:\
        :datasize-max=768M:\
        :datasize-cur=768M:\
        :maxproc-max=256:\
        :maxproc-cur=128:\
        :openfiles-max=1024:\
        :openfiles-cur=512:\
        :stacksize-cur=4M:\
        :localcipher=blowfish,a:\
        :tc=auth-defaults:\
        :tc=auth-ftp-defaults:


staff:\
        :datasize-cur=1536M:\
        :datasize-max=infinity:\
        :maxproc-max=512:\
        :maxproc-cur=256:\
        :ignorenologin:\
        :requirehome@:\
        :tc=default:
While many blogs mentioned the above optimization, https://www.c0ffee.net/blog/openbsd-on-a-laptop/ also talked about modifying /etc/sysctl.conf
is this recommended? will it help?

If anyone have any any system fine-tuning, optimizations I should apply (especially to this thinkpad x230 laptop) please let me know! Aside from these issues, I'm really loving openbsd's simplicity and elegance. Firefox performance in opening pages isn't as bad as I heard and (maybe it's just me) but somehow music sound better on openbsd compared to linux (because of sndio?) Not 100% sure on that though... could just be my mind playing tricks on me lol.

Last edited by ocicat; 14th November 2019 at 01:17 PM. Reason: Please use [code] & [/code] tags when posting file contents.
Reply With Quote
  #2   (View Single Post)  
Old 14th November 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,866
Default

1. For Firefox, see the package readme and the section discussing integrated HTML5 audio/video and the section discussing graphics acceleration. The file should be in /usr/local/share/doc/pkg-readmes/.

2. For other video players, it appears that you may be operating X without any acceleration. This is common if the default VESA driver was selected due to not being able to provision your GPU with DRM and 2D/3D acceleration features. The contents of your dmesg(8) describes your hardware, as understood by the OS, and /var/log/Xorg.0.log contains the most recent attempt by the X Windows System to provision that hardware.

3. As discussed above, unaccelerated video will consume CPU. But generally, any browser user should be in the staff group to provide sufficient file-descriptors and memory to run a modern browser.
Reply With Quote
  #3   (View Single Post)  
Old 14th November 2019
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,325
Default

If, as suggested, you;re are running VESA, it would be a consequence of not loading inteldrm firmware. The firmware, which Intel prevents from being distributed on the install media, is normally downloaded and installed by fw_update(1) on 1st boot. If, you do not have an internet connection on 1st boot, subsequent boots do not run fw_update . With an internet connection, manually run fw_update as root to verify.

Last edited by shep; 14th November 2019 at 06:53 PM.
Reply With Quote
  #4   (View Single Post)  
Old 14th November 2019
therue therue is offline
Port Guard
 
Join Date: Feb 2018
Posts: 21
Default

hmm, shouldn't be my laptop though i don't think. I didn't really have this problem when I was running archlinux. I could even have 4-5 videos running at once.

here is my dmesg:
http://ix.io/21Bg
here is my Xorg.0.log:
http://ix.io/21Bb

I did run fw_update immediately after the install: (these were the firmware that were already installed)
intel-firmware-20190918v0 microcode update binaries for Intel CPUs
inteldrm-firmware-20181218 firmware binary images for inteldrm(4) driver
iwn-firmware-5.11p1 firmware binary images for iwn(4) driver
uvideo-firmware-1.2p3 firmware binary images for uvideo(4) driver
vmm-firmware-1.11.0p2 firmware binary images for vmm(4) driver

Last edited by therue; 14th November 2019 at 01:15 PM.
Reply With Quote
  #5   (View Single Post)  
Old 14th November 2019
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 48
Default

It may be a permission issue. Permission to use /dev/drm0 is set in /etc/fbtab. Permissions in /etc/fbtab default to the user logged in on ttyC0. Check you have /dev/drm0 listed in /etc/fbtab on the /dev/ttyC0 line. You might also have to be in 'wheel' group (I had to in order to use mplayer).

What happens if you start firefox from the command line (assuming you have hardware acceleration enabled in Firefox preferences)? If you get a message saying DRM fails to load due to lack of permission, that's the problem.
Reply With Quote
  #6   (View Single Post)  
Old 14th November 2019
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 153
Default

Quote:
Originally Posted by therue View Post
here is my Xorg.0.log:
http://ix.io/21Bb
You're running the modesetting DDX driver, try xf86-video-intel instead. Use an X.Org configuration file to force it:
Code:
# /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
   Identifier "Intel Graphics"
   Driver "intel"
EndSection
DRM seems to be working though and the Mesa drivers are loaded. Not that FF can use hardware acceleration under OpenBSD.
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.
Reply With Quote
  #7   (View Single Post)  
Old 14th November 2019
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 48
Default

Quote:
Originally Posted by Head_on_a_Stick View Post
Not that FF can use hardware acceleration under OpenBSD.
Ah, thanks for the correction.
Reply With Quote
  #8   (View Single Post)  
Old 15th November 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,866
Default

My interpretation of the package readme is that OpenGL acceleration is available, but not by default.
Code:
Graphic Acceleration
====================
By default on unices the OpenGL acceleration is disabled. One can enable it by
setting MOZ_ACCELERATED=1 in the environment, or by switching the about:config
layers.acceleration.force-enable knob to true.  Check the 'Decision log'
section in about:support to see whether HW_COMPOSITING and OPENGL_COMPOSITING
are enabled.

Similarly, for the rust-based WebRender compositor, it is enabled by setting
MOZ_WEBRENDER=1 in the environment, or by switching the about:config
gfx.webrender.enabled knob to true. Check it is enabled in the 'Features'
section of about:support. For this feature, WebGL2 is necessary, so your
hardware must support at least OpenGL 4.

Check
https://wiki.mozilla.org/Platform/GFX/Quantum_Render for more details.
Reply With Quote
  #9   (View Single Post)  
Old 15th November 2019
therue therue is offline
Port Guard
 
Join Date: Feb 2018
Posts: 21
Default

Quote:
Originally Posted by Head_on_a_Stick View Post
You're running the modesetting DDX driver, try xf86-video-intel instead. Use an X.Org configuration file to force it:
Code:
# /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
   Identifier "Intel Graphics"
   Driver "intel"
EndSection
DRM seems to be working though and the Mesa drivers are loaded. Not that FF can use hardware acceleration under OpenBSD.
Identifier should be "Intel Graphics"
or "drm"? "inteldrm"?
inteldrm would be the intel driver downloaded from fw_update right?

also, what's the difference between creating this file:
/etc/X11/xorg.conf

vs.

/etc/X11/xorg.conf.d/20-intel.conf ?
Reply With Quote
Old 15th November 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,866
Default

Identifier is merely a unique name. Use it for your own understanding of provisioning.

The xorg.conf can be a series of "fragments", such as Head_on_a_Stick's example, or can be a discrete file. The xorg.conf(5) man page states, "Xorg uses a configuration file called xorg.conf and files ending in the suffix .conf from the directory xorg.conf.d for its initial setup." It then goes on to describe the many directory structures that are inspected for files.
Reply With Quote
Old 15th November 2019
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 153
Default

Quote:
Originally Posted by jggimi View Post
My interpretation of the package readme is that OpenGL acceleration is available, but not by default.
Although FF is capable of hardware acceleration (if the noted variables are exported), it cannot provide hardware accelerated video decoding: https://bugzilla.mozilla.org/show_bug.cgi?id=1210727
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.
Reply With Quote
Old 15th November 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,866
Default

Thanks!
Reply With Quote
Old 16th November 2019
therue therue is offline
Port Guard
 
Join Date: Feb 2018
Posts: 21
Default

setup the xorg.conf file to tell it to use the intel driver instead of modesetting
Code:
#/etc/X11/xorg.conf.d/20-intel.conf 
Section "Device"
   Identifier "inteldrm"
   Driver "intel"
EndSection
modified login.conf and increased datasize-cur for staff class from 1536M to 4096M
Code:
#/etc/login.conf
staff:\
        :datasize-cur=4096M:\
        :datasize-max=infinity:\
        :maxproc-max=512:\
        :maxproc-cur=256:\
        :ignorenologin:\
        :requirehome@:\
        :tc=default:
Here are the new dmesg and Xorg.0.log:
dmesg:
http://ix.io/21Ux

Xorg.0.log:
http://ix.io/21Uy
noticed this in the beginning of the Xorg.0.log file.
Code:
[   266.934] (WW) checkDevMem: failed to open /dev/xf86 and /dev/mem
	(Operation not permitted)
	Check that you have set 'machdep.allowaperture=1'
	in /etc/sysctl.conf and reboot your machine
	refer to xf86(4) for details
[   266.934] 	linear framebuffer access unavailable
terminal message from mpv when viewing a live video from twitch:
https://pastebin.com/iRCAmq4r
it mentioned something about libEGL warning: DRI3: Screen seems not DRI3 capable
and basically I'm still having the same problem as before; stuttering, audio/video stopping every few seconds.

and now when i play youtube videos with mpv, it just takes me back to the xenodm login screen immediately and I would have to enter X again from the looks of it.(X crashing apparently)

so while the system now does seem to be using intel drm driver instead of the default modesetting that it selected itself, viewing streaming videos via mpv is stuttering still like it did when using modesetting, except now watching youtube video via mpv immediately crashes my x and takes me back to xenodm for a re-login.

Quote:
mpv terminal messages. some comparisons:
with modesetting while playing a live stream via mpv:
(+) Video --vid=1 (*) (h264 1920x1080)
(+) Audio --aid=1 --alang=eng (*) 'DASH audio' (opus 2ch 48000Hz) (external)
VO: [gpu] 1920x1080 yuv420p
AO: [sdl] 48000Hz stereo 2ch s32

with modesetting while playing a youtube video:
(+) Video --vid=1 (h264 1600x900)
(+) Audio --aid=1 (aac 2ch 44100Hz)
AO: [sdl] 44100Hz stereo 2ch s32
VO: [gpu] 1600x900 yuv420p

with inteldrm while playing a livestream:
(+) Video --vid=1 (h264 1600x900)
(+) Audio --aid=1 (aac 2ch 44100Hz)
libEGL warning: DRI3: Screen seems not DRI3 capable
AO: [sdl] 44100Hz stereo 2ch s32
VO: [gpu] 1600x900 yuv420p

with inteldrm while playing a youtube video:
result: mpv crashes X and goes back to xenodm login
so somehow using inteldrm has created more problems for some reason.
at least with the default modesetting, youtube videos through mpv still works and isn't crashing x.
though with both inteldrm and modesetting playing live stream through mpv is unwatchable due to the constant stuttering/lagging.


This is youtube played through mpv (with modesetting). Plays fine but it's showing the audio/video desynchronisation detected message and audio and video do seem a little out of sync though the audio and video qualities are pretty nice
Quote:
Playing: https://www.youtube.com/watch?v=Kbkc_0Ns6q0
(+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
(+) Audio --aid=1 --alang=eng (*) 'tiny' (opus 2ch 48000Hz) (external)
AO: [sdl] 48000Hz stereo 2ch s32
VO: [gpu] 1920x1080 yuv420p
AV: 00:00:15 / 00:24:47 (1%) A-V: 0.000 Dropped: 16 Cache: 21s+7MB

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:05:27 / 00:24:47 (21%) A-V: 0.000 Dropped: 54 Cache: 64s+25MB

Last edited by therue; 16th November 2019 at 03:35 PM.
Reply With Quote
Old 16th November 2019
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,325
Default

The intel video driver has some options to tweak it for specific hardware.
intel(4)
My amd driver can fall back on DRI2 as a config option. I do not see that option in the intel man page. You can also try changing the accelmethod to SNA.

The other tweak is mpv. It can use several video out options.
https://github.com/mpv-player/mpv/wi...hould-I-use%3F
https://github.com/mpv-player/mpv/bl...OCS/man/vo.rst

Last edited by shep; 16th November 2019 at 01:15 PM.
Reply With Quote
Old 16th November 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,866
Default

The xf86(4) aperture driver is not used with DRM, so you can ignore the warning.
Reply With Quote
Old 16th November 2019
therue therue is offline
Port Guard
 
Join Date: Feb 2018
Posts: 21
Default

Well i've gone back to the default modesetting.
at least that doesn't crash X when playing regular (non-live stream) videos.

However, lag and stutters still persists when watching livestream through mpv.

Anyone know what AO, VO i should be using for mpv?
currently, by default it's AO: [sdl], VO:[gpu]
Would changing this help? If so, what should I change them to?

and how do i address the desynchronicity problem?
Quote:
Playing: https://www.youtube.com/watch?v=Kbkc_0Ns6q0
(+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
(+) Audio --aid=1 --alang=eng (*) 'tiny' (opus 2ch 48000Hz) (external)
AO: [sdl] 48000Hz stereo 2ch s32
VO: [gpu] 1920x1080 yuv420p
AV: 00:00:15 / 00:24:47 (1%) A-V: 0.000 Dropped: 16 Cache: 21s+7MB

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:05:27 / 00:24:47 (21%) A-V: 0.000 Dropped: 54 Cache: 64s+25MB

Last edited by therue; 16th November 2019 at 05:27 PM.
Reply With Quote
Old 16th November 2019
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,325
Default

Quote:
Anyone know what AO, VO i should be using for mpv?
I recall xv worked well.

Quote:
how do i address the desynchronicity problem?
MPV is an mplayer fork and I recall mplayer had some documentation on optimizing. Not sure if MPV has its own documentation or if you can reliably use mplayers documentation for mpv. A web search should get you a quick answer.
Reply With Quote
Old 16th November 2019
jak3b jak3b is offline
New User
 
Join Date: Nov 2017
Posts: 9
Default

Quote:
Originally Posted by shep View Post
I recall xv worked well.


MPV is an mplayer fork and I recall mplayer had some documentation on optimizing. Not sure if MPV has its own documentation or if you can reliably use mplayers documentation for mpv. A web search should get you a quick answer.
This is my mpv.conf. I have an AMD Radeon 6950 caymen video card.
This plays anything Ive thrown at it smoothly.Matter of fact Im getting better video performance on OpenBSD then Void linux lately. I dual boot so exact same same hardware. I got this mpv.conf off this forum.

vo=gpu
ao=sndio
geometry=100%
audio-channels=2
#scale=ewa_lanczossharp
#cscale=ewa_lanczossharp
video-sync=display-resample
#interpolation
#tscale=oversample
#cache=yes
demuxer-readahead-secs=20
demuxer-max-bytes=41943040
demuxer-max-back-bytes=41943040
gpu-context=x11egl
#hwdec=vaapi
hwdec=vdpau
Reply With Quote
Old 16th November 2019
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,325
Default

Your options are:
https://mpv.io/manual/stable/#video-output-drivers
To change the video output, edit the "vo="
Code:
vo=xv
ao=sndio
geometry=100%
audio-channels=2
#scale=ewa_lanczossharp
#cscale=ewa_lanczossharp
video-sync=display-resample
#interpolation
#tscale=oversample
#cache=yes
demuxer-readahead-secs=20
demuxer-max-bytes=41943040
demuxer-max-back-bytes=41943040
gpu-context=x11egl
#hwdec=vaapi
hwdec=vdpau
Reply With Quote
Old 16th November 2019
albator albator is offline
Shell Scout
 
Join Date: Jul 2011
Posts: 92
Default

The Lenovo Thinkpad X230 is very well supported and should work without issue:
https://dmesgd.nycbug.org/index.cgi?do=view&id=5161
https://dmesgd.nycbug.org/index.cgi?do=view&id=4585

Have you tried not to follow any blog but only the FAQ?
My computer has an i7-4785T CPU (not that different from yours) and uses accelerated graphics without even having a xorg.conf file.

My advice would be to reinstall from scratch and stick to the default configuration.
Being part of staff helps and, as mentioned earlier, you also need inteldrm-firmware.

Regarding mpv, I don't have a configuration file either and don't notice any lag.

Last edited by albator; 16th November 2019 at 11:14 PM. Reason: adding another link
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2017 OpenBSD Webkit options shep OpenBSD Packages and Ports 8 13th February 2017 04:38 AM
OpenBSD 5.7 Router Issues Peter_APIIT OpenBSD General 8 18th June 2015 06:31 AM
openbsd server optimization barti OpenBSD General 18 30th July 2012 02:52 PM
FreeBSD Kernel Optimization komodo FreeBSD General 5 22nd June 2009 07:15 AM
Gnome issues in OpenBSD 4.2 Shredder OpenBSD General 61 27th May 2008 07:34 AM


All times are GMT. The time now is 08:05 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick