Δημοσιεύτηκε: 06 Νοέμ 2014, 12:30
από Learner
Στο ίδιο θέμα θα ενσωματώσω και τα «πειράματα» που έκανα πρόσφατα(μόλις σήμερα), πάνω στο ίδιο θέμα στην Nvidia κάρτα που έχω. Φυσικά και μιλάμε για τον nouveau ο οποίος πλέον έχει φτάσει σε αρκετά καλά επίπεδα (σε σχέση με παλιότερα που τον δοκίμαζα).

Δεν διστάζω να πω ότι λετουργεί καλύτερα (σε μένα τουλάχιστον) από τους οδηγούς που προσφέρει η Nvidia για Linux. Τελευταία αντιμετώπιζα διάφορα προβλήματα με τους κλειστούς οδηγούς (κολλήματα-artifacts...κλπ) και δοκιμάζοντας τον nouveau, εξεπλάγην!
Ναι και Steam υποστηρίζει. Όχι όλα τα παιχνίδια βέβαια, αλλά αυτά που ενδιαφέρουν εμένα, λειτουργούν πιο smooth με τον nouveau. Αυτή την αίσθηση μου δίνει, χωρίς να είμαι(ήμουν) υπέρμαχος του nouveau, μιας και σχεδόν πάντα χρησιμοποιούσα τους κλειστούς της Nvidia.

Το δυστύχημα εδώ είναι πως χρειάζεται να κάνουμε extract κάποιο firmware από τον κλειστό της Nvidia. Η πειραματική βιβλιοθήκη υπάρχει, nouveau_drv_video.so, αλλά (τουλάχιστον σε μένα) δεν φαίνεται να λειτουργεί σωστά. Το reverse engineering συνεχίζεται και ελπίζω(ουμε) σε καλύτερες εκδόσεις του open source library.

Τα αποτελέσματα με τον mpv (fork του "παρατημένου;" mplayer) είναι
Κώδικας: Επιλογή όλων
export VDPAU_DRIVER=va_gl
mpv --hwdec=vdpau Ender\'s\ Game\ -\ Trailer.mp4

Κώδικας: Επιλογή όλων
Playing: Ender's Game - Trailer.mp4
[libav/demuxer] mov,mp4,m4a,3gp,3g2,mj2: max_analyze_duration 5000000 reached
File tags:
major_brand: mp42
minor_version: 0
compatible_brands: mp42isomavc1
creation_time: 2013-11-02 02:29:04
genre: Trailer
artist: Summit
title: Ender's Game - Trailer
encoder: HandBrake 0.9.9 2013051800
date: 2013
[stream] Video (+) --vid=1 (*) (h264)
[stream] Video     --vid=2 [P] (mjpeg)
[stream] Audio (+) --aid=1 --alang=eng (*) (aac)
[VS] Software VDPAU backend library initialized
libva info: VA-API version 0.35.1
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nouveau_drv_video.so
libva info: Found init function __vaDriverInit_0_35

και τελειώνουμε εκεί. Δεν προχωράει παρακάτω, ούτε παίζει το trailer.

Extract Nvidia firmware

Πάμε να κάνουμε extract το firmware της Nvidia, το οποίο χρειαζόμαστε;
Κώδικας: Επιλογή όλων
mkdir /tmp/nouveau
cd /tmp/nouveau
wget https://raw.github.com/imirkin/re-vp2/master/extract_firmware.py
wget http://us.download.nvidia.com/XFree86/Linux-x86/325.15/NVIDIA-Linux-x86-325.15.run
sh NVIDIA-Linux-x86-325.15.run --extract-only
python2 extract_firmware.py
sudo mkdir /lib/firmware/nouveau
sudo cp -d nv* vuc-* /lib/firmware/nouveau/

Πάμε να δοκιμάσουμε ξανά; αυτή τη φορά δεν θα χρησιμοποιήσουμε το πειραματικό va_gl, αλλά το firmware που κάναμε extract.
Κώδικας: Επιλογή όλων
unset VDPAU_DRIVER
mpv --hwdec=vdpau Ender\'s\ Game\ -\ Trailer.mp4

