bramp / libcec-daemon

A Linux daemon for connecting libcec to uinput. That is, using your TV to control your PC!
BSD 2-Clause "Simplified" License
65 stars 26 forks source link

No input on LXDE on Raspbian #6

Open shakaraba opened 11 years ago

shakaraba commented 11 years ago

Hi,

I am running libcec-daemon as pi user and from root user without problems from console. When I execute startx or sudo startx and enter LXDE the input is not passed to LXDE.

If i run libcec-daemon from LXDE it does not show any errors but doesn't work. I tried chmod 666 /dev/uinput without luck.

I does not show any errors in the libcec-daemon or in syslog.

I'm running Raspbian (2013-02-09) updated with libcec 2.0.5-1

bramp commented 11 years ago

Can you run libcec-daemon with extra logging (libcec-daemon -vv), and paste in the logs

On 7 March 2013 15:08, shakaraba notifications@github.com wrote:

Hi,

I am running libcec-daemon as pi user and from root user without problems from console. When I execute startx or sudo startx and enter LXDE the input is not passed to LXDE.

If i run libcec-daemon from LXDE it does not show any errors but doesn't work. I tried chmod 666 /dev/uinput without luck.

I does not show any errors in the libcec-daemon or in syslog.

I'm running Raspbian (2013-02-09) updated with libcec 2.0.5-1

— Reply to this email directly or view it on GitHubhttps://github.com/bramp/libcec-daemon/issues/6 .

shakaraba commented 11 years ago

Here are the logs:

