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 26th September 2016
hulten hulten is offline
Port Guard
 
Join Date: Dec 2014
Posts: 34
Question slow rendering on iMac

I installed OpenBSD 6.0 from the official CD set on an iMac G5. The screen renders slowly. For instance, when the system is booting, as soon as the the kernel messages hit the bottom of the screen, it starts scrolling... very slowly. Playing a video (using mplayer or vlc) under X is impossible: sounds work fine, but I get to see only a handful of frames per minute.

Do I need to do something special to get 2-D Radeon acceleration working?

I have enclosed kernel messages and a pci dump.
Attached Files
File Type: txt dmesg_iMac.txt (12.5 KB, 75 views)
File Type: txt pcidump_iMac.txt (350 Bytes, 67 views)
Reply With Quote
  #2   (View Single Post)  
Old 26th September 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

/usr/X11R6/README.macppc contains provisioning guidance, such as setting the xf86(4) aperture driver to 2 in order to use the accelerated video driver. If you've followed this guidance and are still having trouble, I recommend contacting Martin Pieuchot (mpi@), he is the OpenBSD Project member who led the drm(4) development for macppc.
Reply With Quote
  #3   (View Single Post)  
Old 27th September 2016
hulten hulten is offline
Port Guard
 
Join Date: Dec 2014
Posts: 34
Unhappy

Thank you for the tip, jggimi. I followed the README. The only relevant part is what you mention, the apterture driver. This is now set to 2 (I can see this happening when my system boots). So acceleration should be enabled. However, the problem persists.

I have sent an e-mail Martin Pieuchot about this problem; waiting for response.
Reply With Quote
  #4   (View Single Post)  
Old 9th October 2016
hulten hulten is offline
Port Guard
 
Join Date: Dec 2014
Posts: 34
Default

Shortly after sending mpi@ an e-mail, he responded with suggestions, amongst which contacting jsg@ who maintains Mesa in OpenBSD.

My problem is not yet solved, and I'm not sure if I should expect a smooth OpenBSD experience on a 10-yr old iMac. Maybe someone has some other idea. I will give some more findings and other information here.

Code:
$ sysctl kern.version
kern.version=OpenBSD 6.0 (GENERIC) #1097: Tue Jul 26 18:22:06 MDT 2016
    deraadt@macppc.openbsd.org:/usr/src/sys/arch/macppc/compile/GENERIC
Outside X, during boot-time, I see this:
http://marcovan.hulten.org/pub/IMG_20161007_212146.jpg
The text appears to get mixed because the computer cannot scroll as fast as the kernel is generating messages. This is not a big problem in itself, but it may give some indications if this is, say, a hardware or OpenBSD/macppc limitation.

xvinfo(1) tells me that there are no X-Video adaptors available, so mplayer does not run with -vo xv. The other -vo choices give variable results. By far out the best is x11. In that case the video is lagging about 10 seconds or more compared to the audio, and mplayer tells me my system is too slow. mplayer(1) and xvinfo(1) tell me that xv is not available. The other output drivers either don't work at all or give one or two frames over half a minute (and now I also noticed that the sound of the media file stops now and then while I am playing it).

Here is an mplayer session without me overriding any options:
Code:
$ mplayer xea8WXPcy6g.mp4 
MPlayer SVN-r37839 (C) 2000-2016 MPlayer Team

