2

我有一个嵌入式平台,它有 2 个图形层(/dev/fb0 和 /dev/fb1)。

我想使用 2 个单独的进程:一个直接使用 /dev/fb0(原始模式,无视频库)。另一个通过directfb使用/dev/fb1。

我可以启动第一个,它运行良好(我正在使用 linux open 函数打开 /dev/fb0 并直接写入)。

当我尝试启动第二个时,它卡在了 directfb 初始化中。

如果我尝试使用 /dev/fb1,我无法理解为什么 directFb 会锁定 /dev/fb0。

根据@shodanex 的要求,这是第二个进程的 strace 输出:

[pid  1483] open("/etc/directfbrc", O_RDONLY) = 7
[pid  1483] fstat64(7, {st_mode=S_IFREG|0755, st_size=472, ...}) = 0
[pid  1483] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2f375000
[pid  1483] read(7, "system=fbdev\n#no-vt\n#no-vt-switc"..., 4096) = 472
[pid  1483] write(2, "(!) DirectFB/Config \'depth\': OK!"..., 39(!) DirectFB/Config 'depth': OK!!!! 32
) = 39
[pid  1483] read(7, "", 4096)           = 0
[pid  1483] close(7)                    = 0
[pid  1483] munmap(0x2f375000, 4096)    = 0
[pid  1483] open("/root/.directfbrc", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] write(2, "\n     =======================|  "..., 270
 =======================|  DirectFB 1.0.1  |=======================
      (c) 2001-2007  The DirectFB Organization (directfb.org)
      (c) 2000-2004  Convergence (integrated media) GmbH
    ------------------------------------------------------------

) = 270
[pid  1483] gettid()                    = 1483
[pid  1483] rt_sigaction(SIGHUP, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {SIG_DFL}, 8) = 0
[pid  1483] rt_sigaction(SIGINT, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {SIG_DFL}, 8) = 0
[pid  1483] rt_sigaction(SIGTERM, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {SIG_DFL}, 8) = 0
[pid  1483] rt_sigaction(SIGABRT, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {SIG_DFL}, 8) = 0
[pid  1483] rt_sigaction(SIGFPE, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {0x29d6f860, [], 0}, 8) = 0
[pid  1483] rt_sigaction(SIGILL, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {0x29d6f860, [], 0}, 8) = 0
[pid  1483] rt_sigaction(SIGQUIT, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {SIG_DFL}, 8) = 0
[pid  1483] rt_sigaction(SIGSEGV, {0x2a323fc0, [], SA_SIGINFO}, {0x29d6f860, [], 0}, 8) = 0
[pid  1483] rt_sigaction(SIGTRAP, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {SIG_DFL}, 8) = 0
[pid  1483] rt_sigaction(SIGBUS, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {0x29d6f860, [], 0}, 8) = 0
[pid  1483] rt_sigaction(SIGXCPU, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {SIG_DFL}, 8) = 0
[pid  1483] rt_sigaction(SIGXFSZ, {0x2a323fc0, [], SA_NOMASK|SA_SIGINFO}, {SIG_DFL}, 8) = 0
[pid  1483] write(2, "(*) DirectFB/Core: Single Applic"..., 64(*) DirectFB/Core: Single Application Core. (2010-03-25 20:40) 
) = 64
[pid  1483] open("/usr/lib/libdirectfb-1.0.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/lib/directfb-1.0-0/systems", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 7
[pid  1483] fstat64(7, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid  1483] fcntl64(7, F_SETFD, FD_CLOEXEC) = 0
[pid  1483] getdents(7, /* 10 entries */, 4096) = 288
[pid  1483] open("/usr/lib/directfb-1.0-0/systems/libdirectfb_fbdev.so", O_RDONLY) = 8
[pid  1483] read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0*\0\1\0\0\0\200&\0\0004\0\0\0"..., 512) = 512
[pid  1483] fstat64(8, {st_mode=S_IFREG|0755, st_size=59543, ...}) = 0
[pid  1483] old_mmap(NULL, 115640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 8, 0) = 0x2f378000
[pid  1483] mprotect(0x2f384000, 65536, PROT_NONE) = 0
[pid  1483] old_mmap(0x2f394000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 8, 0xc000) = 0x2f394000
[pid  1483] close(8)                    = 0
[pid  1483] open("/usr/lib/directfb-1.0-0/systems/libdirectfb_x11.so", O_RDONLY) = 8
[pid  1483] read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0*\0\1\0\0\0\200\35\0\0004\0\0\0"..., 512) = 512
[pid  1483] fstat64(8, {st_mode=S_IFREG|0755, st_size=25273, ...}) = 0
[pid  1483] old_mmap(NULL, 83288, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 8, 0) = 0x2f398000
[pid  1483] mprotect(0x2f39d000, 61440, PROT_NONE) = 0
[pid  1483] old_mmap(0x2f3ac000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 8, 0x4000) = 0x2f3ac000
[pid  1483] close(8)                    = 0
[pid  1483] open("/usr/local/lib/mylibs/libX11.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/local/lib/libX11.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/lib/libX11.so.6", O_RDONLY) = 8
[pid  1483] read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0*\0\1\0\0\0\340\205\1\0004\0\0\0"..., 512) = 512
[pid  1483] fstat64(8, {st_mode=S_IFREG|0755, st_size=953468, ...}) = 0
[pid  1483] old_mmap(NULL, 895116, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 8, 0) = 0x2f3b0000
[pid  1483] mprotect(0x2f477000, 65536, PROT_NONE) = 0
[pid  1483] old_mmap(0x2f487000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 8, 0xc7000) = 0x2f487000
[pid  1483] close(8)                    = 0
[pid  1483] open("/usr/local/lib/mylibs/libXext.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/local/lib/libXext.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/lib/libXext.so.6", O_RDONLY) = 8
[pid  1483] read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0*\0\1\0\0\0\340)\0\0004\0\0\0"..., 512) = 512
[pid  1483] fstat64(8, {st_mode=S_IFREG|0755, st_size=61440, ...}) = 0
[pid  1483] old_mmap(NULL, 114084, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 8, 0) = 0x2f48c000
[pid  1483] mprotect(0x2f498000, 61440, PROT_NONE) = 0
[pid  1483] old_mmap(0x2f4a7000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 8, 0xb000) = 0x2f4a7000
[pid  1483] close(8)                    = 0
[pid  1483] open("/usr/local/lib/mylibs/libxcb-xlib.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/local/lib/libxcb-xlib.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/lib/libxcb-xlib.so.0", O_RDONLY) = 8
[pid  1483] read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0*\0\1\0\0\0\300\5\0\0004\0\0\0"..., 512) = 512
[pid  1483] fstat64(8, {st_mode=S_IFREG|0755, st_size=5786, ...}) = 0
[pid  1483] old_mmap(NULL, 68112, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 8, 0) = 0x2f4a8000
[pid  1483] mprotect(0x2f4a9000, 61440, PROT_NONE) = 0
[pid  1483] old_mmap(0x2f4b8000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 8, 0) = 0x2f4b8000
[pid  1483] close(8)                    = 0
[pid  1483] open("/usr/local/lib/mylibs/libxcb.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/local/lib/libxcb.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  1483] open("/usr/lib/libxcb.so.1", O_RDONLY) = 8
[pid  1483] read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0*\0\1\0\0\0\300u\0\0004\0\0\0"..., 512) = 512
[pid  1483] fstat64(8, {st_mode=S_IFREG|0755, st_size=112671, ...}) = 0
[pid  1483] old_mmap(NULL, 144212, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 8, 0) = 0x2f4bc000
[pid  1483] mprotect(0x2f4cf000, 65536, PROT_NONE) = 0
[pid  1483] old_mmap(0x2f4df000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 8, 0x13000) = 0x2f4df000
[pid  1483] close(8)                    = 0
[pid  1483] open("/usr/lib/libXau.so.6", O_RDONLY) = 8
[pid  1483] read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0*\0\1\0\0\0\240\n\0\0004\0\0\0"..., 512) = 512
[pid  1483] fstat64(8, {st_mode=S_IFREG|0755, st_size=10880, ...}) = 0
[pid  1483] old_mmap(NULL, 71644, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 8, 0) = 0x2f4e0000
[pid  1483] mprotect(0x2f4e2000, 61440, PROT_NONE) = 0
[pid  1483] old_mmap(0x2f4f1000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 8, 0x1000) = 0x2f4f1000
[pid  1483] close(8)                    = 0
[pid  1483] open("/usr/lib/libXdmcp.so.6", O_RDONLY) = 8
[pid  1483] read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0*\0\1\0\0\0\0\20\0\0004\0\0\0"..., 512) = 512
[pid  1483] fstat64(8, {st_mode=S_IFREG|0755, st_size=23841, ...}) = 0
[pid  1483] old_mmap(NULL, 80376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 8, 0) = 0x2f4f4000
[pid  1483] mprotect(0x2f4f8000, 61440, PROT_NONE) = 0
[pid  1483] old_mmap(0x2f507000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 8, 0x3000) = 0x2f507000
[pid  1483] close(8)                    = 0
[pid  1483] getdents(7, /* 0 entries */, 4096) = 0
[pid  1483] close(7)                    = 0
[pid  1483] munmap(0x2f398000, 83288)   = 0
[pid  1483] munmap(0x2f48c000, 114084)  = 0
[pid  1483] munmap(0x2f3b0000, 895116)  = 0
[pid  1483] munmap(0x2f4a8000, 68112)   = 0
[pid  1483] munmap(0x2f4bc000, 144212)  = 0
[pid  1483] munmap(0x2f4e0000, 71644)   = 0
[pid  1483] munmap(0x2f4f4000, 80376)   = 0
[pid  1483] open("/dev/fb1", O_RDWR)    = 7
[pid  1483] fcntl64(7, F_SETFD, FD_CLOEXEC) = 0
[pid  1483] setsid()                    = 1483
[pid  1483] open("/dev/tty0", O_RDONLY|O_NOCTTY) = 8
[pid  1483] ioctl(8, 0x5603, 0x7bbc1d2a) = 0
[pid  1483] ioctl(8, 0x5600, 0x497658)  = 0
[pid  1483] ioctl(7, 0x460f, 0x7bbc1d18) = 0
[pid  1483] fstat64(7, {st_mode=S_IFCHR|0600, st_rdev=makedev(29, 1), ...}) = 0
[pid  1483] ioctl(7, 0x4610, 0x7bbc1c28) = 0
[pid  1483] ioctl(8, 0x5606, 0x2)       = 0

请注意,directfb 读取 /etc/directfbrc 文件(提前检查其内容)。之后不会打印任何内容。

system=fbdev
fbdev=/dev/fb1
primary-layer=1
no-cursor
bg-color=00000000
disable-module=lirc
disable-module=keyboard
disable-module=ps2mouse
mode=1280x720-60
pixelformat=ARGB
depth=32
hardware
desktop-buffer-mode=backvideo

有什么想法吗?再次非常感谢。

4

2 回答 2

1

您能否提供更多信息:

  • 当第一个进程未启动时,直接 FB 是否有效?
  • 你怎么知道 directfb 正在锁定 /dev/fb0 ?

Linux FB 是一个内核驱动程序,您可以使用任何您想使用的用户空间程序,/dev/fb<x>例如 directFB

DirectFB 是一个用户空间库,它与 Linux 帧缓冲区一起工作。

所以答案肯定是肯定的,你可以在 上使用自己的程序,在 上/dev/fb0使用 DirectFB 程序/dev/fb1。也许您应该strace您的 directfb 程序以了解它为什么会卡住。

于 2011-02-03T14:59:54.583 回答
0

我发现有必要指示应用程序不要切换图形模式。我设法使这两个应用程序一起运行。没有锁定情况了。

现在我正在尝试运行我的实际程序,但是 QT 正在杀死我,因为它忽略了 nographicsmodeswitch 参数。我正在努力,我相信它迟早会奏效。

如果这里有人是 QT 专家,我将不胜感激。

感谢 shodanex,您的 strace 建议非常有用。

于 2011-02-03T19:34:14.000 回答