From owner-freebsd-questions@FreeBSD.ORG Thu Feb 10 14:37:38 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40196106566B for ; Thu, 10 Feb 2011 14:37:38 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id E95C48FC17 for ; Thu, 10 Feb 2011 14:37:37 +0000 (UTC) Received: by vws9 with SMTP id 9so874366vws.13 for ; Thu, 10 Feb 2011 06:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=TcncJHl14lz4O7FcqTyA6Kja+7FgScFLkgqRrXjaV0A=; b=j0GoOA81c2pomZ24w+cU8RZkf2mrZKirbXTZKP2LGc17F/UzjQkN9rtO7r+aHYTJFf 3/vkuvLEn0R90dwlFpPz++e/dBK+lzZKRtVCLsbU8FGiF8qRYkFUooVkXmxviRXFAIOq 65aqMZkNZIyg+vvVTYgPy1xpNOPacr6DByZSk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=fSGesXb4gcFythPqVNFCdfKFgDrxyCzBqeleFsFdnG+TEdbupaYST/AmEJeEDY0Rhb W8EAVpdozDa74HSeQyN8b0kSDuknw8DUPN9ksEQYdlKtqjK8cqplmfwe7JC0wqHUVBJc Ym0hs3NfXvqeXX9LfvqeVIvK4O1KcZp0ZA3GE= Received: by 10.220.184.2 with SMTP id ci2mr5551146vcb.162.1297348656882; Thu, 10 Feb 2011 06:37:36 -0800 (PST) Received: from localhost ([109.123.119.163]) by mx.google.com with ESMTPS id u4sm39563vch.36.2011.02.10.06.37.34 (version=SSLv3 cipher=OTHER); Thu, 10 Feb 2011 06:37:35 -0800 (PST) From: Anonymous To: David Demelier References: <4D50F6F8.6070100@gmail.com> Date: Thu, 10 Feb 2011 17:37:21 +0300 In-Reply-To: <4D50F6F8.6070100@gmail.com> (David Demelier's message of "Tue, 08 Feb 2011 08:55:36 +0100") Message-ID: <86k4h8arby.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-questions@freebsd.org Subject: Re: VESA and SDL in tty terminal X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2011 14:37:38 -0000 David Demelier writes: > Hello, > > The SDL's pkg-message says we can use video driver in tty terminal. > > To do this you have to load the vesa kernel module or enable it in your > kernel, and set environment variable "SDL_VIDEODRIVER=vgl". > > I tried it with mplayer : > > $ SDL_VIDEODRIVER=vgl; export SDL_VIDEODRIVER > $ mplayer -vo sdl [...] > [VO_SDL] Set_fullmode: SDL_SetVideoMode failed: Unable to switch to > requested mode. IIRC, vgl(3) mode setting unlike vidcontrol(8) doesn't work as regular user. Try running mplayer under root, e.g. $ sudo mplayer -msgmodule -msglevel vo=9 -vo sdl [...] DEMUX: VIDEO: [avc1] 1280x720 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s) VIDEOOUT: SDL: Opening Plugin VIDEOOUT: [VO_SDL] Using driver: vgl. VIDEOOUT: X11 opening display: VIDEOOUT: vo: couldn't open the X11 display ()! [...] CPLAYER: Starting playback... CPLAYER: Movie-Aspect is 1.78:1 - prescaling to correct movie aspect. CPLAYER: VO: [sdl] 1280x720 => 1280x720 Planar YV12 VIDEOOUT: SDL: Using 0x32315659 (Planar YV12) image format VIDEOOUT: SDL: using hardware-surface VIDEOOUT: SDL: setting zoomed fullscreen with modeswitching VIDEOOUT: SDL Mode: 0: 1600 x 1200 VIDEOOUT: SDL Mode: 1: 1280 x 1024 VIDEOOUT: SDL Mode: 2: 1024 x 768 VIDEOOUT: SDL Mode: 3: 800 x 600 VIDEOOUT: SDL Mode: 4: 640 x 400 VIDEOOUT: SDL Mode: 5: 640 x 480 VIDEOOUT: SDL Mode: 6: 320 x 240 VIDEOOUT: SDL Mode: 7: 320 x 400 VIDEOOUT: SDL Mode: 8: 320 x 200 VIDEOOUT: SET SDL Mode: 1: 1280 x 1024 In case your keymap doesn't work under vo_sdl(vgl) try below workaround %% Index: multimedia/mplayer/files/patch-vgl-xlate_keys =================================================================== RCS file: multimedia/mplayer/files/patch-vgl-xlate_keys diff -N multimedia/mplayer/files/patch-vgl-xlate_keys --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multimedia/mplayer/files/patch-vgl-xlate_keys 10 Feb 2011 14:34:43 -0000 @@ -0,0 +1,62 @@ + use character codes for vgl driver + +--- configure~ ++++ configure +@@ -4579,6 +4579,19 @@ EOF + fi + fi + if test "$_sdl" = yes ; then ++ cat > $TMPC << EOF ++#ifdef CONFIG_SDL_SDL_H ++#include ++#else ++#include ++#endif ++int main(void) { SDL_VIDEO_DRIVER_VGL; return 0; } ++EOF ++ if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp -lvgl || cc_check $_inc_tmp -lvgl ; then ++ _ld_tmp="$_ld_tmp -lvgl" ++ fi ++fi ++if test "$_sdl" = yes ; then + def_sdl='#define CONFIG_SDL 1' + extra_cflags="$extra_cflags $_inc_tmp" + libs_mplayer="$libs_mplayer $_ld_tmp" +--- libvo/sdl_common.c~ ++++ libvo/sdl_common.c +@@ -27,6 +27,11 @@ + #include "input/mouse.h" + #include "video_out.h" + ++#ifdef SDL_VIDEO_DRIVER_VGL ++#include ++#include ++#endif ++ + static int old_w; + static int old_h; + static int mode_flags; +@@ -44,6 +49,9 @@ int vo_sdl_init(void) + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, 100 /*SDL_DEFAULT_REPEAT_INTERVAL*/); + + // Easiest way to get uppercase characters ++#ifdef SDL_VIDEO_DRIVER_VGL ++ VGLKeyboardInit(VGL_XLATEKEYS); ++#endif + SDL_EnableUNICODE(1); + + // We don't want those in our event queue. +@@ -56,8 +64,12 @@ int vo_sdl_init(void) + + void vo_sdl_uninit(void) + { +- if (SDL_WasInit(SDL_INIT_VIDEO)) ++ if (SDL_WasInit(SDL_INIT_VIDEO)) { ++#ifdef SDL_VIDEO_DRIVER_VGL ++ VGLKeyboardInit(VGL_CODEKEYS); ++#endif + SDL_QuitSubSystem(SDL_INIT_VIDEO); ++ } + } + + void vo_sdl_fullscreen(void) %%