pi@raspberrypi ~ $ sudo libcec-daemon -vv INFO - Opened /dev/uinput INFO - Created uinput device TRACE - Main::Main() TRACE - Main::loop() TRACE - Cec::open() DEBUG - Main::onCecLogMessage(1097 [D]unregistering all CEC clients) DEBUG - Main::onCecLogMessage(1100 [D]Broadcast (F): osd name set to 'Broadcast') DEBUG - Main::onCecLogMessage(1102 [D]InitHostCEC - vchiq_initialise succeeded) DEBUG - Main::onCecLogMessage(1104 [D]InitHostCEC - vchi_initialise succeeded) DEBUG - Main::onCecLogMessage(1105 [D]InitHostCEC - vchi_connect succeeded) DEBUG - Main::onCecLogMessage(1107 [D]logical address changed to Broadcast (f)) DEBUG - Main::onCecLogMessage(1109 [D]RegisterLogicalAddress - registering address e) DEBUG - Main::onCecLogMessage(1291 [D]logical address changed to Playback 1 (4)) DEBUG - Main::onCecLogMessage(1293 [D]logical address changed to Free use (e)) DEBUG - Main::onCecLogMessage(1294 [D]Open - vc_cec initialised) DEBUG - Main::onCecLogMessage(1296 [N]connection opened) DEBUG - Main::onCecLogMessage(1298 [D]<< Broadcast (F) -> TV (0): POLL) DEBUG - Main::onCecLogMessage(1300 [D]initiator 'Broadcast' is not supported by the CEC adapter. using 'Free use' instead) DEBUG - Main::onCecLogMessage(1301 [T]<< e0) DEBUG - Main::onCecLogMessage(1302 [D]processor thread started) DEBUG - Main::onCecLogMessage(1333 [D]>> POLL sent) DEBUG - Main::onCecLogMessage(1335 [D]TV (0): device status changed into 'present') DEBUG - Main::onCecLogMessage(1337 [D]<< requesting vendor ID of 'TV' (0)) DEBUG - Main::onCecLogMessage(1338 [T]<< e0:8c) DEBUG - Main::onCecLogMessage(1539 [T]>> 0f:87:00:00:f0) DEBUG - Main::onCecLogMessage(1541 [D]>> TV (0) -> Broadcast (F): device vendor id (87)) DEBUG - Main::onCecLogMessage(1543 [D]TV (0): vendor = Samsung (0000f0)) DEBUG - Main::onCecLogMessage(1545 [D]expected response received (87: device vendor id)) DEBUG - Main::onCecLogMessage(1547 [D]replacing the command handler for device 'TV' (0)) DEBUG - Main::onCecLogMessage(1548 [N]registering new CEC client - v2.0.5) DEBUG - Main::onCecLogMessage(1550 [D]detecting logical address for type 'playback device') DEBUG - Main::onCecLogMessage(1551 [D]trying logical address 'Playback 1') DEBUG - Main::onCecLogMessage(1553 [D]<< Playback 1 (4) -> Playback 1 (4): POLL) DEBUG - Main::onCecLogMessage(1554 [T]<< 44) DEBUG - Main::onCecLogMessage(1556 [D]UnregisterLogicalAddress - releasing previous logical address) DEBUG - Main::onCecLogMessage(1558 [D]logical address changed to Broadcast (f)) DEBUG - Main::onCecLogMessage(1560 [D]RegisterLogicalAddress - registering address 4) DEBUG - Main::onCecLogMessage(1741 [D]logical address changed to Free use (e)) DEBUG - Main::onCecLogMessage(1743 [D]logical address changed to Playback 1 (4)) DEBUG - Main::onCecLogMessage(1745 [T]<< 44) DEBUG - Main::onCecLogMessage(1746 [D]>> POLL not sent) DEBUG - Main::onCecLogMessage(1748 [D]using logical address 'Playback 1') DEBUG - Main::onCecLogMessage(1749 [D]Playback 1 (4): device status changed into 'handled by libCEC') DEBUG - Main::onCecLogMessage(1751 [D]Playback 1 (4): power status changed from 'unknown' to 'on') DEBUG - Main::onCecLogMessage(1752 [D]Playback 1 (4): CEC version 1.4) DEBUG - Main::onCecLogMessage(1754 [D]AllocateLogicalAddresses - device '0', type 'playback device', LA '4') DEBUG - Main::onCecLogMessage(1755 [D]Playback 1 (4): osd name set to 'linux PC') DEBUG - Main::onCecLogMessage(1757 [D]Playback 1 (4): menu language set to 'eng') DEBUG - Main::onCecLogMessage(1759 [D]GetPhysicalAddress - physical address = 1000) DEBUG - Main::onCecLogMessage(1760 [D]AutodetectPhysicalAddress - autodetected physical address '1000') DEBUG - Main::onCecLogMessage(1762 [D]Playback 1 (4): physical address changed from ffff to 1000) DEBUG - Main::onCecLogMessage(1763 [D]<< Playback 1 (4) -> broadcast (F): physical adddress 1000) DEBUG - Main::onCecLogMessage(1765 [T]<< 4f:84:10:00:04) DEBUG - Main::onCecLogMessage(1917 [D]making Playback 1 (4) the active source) DEBUG - Main::onCecLogMessage(1918 [D]TV (0): power status changed from 'unknown' to 'in transition from standby to on') DEBUG - Main::onCecLogMessage(1920 [N]>> source activated: Playback 1 (4)) DEBUG - Main::onCecLogMessage(1921 [D]scheduling active source message for 'Playback 1') DEBUG - Main::onCecLogMessage(1923 [N]CEC client registered: libCEC version = 2.0.5, client version = 2.0.5, firmware version = 1, logical address(es) = Playback 1 (4) , physical address: 1.0.0.0, host: armv6l-unknown-linux-gnueabihf, features: 'P8 USB' 'P8 USB detect' 'RPi', git revision: 576bebd, compiled on: Fri Dec 28 12:45:36 UTC 2012 by pi@raspberrypi on Linux 3.2.27+ (armv6l)) DEBUG - Main::onCecLogMessage(1925 [D]<< Playback 1 (4) -> TV (0): OSD name 'linux PC') DEBUG - Main::onCecLogMessage(1927 [T]<< 40:47:6c:69:6e:75:78:20:50:43) DEBUG - Main::onCecLogMessage(2199 [D]<< requesting power status of 'TV' (0)) DEBUG - Main::onCecLogMessage(2200 [T]<< 40:8f) DEBUG - Main::onCecLogMessage(2347 [T]>> 04:90:00) DEBUG - Main::onCecLogMessage(2348 [D]>> TV (0) -> Playback 1 (4): report power status (90)) DEBUG - Main::onCecLogMessage(2350 [D]TV (0): power status changed from 'in transition from standby to on' to 'on') DEBUG - Main::onCecLogMessage(2352 [D]expected response received (90: report power status)) INFO - Opened Raspberry Pi DEBUG - Main::onCecLogMessage(2355 [D]Playback 1 (4) was already marked as active source) DEBUG - Main::onCecLogMessage(2356 [D]sending active source message for 'Playback 1') DEBUG - Main::onCecLogMessage(2358 [T]<< 40:04) DEBUG - Main::onCecLogMessage(2420 [N]<< Playback 1 (4) -> broadcast (F): active source (1000)) DEBUG - Main::onCecLogMessage(2421 [T]<< 4f:82:10:00) DEBUG - Main::onCecLogMessage(2544 [D]<< Playback 1 (4) -> TV (0): menu state 'activated') DEBUG - Main::onCecLogMessage(2545 [T]<< 40:8e:00) TRACE - Loop DEBUG - Main::onCecLogMessage(2716 [T]>> 04:8d:02) DEBUG - Main::onCecLogMessage(2717 [D]>> TV (0) -> Playback 1 (4): menu request (8D)) DEBUG - Main::onCecLogMessage(2719 [D]<< Playback 1 (4) -> TV (0): menu state 'activated') DEBUG - Main::onCecLogMessage(2721 [T]<< 40:8e:00) DEBUG - Main::onCecLogMessage(2895 [T]>> 04:1a:01) DEBUG - Main::onCecLogMessage(2896 [D]>> TV (0) -> Playback 1 (4): give deck status (1A)) DEBUG - Main::onCecLogMessage(2898 [D]<< Playback 1 (4) -> TV (0): deck status 'stop') DEBUG - Main::onCecLogMessage(2899 [T]<< 40:1b:1a) TRACE - Loop TRACE - Loop DEBUG - Main::onCecLogMessage(12419 [T]>> 04:44:03) DEBUG - Main::onCecLogMessage(12420 [D]>> TV (0) -> Playback 1 (4): user control pressed (44)) DEBUG - Main::onCecLogMessage(12420 [D]key pressed: left (3)) DEBUG - Main::onCecKeyPress(Key press: LEFT for 0ms) DEBUG - sent 105 TRACE - Loop DEBUG - Main::onCecLogMessage(13422 [D]key auto-released: left (3)) DEBUG - Main::onCecKeyPress(Key press: LEFT for 1002ms) DEBUG - sent 105 TRACE - Loop DEBUG - Main::onCecLogMessage(13816 [T]>> 04:44:04) DEBUG - Main::onCecLogMessage(13817 [D]>> TV (0) -> Playback 1 (4): user control pressed (44)) DEBUG - Main::onCecLogMessage(13819 [D]key pressed: right (4)) DEBUG - Main::onCecKeyPress(Key press: RIGHT for 0ms) DEBUG - sent 106 TRACE - Loop DEBUG - Main::onCecLogMessage(14824 [D]key auto-released: right (4)) DEBUG - Main::onCecKeyPress(Key press: RIGHT for 1005ms) DEBUG - sent 106 DEBUG - Main::onCecLogMessage(15156 [T]>> 04:44:00) DEBUG - Main::onCecLogMessage(15157 [D]>> TV (0) -> Playback 1 (4): user control pressed (44)) DEBUG - Main::onCecLogMessage(15159 [D]key pressed: select (0)) DEBUG - Main::onCecKeyPress(Key press: SELECT for 0ms) DEBUG - sent 28 TRACE - Loop DEBUG - Main::onCecLogMessage(16171 [D]key auto-released: select (0)) DEBUG - Main::onCecKeyPress(Key press: SELECT for 1012ms) DEBUG - sent 28 TRACE - Loop

