gtk program not running correctly

Discuss Ubuntu related items.

gtk program not running correctly

Postby LaureateLee » Fri Apr 29, 2016 5:47 am

Hi everyone,

I am using Ubuntu 12.04 with X boot, but I can't get my GTK program run, after boot up

root@linaro-ubuntu-desktop:~# ps x
PID TTY STAT TIME COMMAND
1 ? Ss 0:02 /sbin/init
2 ? S 0:00 [kthreadd]
3 ? S 0:00 [ksoftirqd/0]
4 ? S 0:00 [kworker/0:0]
5 ? S 0:00 [kworker/u:0]
6 ? S 0:00 [migration/0]
7 ? S 0:00 [migration/1]
8 ? S 0:00 [kworker/1:0]
9 ? S 0:00 [ksoftirqd/1]
10 ? S< 0:00 [khelper]
11 ? S 0:00 [kworker/u:1]
278 ? S 0:00 [sync_supers]
280 ? S 0:00 [bdi-default]
282 ? S< 0:00 [kblockd]
298 ? S< 0:00 [imx6q-ecspi.1]
307 ? S 0:00 [khubd]
331 ? D 0:00 [ipu1_task]
332 ? D 0:00 [ipu1_task]
353 ? S< 0:00 [l2cap]
356 ? S 0:00 [kworker/0:1]
357 ? S< 0:00 [cfg80211]
449 ? S 0:00 [usb_wakeup thre]
451 ? S< 0:00 [otg_switch]
455 ? S 0:00 [usb_wakeup thre]
468 ? S 0:00 [kswapd0]
469 ? SN 0:00 [ksmd]
470 ? S 0:00 [fsnotify_mark]
523 ? S 0:00 [kapmd]
549 ? S 0:00 [kworker/1:1]
551 ? S 0:00 [file-storage]
554 ? S 0:00 [irq/424-max1180]
575 ? S 0:00 [kworker/u:2]
583 ? S< 0:00 [vpu_wq]
588 ? S< 0:00 [galcore workque]
589 ? S 0:00 [galcore daemon ]
590 ? S 0:00 [galcore daemon ]
626 ? R 0:16 [mmcqd/0]
627 ? S 0:00 [mmcqd/0boot0]
628 ? S 0:00 [mmcqd/0boot1]
653 ? S< 0:00 [krfcommd]
665 ? S 0:00 [jbd2/mmcblk0p1-]
666 ? S< 0:00 [ext4-dio-unwrit]
668 ? S 0:01 [mmcqd/2]
780 ? S 0:00 upstart-udev-bridge --daemon
810 ? Ss 0:00 /sbin/udevd --daemon
1345 ? S 0:00 /sbin/udevd --daemon
1346 ? S 0:00 /sbin/udevd --daemon
1348 ? Ss 0:00 /usr/sbin/bluetoothd
1349 ? S 0:00 [flush-179:0]
1356 ? Ss 0:00 /usr/sbin/cupsd -F
1381 ? S 0:00 [kworker/1:2]
1427 ? S 0:00 upstart-socket-bridge --daemon
1478 ? Ss 0:00 rpcbind -w
1565 ? Ss 0:00 /usr/sbin/sshd -D
1599 ? Ss 0:00 /usr/sbin/modem-manager
1635 ? Ssl 0:00 NetworkManager
1643 tty4 Ss+ 0:00 /sbin/getty -8 38400 tty4
1649 tty5 Ss+ 0:00 /sbin/getty -8 38400 tty5
1651 ttymxc0 Ss 0:00 /bin/login -f
1662 tty2 Ss+ 0:00 /sbin/getty -8 38400 tty2
1664 tty3 Ss+ 0:00 /sbin/getty -8 38400 tty3
1666 tty6 Ss+ 0:00 /sbin/getty -8 38400 tty6
1674 ? Ss 0:00 cron
1680 ? Ssl 0:00 lightdm
1685 ? Ss 0:00 /usr/sbin/apmd -P /etc/apm/apmd_proxy --proxy-timeout 30
1694 ? Ss 0:00 /usr/sbin/irqbalance
1753 tty7 Ss+ 0:00 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
1781 ttymxc0 S 0:01 -bash
1819 ? Sl 0:00 lightdm --session-child 12 15
1856 ? S 0:00 /bin/sh /etc/init.d/ondemand background
1860 ? S 0:00 sleep 60
1887 tty1 Ss 0:00 /bin/login -f
1912 tty1 S+ 0:00 -bash
2019 ? S 0:00 [flush-254:0]
2056 ttymxc0 R+ 0:00 ps x