Playing xea8WXPcy6g.mp4.
libavformat version 56.40.101 (external)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb3a868a0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  640x360  24bpp  24.000 fps  276.0 kbps (33.7 kbyte/s)
[VO_XV] It seems there is no Xvideo support for your video card available.
[VO_XV] Run 'xvinfo' to verify its Xv support and read
[VO_XV] DOCS/HTML/en/video.html#xv!
[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.
[VO_XV] Try -vo x11.
[gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 56.60.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Clip info:
 major_brand: mp42
 minor_version: 0
 compatible_brands: isommp42
 creation_time: 2014-01-18 04:42:17
Load subtitles in ./
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, floatbe, 96.0 kbit/3.40% (ratio: 12001->352800)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [sndio] 44100Hz 2ch s16be (2 bytes per sample)
Starting playback...
Movie-Aspect is undefined - no prescaling applied.
VO: [gl_nosw] 640x360 => 640x360 Planar YV12 
A:   0.7 V:   0.0 A-V:  0.655 ct:  0.004   0/  0 ??% ??% ??,?% 1 0 

Exiting... (Quit)
jsg@ wrote me back:
> powerpc doesn't have write combining which is unlikely to help
> matters.

I understand from Wikipedia that "write combining" is a way to send larger chunks of data to some device, and from jsg@'s remark I get that it would significantly speed up the rendering of my screen if it were present.

Xorg reverts to software rendering:
Code:
...
[    32.848] (--) Depth 24 pixmap format is 32 bpp
[    32.853] (II) RADEON(0): Front buffer size: 7088K
[    32.853] (II) RADEON(0): VRAM usage limit set to 105123K
[    32.865] (==) RADEON(0): DRI3 disabled
[    32.865] (==) RADEON(0): Backing store enabled
[    32.865] (WW) RADEON(0): Direct rendering disabled
[    32.865] (II) RADEON(0): Acceleration disabled
[    32.866] (==) RADEON(0): DPMS enabled
[    32.866] (==) RADEON(0): Silken mouse disabled
[    32.868] (II) RADEON(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[    32.874] (--) RandR disabled
[    32.943] (II) AIGLX: Screen 0 is not DRI2 capable
[    32.943] (EE) AIGLX: reverting to software rendering
[    33.284] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[    33.289] (II) AIGLX: Loaded and initialized swrast
[    33.289] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[    33.293] (II) RADEON(0): Setting screen physical size to 444 x 277
[    34.308] (II) config/wscons: checking input device /dev/wskbd
...
Reply With Quote
  #5   (View Single Post)  
Old 9th October 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

You might take a look at /var/log/Xorg.0.log; it should describe what video driver X is using if it unable to use drm(4).
Reply With Quote
  #6   (View Single Post)  
Old 10th October 2016
hulten hulten is offline
Port Guard
 
Join Date: Dec 2014
Posts: 34
Default

I think the driver is RADEON. The loaded modules are glx, ati and radeon. My full Xorg.0.log is enclosed.

I do not see the exact string "ATI Radeon 9600 Pro" in Xorg.0.log that I get from pcidump(8).

mpi@ noted that my problem relates to https://bugs.freedesktop.org/show_bug.cgi?id=57649

He furthermore suggested that I set DefaultDepth to 16. Since X -configure does not work anymore, and I cannot find any example xorg.conf on OpenBSD anymore, I am not sure how to do this (quickly -- of course, I could study xorg.conf(5)).
Attached Files
File Type: gz pomme_Xorg.0.log.gz (6.0 KB, 51 views)
Reply With Quote
  #7   (View Single Post)  
Old 10th October 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

You are correct, the radeon(4) driver is utilized. I see this error at the bottom of the log, which shows a drm(4) failure:
Code:
[    34.600] (EE) RADEON(0): drmmode_do_crtc_dpms cannot get last vblank counter
You can create a subset of an xorg.conf file within /etc/X11/xorg.conf.d/, as X will look in that directory for any files that end with ".conf". This will likely be easier than trying to create an entire xorg.conf file.
Reply With Quote
  #8   (View Single Post)  
Old 10th October 2016
hulten hulten is offline
Port Guard
 
Join Date: Dec 2014
Posts: 34
Default

Hmm, yes, a quick web search shows me that I need to install firmware-linux-nonfree :-)
Adding +OpenBSD to the search gave zero results (but as I said: only a quick search).

Anyway, I have been able to run it in a Depth of 16 with a Screen section with only an Identifier and DefaultDepth, so that's quite nice. It did not solve the slowness problem, though.

I have never opened an Apple (never had one), so this may be a stupid question, but I wonder if I could put in a PCI, AGP or whatever I have lying around here from pc's, in the iMac.
Reply With Quote
  #9   (View Single Post)  
Old 10th October 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Quote:
Originally Posted by hulten View Post
Hmm, yes, a quick web search shows me that I need to install firmware-linux-nonfree :-)
That should have been automatic, but you can do this manually with:
# fw_update radeondrm
Upon successful completion, you might have solved the problem.
Quote:
I have never opened an Apple (never had one), so this may be a stupid question, but I wonder if I could put in a PCI, AGP or whatever I have lying around here from pc's, in the iMac.
A list of supported video cards may be found at http://www.openbsd.org/macppc.html
Reply With Quote
Old 10th October 2016
hulten hulten is offline
Port Guard
 
Join Date: Dec 2014
Posts: 34
Default

Thanks, jggimi: installing the radeondrm driver made moving windows around notably quicker, though not smooth. Also playing most videos doesn't work.

I think it is reasonable that fw_update(1) is not done automatically as it installs non-free software.
Reply With Quote
Old 10th October 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

The radeondrm(4) driver is part of the OS, and was already installed when you installed the OS. But you did not install a driver. You installed firmware. This is not a driver -- it's not even software. (To be pedantic, it actually is software, but it is not software that runs "on the computer" or "in the OS.")

It is microcode that runs on a peripheral hardware component -- in this case, your Radeon video card. Firmware does not run on the CPU, it does not run in RAM.

Firmware is provided by peripheral device manufacturers, and runs on their devices. The only difference between firmware and hardware programming is that firmware is loaded at device initialization, rather than included with the hardware at manufacturing time -- in ROMs, or in ASIC logic. Firmware provides vendors with sustaining engineering flexibility, and may lower manufacturing as well as support costs.

Some peripheral device manufacturers permit the free distribution of their firmware, and these can be included with OpenBSD directly. You will find examples in the /etc/firmware directory. Other peripheral device manufactures have restrictive distribution licenses which permit only separate packaging. One of those restrictive distribution licenses is for all Radeon firmware, needed for DRM operation. This type of firmware is what fw_update(1) manages. It installs the firmware files into /etc/firmware, where they reside alongside freely available firmware files.
If there are manufacturers who allows neither packaging their firmware with the OS nor separate packaging, their hardware won't be usable with OpenBSD.
---

Installation of restrictive license firmware is intended to be automatic, because the manufacturer's hardware will not run properly without it. fw_update(1) is scripted to be run at first boot via src/distrib/miniroot/install.sub:
Code:
# Ensure that fw_update is run on reboot.
echo "/usr/sbin/fw_update -v" >>/mnt/etc/rc.firsttime
It is possible that fw_update was not run after install or upgrade, or the radeondrm device was not discovered by the program when it parsed your dmesg(8). But most likely, the reason it failed is there was no network configured at first boot.

Last edited by jggimi; 11th October 2016 at 01:00 AM. Reason: clarity, typo, more clarity, and two more typos. Then three more typos created by prior edits. Sheesh.
Reply With Quote
Old 10th October 2016
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 314
Default

Quote:
Originally Posted by hulten View Post
I have never opened an Apple (never had one), so this may be a stupid question, but I wonder if I could put in a PCI, AGP or whatever I have lying around here from pc's, in the iMac.
Unfortunately the graphics card on your model is not upgradable as it's integrated on the logic board/mobo:

http://www.everymac.com/systems/appl...abilities.html
https://discussions.apple.com/thread...art=0&tstart=0
Reply With Quote
Old 10th October 2016
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

Quote:
Thanks, jggimi: installing the radeondrm driver made moving windows around notably quicker, though not smooth. Also playing most videos doesn't work.
Sometimes the bios offers an option to increase the memory allocation for a video card. I do not know about iMac, but my Via OpenChrome laptop has this option.

I would also review $ man radeon - there are some options to increase performance.

Last edited by shep; 10th October 2016 at 11:37 PM.
Reply With Quote
Reply

Tags
macppc, video


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
NetBSD o iMac lumiwa NetBSD General 2 27th August 2014 11:12 AM
BSD on iMac G5 PPC Cato Other BSD and UNIX/UNIX-like 3 27th March 2012 02:27 AM
Cursor skipping/freezing when rendering pages in Chromium GullibleJones OpenBSD Packages and Ports 5 9th February 2012 11:28 PM
PDF: Quality of Document Rendering on BSDs vermaden Off-Topic 32 29th May 2011 05:07 PM
direct rendering with nvidia card PatrickBaer FreeBSD General 13 2nd October 2008 07:51 AM


All times are GMT. The time now is 10:50 PM.


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