Here I run startx and when the LXDE is loaded and mouse and keyboard are working I press LEFT, RIGHT AND CENTER but is not working on LXDE

TRACE - Loop DEBUG - Main::onCecLogMessage(26421 [T]>> 04:44:03) DEBUG - Main::onCecLogMessage(26421 [D]>> TV (0) -> Playback 1 (4): user control pressed (44)) DEBUG - Main::onCecLogMessage(26421 [D]key pressed: left (3)) DEBUG - Main::onCecKeyPress(Key press: LEFT for 0ms) DEBUG - sent 105 TRACE - Loop DEBUG - Main::onCecLogMessage(27345 [T]>> 04:44:04) DEBUG - Main::onCecLogMessage(27347 [D]>> TV (0) -> Playback 1 (4): user control pressed (44)) DEBUG - Main::onCecLogMessage(27349 [D]key released: left (3)) DEBUG - Main::onCecKeyPress(Key press: LEFT for 928ms) DEBUG - sent 105 DEBUG - Main::onCecLogMessage(27353 [D]key pressed: right (4)) DEBUG - Main::onCecKeyPress(Key press: RIGHT for 0ms) DEBUG - sent 106 TRACE - Loop DEBUG - Main::onCecLogMessage(28358 [D]key auto-released: right (4)) DEBUG - Main::onCecKeyPress(Key press: RIGHT for 1005ms) DEBUG - sent 106 DEBUG - Main::onCecLogMessage(28546 [T]>> 04:44:00) DEBUG - Main::onCecLogMessage(28548 [D]>> TV (0) -> Playback 1 (4): user control pressed (44)) DEBUG - Main::onCecLogMessage(28549 [D]key pressed: select (0)) DEBUG - Main::onCecKeyPress(Key press: SELECT for 0ms) DEBUG - sent 28 TRACE - Loop DEBUG - Main::onCecLogMessage(29554 [D]key auto-released: select (0)) DEBUG - Main::onCecKeyPress(Key press: SELECT for 1005ms) DEBUG - sent 28 TRACE - Loop TRACE - Loop