I get error like follow , sd800gtk program no run


root@linaro-ubuntu-desktop:~/Eletech/bin# ./sd800gtk
sqlite database /mnt/sd/config/records.info ready
sd800gtk ready
No protocol specified
No protocol specified

(sd800gtk:2576): Gtk-WARNING **: cannot open display: :0.0

then I kill process X by kill 1753

ps x
PID TTY STAT TIME COMMAND
1 ? Ss 0:02 /sbin/init
2 ? S 0:00 [kthreadd]
3 ? S 0:00 [ksoftirqd/0]
4 ? S 0:00 [kworker/0:0]
5 ? S 0:00 [kworker/u:0]
6 ? S 0:00 [migration/0]
7 ? S 0:00 [migration/1]
9 ? S 0:00 [ksoftirqd/1]
10 ? S< 0:00 [khelper]
11 ? S 0:00 [kworker/u:1]
278 ? S 0:00 [sync_supers]
280 ? S 0:00 [bdi-default]
282 ? S< 0:00 [kblockd]
298 ? S< 0:00 [imx6q-ecspi.1]
307 ? S 0:00 [khubd]
331 ? D 0:00 [ipu1_task]
332 ? D 0:00 [ipu1_task]
353 ? S< 0:00 [l2cap]
356 ? S 0:00 [kworker/0:1]
357 ? S< 0:00 [cfg80211]
449 ? S 0:00 [usb_wakeup thre]
451 ? S< 0:00 [otg_switch]
455 ? S 0:00 [usb_wakeup thre]
468 ? S 0:00 [kswapd0]
469 ? SN 0:00 [ksmd]
470 ? S 0:00 [fsnotify_mark]
523 ? S 0:00 [kapmd]
549 ? S 0:01 [kworker/1:1]
551 ? S 0:00 [file-storage]
554 ? S 0:00 [irq/424-max1180]
583 ? S< 0:00 [vpu_wq]
588 ? S< 0:00 [galcore workque]
589 ? S 0:00 [galcore daemon ]
590 ? S 0:00 [galcore daemon ]
626 ? S 0:27 [mmcqd/0]
627 ? S 0:00 [mmcqd/0boot0]
628 ? S 0:00 [mmcqd/0boot1]
653 ? S< 0:00 [krfcommd]
665 ? S 0:00 [jbd2/mmcblk0p1-]
666 ? S< 0:00 [ext4-dio-unwrit]
668 ? S 0:04 [mmcqd/2]
780 ? S 0:00 upstart-udev-bridge --daemon
810 ? Ss 0:00 /sbin/udevd --daemon
1345 ? S 0:00 /sbin/udevd --daemon
1346 ? S 0:00 /sbin/udevd --daemon
1348 ? Ss 0:00 /usr/sbin/bluetoothd
1356 ? Ss 0:00 /usr/sbin/cupsd -F
1427 ? S 0:00 upstart-socket-bridge --daemon
1478 ? Ss 0:00 rpcbind -w
1565 ? Ss 0:00 /usr/sbin/sshd -D
1599 ? Ss 0:00 /usr/sbin/modem-manager
1635 ? Ssl 0:00 NetworkManager
1643 tty4 Ss+ 0:00 /sbin/getty -8 38400 tty4
1649 tty5 Ss+ 0:00 /sbin/getty -8 38400 tty5
1651 ttymxc0 Ss 0:00 /bin/login -f
1662 tty2 Ss+ 0:00 /sbin/getty -8 38400 tty2
1664 tty3 Ss+ 0:00 /sbin/getty -8 38400 tty3
1666 tty6 Ss+ 0:00 /sbin/getty -8 38400 tty6
1674 ? Ss 0:00 cron
1685 ? Ss 0:00 /usr/sbin/apmd -P /etc/apm/apmd_proxy --proxy-timeout 30
1694 ? Ss 0:03 /usr/sbin/irqbalance
1781 ttymxc0 S 0:01 -bash
1887 tty1 Ss 0:00 /bin/login -f
1912 tty1 S+ 0:00 -bash
2390 ? S 0:00 [kworker/1:0]
2395 ? S 0:00 [flush-179:0]
2399 ttymxc0 S 0:00 . sd800wdg
2400 ttymxc0 S 0:00 ./sd800cwf
2401 ttymxc0 S 0:00 ./sd800SQLproc
2402 ttymxc0 S 0:00 ./sd800recycle
2403 ttymxc0 SLl 0:19 ./sd800rec
2404 ? Z 0:00 [sh] <defunct>
2408 ? S 0:00 [flush-179:24]
2491 ? S 0:00 [kworker/u:2]
2492 ? S 0:00 [kworker/u:3]
2493 ? S 0:00 [kworker/u:4]
2494 ? S 0:00 [kworker/u:5]
2575 ttymxc0 S 0:00 ./sd800mplayer
2584 ? S 0:00 [kworker/1:2]
2603 ? Ss 0:00 /bin/bash /usr/share/xdiagnose/failsafeXServer lightdm
2622 ? S 0:00 xinit /usr/share/xdiagnose/failsafeXinit /etc/X11/xorg.conf.failsafe with-lightdm -- /usr/bin/X -br -once -
2623 tty8 S<s+ 0:00 /usr/bin/X :0 -br -once -config /etc/X11/xorg.conf.failsafe -logfile /var/log/Xorg.failsafe.log
2628 ? R 0:07 /bin/bash /usr/share/xdiagnose/failsafeXinit /etc/X11/xorg.conf.failsafe with-lightdm
2634 ttymxc0 R+ 0:00 ps x


