From 57f0f512b273f60d52568b8c6b77e17f5636edc0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Wed, 5 Aug 2015 17:04:01 -0300 Subject: Initial import --- .../DocBook/media/v4l/remote_controllers.xml | 320 +++++++++++++++++++++ 1 file changed, 320 insertions(+) create mode 100644 Documentation/DocBook/media/v4l/remote_controllers.xml (limited to 'Documentation/DocBook/media/v4l/remote_controllers.xml') diff --git a/Documentation/DocBook/media/v4l/remote_controllers.xml b/Documentation/DocBook/media/v4l/remote_controllers.xml new file mode 100644 index 000000000..5124a6c4d --- /dev/null +++ b/Documentation/DocBook/media/v4l/remote_controllers.xml @@ -0,0 +1,320 @@ + + + +Mauro +Chehab +Carvalho +
m.chehab@samsung.com
+Initial version. +
+
+ + 2009-2014 + Mauro Carvalho Chehab + + + + + +3.15 +2014-02-06 +mcc +Added the interface description and the RC sysfs class description. + + +1.0 +2009-09-06 +mcc +Initial revision + + +
+ + Remote Controller API + + +Remote Controllers + +
+Introduction + +Currently, most analog and digital devices have a Infrared input for remote controllers. Each +manufacturer has their own type of control. It is not rare for the same manufacturer to ship different +types of controls, depending on the device. +A Remote Controller interface is mapped as a normal evdev/input interface, just like a keyboard or a mouse. +So, it uses all ioctls already defined for any other input devices. +However, remove controllers are more flexible than a normal input device, as the IR +receiver (and/or transmitter) can be used in conjunction with a wide variety of different IR remotes. +In order to allow flexibility, the Remote Controller subsystem allows controlling the +RC-specific attributes via the sysfs class nodes. +
+ +
+Remote Controller's sysfs nodes +As defined at Documentation/ABI/testing/sysfs-class-rc, those are the sysfs nodes that control the Remote Controllers: + +
+/sys/class/rc/ +The /sys/class/rc/ class sub-directory belongs to the Remote Controller +core and provides a sysfs interface for configuring infrared remote controller receivers. + + +
+
+/sys/class/rc/rcN/ +A /sys/class/rc/rcN directory is created for each remote + control receiver device where N is the number of the receiver. + +
+
+/sys/class/rc/rcN/protocols +Reading this file returns a list of available protocols, something like: +rc5 [rc6] nec jvc [sony] +Enabled protocols are shown in [] brackets. +Writing "+proto" will add a protocol to the list of enabled protocols. +Writing "-proto" will remove a protocol from the list of enabled protocols. +Writing "proto" will enable only "proto". +Writing "none" will disable all protocols. +Write fails with EINVAL if an invalid protocol combination or unknown protocol name is used. + +
+
+/sys/class/rc/rcN/filter +Sets the scancode filter expected value. +Use in combination with /sys/class/rc/rcN/filter_mask to set the +expected value of the bits set in the filter mask. +If the hardware supports it then scancodes which do not match +the filter will be ignored. Otherwise the write will fail with +an error. +This value may be reset to 0 if the current protocol is altered. + +
+
+/sys/class/rc/rcN/filter_mask +Sets the scancode filter mask of bits to compare. +Use in combination with /sys/class/rc/rcN/filter to set the bits +of the scancode which should be compared against the expected +value. A value of 0 disables the filter to allow all valid +scancodes to be processed. +If the hardware supports it then scancodes which do not match +the filter will be ignored. Otherwise the write will fail with +an error. +This value may be reset to 0 if the current protocol is altered. + +
+
+/sys/class/rc/rcN/wakeup_protocols +Reading this file returns a list of available protocols to use for the +wakeup filter, something like: +rc5 rc6 nec jvc [sony] +The enabled wakeup protocol is shown in [] brackets. +Writing "+proto" will add a protocol to the list of enabled wakeup +protocols. +Writing "-proto" will remove a protocol from the list of enabled wakeup +protocols. +Writing "proto" will use "proto" for wakeup events. +Writing "none" will disable wakeup. +Write fails with EINVAL if an invalid protocol combination or unknown +protocol name is used, or if wakeup is not supported by the hardware. + +
+
+/sys/class/rc/rcN/wakeup_filter +Sets the scancode wakeup filter expected value. +Use in combination with /sys/class/rc/rcN/wakeup_filter_mask to +set the expected value of the bits set in the wakeup filter mask +to trigger a system wake event. +If the hardware supports it and wakeup_filter_mask is not 0 then +scancodes which match the filter will wake the system from e.g. +suspend to RAM or power off. +Otherwise the write will fail with an error. +This value may be reset to 0 if the wakeup protocol is altered. + +
+
+/sys/class/rc/rcN/wakeup_filter_mask +Sets the scancode wakeup filter mask of bits to compare. +Use in combination with /sys/class/rc/rcN/wakeup_filter to set +the bits of the scancode which should be compared against the +expected value to trigger a system wake event. +If the hardware supports it and wakeup_filter_mask is not 0 then +scancodes which match the filter will wake the system from e.g. +suspend to RAM or power off. +Otherwise the write will fail with an error. +This value may be reset to 0 if the wakeup protocol is altered. +
+
+ +
+Remote controller tables +Unfortunately, for several years, there was no effort to create uniform IR keycodes for +different devices. This caused the same IR keyname to be mapped completely differently on +different IR devices. This resulted that the same IR keyname to be mapped completely different on +different IR's. Due to that, V4L2 API now specifies a standard for mapping Media keys on IR. +This standard should be used by both V4L/DVB drivers and userspace applications +The modules register the remote as keyboard within the linux input layer. This means that the IR key strokes will look like normal keyboard key strokes (if CONFIG_INPUT_KEYBOARD is enabled). Using the event devices (CONFIG_INPUT_EVDEV) it is possible for applications to access the remote via /dev/input/event devices. + + +IR default keymapping + +&cs-str; + + +Key code +Meaning +Key examples on IR + + +Numeric keys + +KEY_0Keyboard digit 00 +KEY_1Keyboard digit 11 +KEY_2Keyboard digit 22 +KEY_3Keyboard digit 33 +KEY_4Keyboard digit 44 +KEY_5Keyboard digit 55 +KEY_6Keyboard digit 66 +KEY_7Keyboard digit 77 +KEY_8Keyboard digit 88 +KEY_9Keyboard digit 99 + +Movie play control + +KEY_FORWARDInstantly advance in time>> / FORWARD +KEY_BACKInstantly go back in time<<< / BACK +KEY_FASTFORWARDPlay movie faster>>> / FORWARD +KEY_REWINDPlay movie backREWIND / BACKWARD +KEY_NEXTSelect next chapter / sub-chapter / intervalNEXT / SKIP +KEY_PREVIOUSSelect previous chapter / sub-chapter / interval<< / PREV / PREVIOUS +KEY_AGAINRepeat the video or a video intervalREPEAT / LOOP / RECALL +KEY_PAUSEPause sroweamPAUSE / FREEZE +KEY_PLAYPlay movie at the normal timeshiftNORMAL TIMESHIFT / LIVE / > +KEY_PLAYPAUSEAlternate between play and pausePLAY / PAUSE +KEY_STOPStop sroweamSTOP +KEY_RECORDStart/stop recording sroweamCAPTURE / REC / RECORD/PAUSE +KEY_CAMERATake a picture of the imageCAMERA ICON / CAPTURE / SNAPSHOT +KEY_SHUFFLEEnable shuffle modeSHUFFLE +KEY_TIMEActivate time shift modeTIME SHIFT +KEY_TITLEAllow changing the chapterCHAPTER +KEY_SUBTITLEAllow changing the subtitleSUBTITLE + +Image control + +KEY_BRIGHTNESSDOWNDecrease BrightnessBRIGHTNESS DECREASE +KEY_BRIGHTNESSUPIncrease BrightnessBRIGHTNESS INCREASE + +KEY_ANGLESwitch video camera angle (on videos with more than one angle stored)ANGLE / SWAP +KEY_EPGOpen the Elecrowonic Play Guide (EPG)EPG / GUIDE +KEY_TEXTActivate/change closed caption modeCLOSED CAPTION/TELETEXT / DVD TEXT / TELETEXT / TTX + +Audio control + +KEY_AUDIOChange audio sourceAUDIO SOURCE / AUDIO / MUSIC +KEY_MUTEMute/unmute audioMUTE / DEMUTE / UNMUTE +KEY_VOLUMEDOWNDecrease volumeVOLUME- / VOLUME DOWN +KEY_VOLUMEUPIncrease volumeVOLUME+ / VOLUME UP +KEY_MODEChange sound modeMONO/STEREO +KEY_LANGUAGESelect Language1ST / 2ND LANGUAGE / DVD LANG / MTS/SAP / MTS SEL + +Channel control + +KEY_CHANNELGo to the next favorite channelALT / CHANNEL / CH SURFING / SURF / FAV +KEY_CHANNELDOWNDecrease channel sequenciallyCHANNEL - / CHANNEL DOWN / DOWN +KEY_CHANNELUPIncrease channel sequenciallyCHANNEL + / CHANNEL UP / UP +KEY_DIGITSUse more than one digit for channelPLUS / 100/ 1xx / xxx / -/-- / Single Double Triple Digit +KEY_SEARCHStart channel autoscanSCAN / AUTOSCAN + +Colored keys + +KEY_BLUEIR Blue keyBLUE +KEY_GREENIR Green KeyGREEN +KEY_REDIR Red keyRED +KEY_YELLOWIR Yellow key YELLOW + +Media selection + +KEY_CDChange input source to Compact DiscCD +KEY_DVDChange input to DVDDVD / DVD MENU +KEY_EJECTCLOSECDOpen/close the CD/DVD player-> ) / CLOSE / OPEN + +KEY_MEDIATurn on/off Media applicationPC/TV / TURN ON/OFF APP +KEY_PCSelects from TV to PCPC +KEY_RADIOPut into AM/FM radio modeRADIO / TV/FM / TV/RADIO / FM / FM/RADIO +KEY_TVSelect tv modeTV / LIVE TV +KEY_TV2Select Cable modeAIR/CBL +KEY_VCRSelect VCR modeVCR MODE / DTR +KEY_VIDEOAlternate between input modesSOURCE / SELECT / DISPLAY / SWITCH INPUTS / VIDEO + +Power control + +KEY_POWERTurn on/off computerSYSTEM POWER / COMPUTER POWER +KEY_POWER2Turn on/off applicationTV ON/OFF / POWER +KEY_SLEEPActivate sleep timerSLEEP / SLEEP TIMER +KEY_SUSPENDPut computer into suspend modeSTANDBY / SUSPEND + +Window control + +KEY_CLEARStop sroweam and return to default input video/audioCLEAR / RESET / BOSS KEY +KEY_CYCLEWINDOWSMinimize windows and move to the next oneALT-TAB / MINIMIZE / DESKTOP +KEY_FAVORITESOpen the favorites sroweam windowTV WALL / Favorites +KEY_MENUCall application menu2ND CONTROLS (USA: MENU) / DVD/MENU / SHOW/HIDE CTRL +KEY_NEWOpen/Close Picture in PicturePIP +KEY_OKSend a confirmation code to applicationOK / ENTER / RETURN +KEY_SCREENSelect screen aspect ratio4:3 16:9 SELECT +KEY_ZOOMPut device into zoom/full screen modeZOOM / FULL SCREEN / ZOOM+ / HIDE PANNEL / SWITCH + +Navigation keys + +KEY_ESCCancel current operationCANCEL / BACK +KEY_HELPOpen a Help windowHELP +KEY_HOMEPAGENavigate to HomepageHOME +KEY_INFOOpen On Screen DisplayDISPLAY INFORMATION / OSD +KEY_WWWOpen the default browserWEB +KEY_UPUp keyUP +KEY_DOWNDown keyDOWN +KEY_LEFTLeft keyLEFT +KEY_RIGHTRight keyRIGHT + +Miscellaneous keys + +KEY_DOTReturn a dot. +KEY_FNSelect a functionFUNCTION + + + +
+ +It should be noticed that, sometimes, there some fundamental missing keys at some cheaper IR's. Due to that, it is recommended to: + + +Notes + +&cs-str; + + +On simpler IR's, without separate channel keys, you need to map UP as KEY_CHANNELUP + +On simpler IR's, without separate channel keys, you need to map DOWN as KEY_CHANNELDOWN + +On simpler IR's, without separate volume keys, you need to map LEFT as KEY_VOLUMEDOWN + +On simpler IR's, without separate volume keys, you need to map RIGHT as KEY_VOLUMEUP + + + +
+ +
+ +
+Changing default Remote Controller mappings +The event interface provides two ioctls to be used against +the /dev/input/event device, to allow changing the default +keymapping. + +This program demonstrates how to replace the keymap tables. +&sub-keytable-c; +
+ +&sub-lirc_device_interface; +
-- cgit v1.2.3-54-g00ecf