Here I exit LXDE and return to console Stop the daemon

^CDEBUG - Main::signalHandler() TRACE - Main::stop() DEBUG - Main::onCecLogMessage(44988 [D]marking Playback 1 (4) as inactive source) DEBUG - Main::onCecLogMessage(44988 [N]>> source deactivated: Playback 1 (4)) DEBUG - Main::onCecLogMessage(44988 [N]<< Playback 1 (4) -> broadcast (F): inactive source) DEBUG - Main::onCecLogMessage(44989 [T]<< 40:9d:10:00) DEBUG - Main::onCecLogMessage(45109 [D]unregistering all CEC clients) DEBUG - Main::onCecLogMessage(45111 [N]unregistering client: libCEC version = 2.0.5, client version = 2.0.5, firmware version = 1, logical address(es) = Playback 1 (4) , physical address: 1.0.0.0, host: armv6l-unknown-linux-gnueabihf, features: 'P8 USB' 'P8 USB detect' 'RPi', git revision: 576bebd, compiled on: Fri Dec 28 12:45:36 UTC 2012 by pi@raspberrypi on Linux 3.2.27+ (armv6l)) DEBUG - Main::onCecLogMessage(45113 [D]Playback 1 (4): power status changed from 'on' to 'unknown') DEBUG - Main::onCecLogMessage(45114 [D]Playback 1 (4): CEC version unknown) DEBUG - Main::onCecLogMessage(45116 [D]Playback 1 (4): osd name set to 'Playback 1') DEBUG - Main::onCecLogMessage(45117 [D]Playback 1 (4): device status changed into 'unknown') DEBUG - Main::onCecLogMessage(45118 [D]unregistering all CEC clients) DEBUG - Main::onCecLogMessage(45120 [D]UnregisterLogicalAddress - releasing previous logical address) DEBUG - Main::onCecLogMessage(45122 [D]logical address changed to Broadcast (f)) TRACE - Main::~Main() TRACE - Main::stop()