it seems X restart into failsafe mode

then sd800gtk program run normaly, but cpu uage will go near 100%.

Help please! anyone?
LaureateLee
 
Posts: 4
Joined: Tue Sep 22, 2015 8:16 am

Re: gtk program not running correctly

Postby Tapani » Tue May 03, 2016 4:45 am

(sd800gtk:2576): Gtk-WARNING **: cannot open display: :0.0

This seems to be the problem?

Try
1. Setting your DISPLAY variable before starting your X11 program by
Code: Select all
export DISPLAY=:0


2. If still not working and error the same, try disabling X11 access controls (unsafe! but good for debugging) by either
a) Disabling access controls from a X terminal (with access rights) by
Code: Select all
xhost +


or

b) Pass the flag -ac to the X server

Good luck!
Tapani
Site Admin
 
Posts: 686
Joined: Tue Aug 27, 2013 8:32 am

Re: gtk program not running correctly

Postby LaureateLee » Wed May 11, 2016 2:42 am

Tapani ,

Thank Q, I 'll try.
LaureateLee
 
Posts: 4
Joined: Tue Sep 22, 2015 8:16 am

Re: gtk program not running correctly

Postby LaureateLee » Tue May 17, 2016 1:51 am

Tapani ,

I add -ac to X server,
the gtk program run normally, touch screen work correctly, but not windows show on screen. don't know why...
LaureateLee
 
Posts: 4
Joined: Tue Sep 22, 2015 8:16 am

Re: gtk program not running correctly

Postby LaureateLee » Tue May 17, 2016 6:31 am

after some more test, I found that, if windows smaller than 240*200 it will display, larger than this no show!!
LaureateLee
 
Posts: 4
Joined: Tue Sep 22, 2015 8:16 am


Return to Software - Ubuntu

Who is online

Users browsing this forum: Exabot [Bot] and 8 guests