και τα αποτελέσματα
Κώδικας: Επιλογή όλων
File tags:
major_brand: mp42
minor_version: 0
compatible_brands: mp42isomavc1
creation_time: 2013-11-02 02:29:04
genre: Trailer
artist: Summit
title: Ender's Game - Trailer
encoder: HandBrake 0.9.9 2013051800
date: 2013
[stream] Video (+) --vid=1 (*) (h264)
[stream] Video     --vid=2 [P] (mjpeg)
[stream] Audio (+) --aid=1 --alang=eng (*) (aac)
Trying to use hardware decoding.
AO: [pulse] 44100Hz stereo 2ch float
AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
VO: [vdpau] 1920x800 => 1920x800 vdpau
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:00:03 / 00:01:53 (2%) A-V: -0.000

με ένα ωραίο smooth playing και κατανάλωση CPU , περί το 7-8% (τίποτα δηλαδή).

Για την verbose version μέσα στο Spoiler
Spoiler: show
Κώδικας: Επιλογή όλων
[cplayer] mpv 0.4.2 (C) 2000-2014 mpv/MPlayer/mplayer2 projects
[cplayer]  built on 2014-10-02T03:05:19
[cplayer] libav library versions:
[cplayer]    libavutil       54.3.0
[cplayer]    libavcodec      56.1.0
[cplayer]    libavformat     56.1.0
[cplayer]    libswscale      3.0.0
[cplayer]    libavfilter     5.0.0
[cplayer]    libavresample   2.1.0
[cplayer]
[global] user config path: 'encoding-profiles.conf' -> '/home/nikos/.mpv/encoding-profiles.conf'
[global] global config path: 'encoding-profiles.conf' -> '/etc/mpv/encoding-profiles.conf'
[global] any config path: 'encoding-profiles.conf' -> '/etc/mpv/encoding-profiles.conf'
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf
[global] global config path: 'mpv.conf' -> '/etc/mpv/mpv.conf'
[cplayer] Reading config file /etc/mpv/mpv.conf
[cplayer] : No such file or directory
[global] user config path: '' -> '/home/nikos/.mpv'
[global] user config path: 'config' -> '/home/nikos/.mpv/config'
[cplayer] Reading config file /home/nikos/.mpv/config
[cplayer] : No such file or directory
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'hwdec' = 'vdpau' (flags = 8)
[cplayer] Configuration: ./waf -v --nocache configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --confdir=/etc/mpv --enable-sdl2 --enable-zsh-comp --enable-libmpv-shared
[cplayer] Command line: 'mpv' '-v' '--hwdec=vdpau' 'Ender's Game - Trailer.mp4'
[input] enable section 'default'
[global] user config path: 'input.conf' -> '/home/nikos/.mpv/input.conf'
[global] global config path: 'input.conf' -> '/etc/mpv/input.conf'
[global] any config path: 'input.conf' -> '(NULL)'
[input] Falling back on default (hardcoded) input config
[input] Setting up LIRC support...
[input] Failed to open LIRC support. You will not be able to use your remote control.
[global] user config path: 'fonts' -> '/home/nikos/.mpv/fonts'
[global] user config path: 'lua' -> '/home/nikos/.mpv/lua'
[global] user config path: 'watch_later/B86A5C80F747C0C0126197C361B3360E' -> '/home/nikos/.mpv/watch_later/B86A5C80F747C0C0126197C361B3360E'
[osc] Loading script...
[global] user config path: 'Ender's Game - Trailer.mp4.conf' -> '/home/nikos/.mpv/Ender's Game - Trailer.mp4.conf'
[global] user config path: 'watch_later/B86A5C80F747C0C0126197C361B3360E' -> '/home/nikos/.mpv/watch_later/B86A5C80F747C0C0126197C361B3360E'
[cplayer] Playing: Ender's Game - Trailer.mp4
[file] Opened: [file] Ender's Game - Trailer.mp4
[demux] Trying demuxer: edl (force-level: normal)
[demux] Trying demuxer: cue (force-level: normal)
[demux] Trying demuxer: rawaudio (force-level: normal)
[demux] Trying demuxer: rawvideo (force-level: normal)
[demux] Trying demuxer: tv (force-level: normal)
[demux] Trying demuxer: libass (force-level: normal)
[demux] Trying demuxer: mkv (force-level: normal)
[demux] Trying demuxer: lavf (force-level: normal)
[osc] loading mp.defaults
[osc] loading @osc.lua
[lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[global] user config path: 'lua-settings/osc.conf' -> '/home/nikos/.mpv/lua-settings/osc.conf'
[osc] lua-settings/osc.conf not found.
[libav/demuxer] mov,mp4,m4a,3gp,3g2,mj2: max_analyze_duration 5000000 reached
[lavf] demux_lavf: avformat_find_stream_info() finished after 173702 bytes.
[lavf] LAVF: build 3670272
[demux] Detected file format: QuickTime / MOV (libavformat)
[demux] File tags:
[demux]  major_brand: mp42
[demux]  minor_version: 0
[demux]  compatible_brands: mp42isomavc1
[demux]  creation_time: 2013-11-02 02:29:04
[demux]  genre: Trailer
[demux]  artist: Summit
[demux]  title: Ender's Game - Trailer
[demux]  encoder: HandBrake 0.9.9 2013051800
[demux]  date: 2013
[lavf] Replaygain tags not found
[global] user config path: 'subfont.ttf' -> '/home/nikos/.mpv/subfont.ttf'
[global] user config path: 'fonts.conf' -> '/home/nikos/.mpv/fonts.conf'
[global] global config path: 'fonts.conf' -> '/etc/mpv/fonts.conf'
[global] any config path: 'fonts.conf' -> '(NULL)'
[libass] Setting up fonts...
[libass] Done.
[find_subfiles] Load subtitles in .
[global] user config path: 'sub/' -> '/home/nikos/.mpv/sub/'
[cplayer] [stream] Video (+) --vid=1 (*) (h264)
[cplayer] [stream] Video     --vid=2 [P] (mjpeg)
[cplayer] [stream] Audio (+) --aid=1 --alang=eng (*) (aac)
[cplayer] [V] fourcc:0x31637661  size:1920x800  fps:23.976
[vo/vdpau/x11] X11 opening display: :0
[vo/vdpau/x11] X11 running at 1680x1050 (":0" => local display)
[vo/vdpau/x11] Detected wm supports NetWM.
[vo/vdpau/x11] Detected wm supports FULLSCREEN state.
[vo/vdpau/x11] Detected wm supports ABOVE state.
[vo/vdpau/x11] Detected wm supports BELOW state.
[vd] Codec list:
[vd]     lavc:h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd] Opening video decoder lavc:h264
[vd] Trying to use hardware decoding.
[vd] Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [lavc:h264]
[vo/vdpau/x11] Disabling screensaver.
[ad] Codec list:
[ad]     lavc:aac - AAC (Advanced Audio Coding)
[ad] Opening audio decoder lavc:aac
[ad] INFO: libavcodec "aac" init OK!
[ad] Initial decode succeeded after 1 packets.
[ad] Selected audio codec: AAC (Advanced Audio Coding) [lavc:aac]
[ad] AUDIO: 44100 Hz, 2 ch, floatp
[ad] Building audio filter chain for 44100Hz stereo 2ch floatp -> 0Hz stereo 2ch ??...
[af] Audio filter chain:
[af]   [in] 44100Hz stereo 2ch floatp
[af]   [out] 44100Hz stereo 2ch floatp
[af]   [ao] 0Hz stereo 2ch ??
[ao/pulse] requested format: 44100 Hz, stereo channels, floatp
[ao/pulse] device buffer: 11025 samples.
[ao/pulse] using soft-buffer of 11025 samples.
[cplayer] AO: [pulse] 44100Hz stereo 2ch float
[cplayer] AO: Description: PulseAudio audio output
[ad] Building audio filter chain for 44100Hz stereo 2ch floatp -> 44100Hz stereo 2ch float...
[af] Adding filter lavrresample
[af] Audio filter chain:
[af]   [in] 44100Hz stereo 2ch floatp
[af]   [lavrresample] 44100Hz stereo 2ch float
[af]   [out] 44100Hz stereo 2ch float
[af]   [ao] 44100Hz stereo 2ch float
[cplayer] Starting playback...
[vd] Pixel formats supported by decoder: vaapi_vld vdpau yuv420p
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[input] enable section 'showhide'
[input] enable section 'input'
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[vd] VIDEO:  1920x800  23.976 fps  4837.2 kbps (604.7 kB/s)
[vd] VDec: vo config request - 1920 x 800 (vdpau)
[vd] VO Config (1920x800->1920x800,0x45C)
[vf] Video filter chain:
[vf]  [vd] 1920x800 vdpau BT.709 (HD)/TV CL=1
[vf]  [in] 1920x800 vdpau BT.709 (HD)/TV CL=1
[vf]  [out] 1920x800 vdpau BT.709 (HD)/TV CL=1
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[cplayer] VO: [vdpau] 1920x800 => 1920x800 vdpau
[cplayer] VO: Description: VDPAU with X11
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
[vo/vdpau] Window size: 1615x800
[vo/vdpau] Video source: 1920x800 (1920x800)
[vo/vdpau] Video display: (0, 0) 1920x800 -> (0, 64) 1615x672
[vo/vdpau] Video scale: 0.841146/0.840000
[vo/vdpau] OSD borders: l=0 t=64 r=0 b=64
[vo/vdpau] Video borders: l=0 t=64 r=0 b=64
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[vo/vdpau] Recreating vdpau video mixer.
[global] user config path: 'fonts' -> '/home/nikos/.mpv/fonts'
[global] user config path: 'subfont.ttf' -> '/home/nikos/.mpv/subfont.ttf'
[global] user config path: 'fonts.conf' -> '/home/nikos/.mpv/fonts.conf'
[global] global config path: 'fonts.conf' -> '/etc/mpv/fonts.conf'
[global] any config path: 'fonts.conf' -> '(NULL)'
[osd/libass] Setting up fonts...
[osd/libass] Done.
[global] user config path: 'fonts' -> '/home/nikos/.mpv/fonts'
[global] user config path: 'subfont.ttf' -> '/home/nikos/.mpv/subfont.ttf'
[global] user config path: 'fonts.conf' -> '/home/nikos/.mpv/fonts.conf'
[global] global config path: 'fonts.conf' -> '/etc/mpv/fonts.conf'
[global] any config path: 'fonts.conf' -> '(NULL)'
[osd/libass] Setting up fonts...
[osd/libass] Done.
[global] user config path: 'fonts' -> '/home/nikos/.mpv/fonts'
[global] user config path: 'subfont.ttf' -> '/home/nikos/.mpv/subfont.ttf'
[global] user config path: 'fonts.conf' -> '/home/nikos/.mpv/fonts.conf'
[global] global config path: 'fonts.conf' -> '/etc/mpv/fonts.conf'
[global] any config path: 'fonts.conf' -> '(NULL)'
[osd/libass] Setting up fonts...
[osd/libass] Done.
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V:  0.000
[statusline] AV: 00:00:00 / 00:01:53 (0%) A-V: -0.000


Και σε youtube video (μιας και ένα αρκετά μεγάλο ποσοστό έχει απεξαρτηθεί από τον Flash player)
Κώδικας: Επιλογή όλων
mpv --hwdec=vdpau "https://www.youtube.com/watch?v=g2MG8icHo2Y&list=UUHugE6eRhqB9_AZQh4DDbIw"

Κώδικας: Επιλογή όλων
Playing: https://www.youtube.com/watch?v=g2MG8icHo2Y&list=UUHugE6eRhqB9_AZQh4DDbIw
[quvi] Checking URL...
File tags:
major_brand: mp42
minor_version: 0
compatible_brands: isommp42
creation_time: 2014-11-02 23:30:47
[stream] Video (+) --vid=1 (*) (h264)
[stream] Audio (+) --aid=1 --alang=und (*) (aac)
Trying to use hardware decoding.
AO: [pulse] 44100Hz stereo 2ch float
AV: 00:00:00 / 01:10:52 (0%) A-V:  0.000 Cache: 0%
VO: [vdpau] 1280x720 => 1280x720 vdpau
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.