i have researched a little and see if Xorg evdev driver is the fault. Here is my config file and the log from Xorg.

Config:

Section "InputClass" Identifier "evdev pointer catchall" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection

Section "InputClass" Identifier "evdev keyboard catchall" MatchIsKeyboard "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection

Section "InputClass" Identifier "evdev touchpad catchall" MatchIsTouchpad "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection

Section "InputClass" Identifier "evdev tablet catchall" MatchIsTablet "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection

Section "InputClass" Identifier "evdev touchscreen catchall" MatchIsTouchscreen "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection

Log:

710.853 config/udev: Adding input device Device USB Device (/dev/input/event2) 710.853 Device USB Device: Applying InputClass "evdev keyboard catchall" 710.853 Using input driver 'evdev' for 'Device USB Device' 710.853 Device USB Device: always reports core events 710.854 evdev: Device USB Device: Device: "/dev/input/event2" 710.854 evdev: Device USB Device: Vendor 0x4d9 Product 0x22 710.854 evdev: Device USB Device: Found keys 710.854 evdev: Device USB Device: Configuring as keyboard 710.854 Option "config_info" "udev:/sys/devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.2/input/input2/event2" 710.854 XINPUT: Adding extended input device "Device USB Device" (type: KEYBOARD, id 8) 710.854 Option "xkb_rules" "evdev" 710.855 Option "xkb_model" "pc105" 710.855 Option "xkb_layout" "es" 710.855 Option "xkb_options" "compose:ralt" 710.859 config/udev: Adding input device libcec-daemon (/dev/input/event3) 710.859 libcec-daemon: Applying InputClass "evdev keyboard catchall" 710.859 Using input driver 'evdev' for 'libcec-daemon' 710.859 libcec-daemon: always reports core events 710.860 evdev: libcec-daemon: Device: "/dev/input/event3" 710.860 evdev: libcec-daemon: Vendor 0x1 Product 0x1 710.860 evdev: libcec-daemon: Found keys 710.860 evdev: libcec-daemon: Configuring as keyboard 710.860 Option "config_info" "udev:/sys/devices/virtual/input/input9/event3" 710.860 XINPUT: Adding extended input device "libcec-daemon" (type: KEYBOARD, id 9) 710.861 Option "xkb_rules" "evdev" 710.861 Option "xkb_model" "pc105" 710.861 Option "xkb_layout" "es" 710.861 Option "xkb_options" "compose:ralt" 710.890 FBDEV(0): FBIOBLANK: Operation not permitted // This is a normal error in the pi 733.250 evdev: Device USB Device: Close 733.250 UnloadModule: "evdev" 733.260 evdev: Device USB Device: Close 733.260 UnloadModule: "evdev" 733.261 evdev: Device USB Device: Close 733.261 UnloadModule: "evdev" 733.261 evdev: libcec-daemon: Close 733.262 UnloadModule: "evdev" [ 733.333] Server terminated successfully (0). Closing log file.

The libcec-daemon is configured as keyboard but is not working, maybe this config is remapping the keys or something. If i remove the config file the keyboard and the libcec-daemon are not configured as keyboards but are not working.

phippodoplis commented 11 years ago

Not working for me either, not on Raspbian but PC with Debian Wheezy so likely the same problem with uinput. I'll see if I can knock up a test script to send keys to uinput like libcec-demon does.

phippodoplis commented 11 years ago

After this commit SHA: ab5a3c1f8fa83c80801ae19a1bc38736dbeee1e6 I can hack src/main.cpp to send a few events and it does work with mythfrontend (and xev). Will try on the real system on Friday and report back.

phippodoplis commented 11 years ago

It's working, sort of. I get key events but holding down a button does not give repeats. The commit above does not make much sense, why does the version of libcec affect the type of events sent to uinput? I would have thought that you send KEY_REPEAT if you haven't sent a KEY_UP and send a KEY_PRESSED otherwise.

phippodoplis commented 11 years ago

Not sure what's happening but I am getting key repeats working now.