Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Starting XBMC on hdmi access
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Starting XBMC on hdmi access
17th Apr, 2013, 07:18 PM
Post: #1
Fred Offline
Registered
Posts: 321
Joined: Apr 2013
Reputation: 36
Starting XBMC on hdmi access
Is it possible to get the status from the hdmi port from the commandline, so whether it is accessed by the tv or not?

tvservice -s shows no difference in whether it's accessed or not.

Edit: see http://forum.xbian.org/thread-803-post-9461.html#pid9461 for linux script

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
18th Apr, 2013, 07:58 AM
Post: #2
rikardo1979 Offline
Management
******
Posts: 3,545
Joined: Dec 2012
Reputation: 190
RE: Get HDMI status from commandline.
is your TV recognized ?
Code:
/opt/vc/bin/tvservice -n

~~~~>>>Please always follow rules and read before you post<<<~~~~
Find all posts by this user
Quote this message in a reply
18th Apr, 2013, 08:02 PM
Post: #3
Fred Offline
Registered
Posts: 321
Joined: Apr 2013
Reputation: 36
RE: Get HDMI status from commandline.
Yes it returns:

Code:
device_name=SAM-SAMSUNG

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
18th Apr, 2013, 08:17 PM
Post: #4
rikardo1979 Offline
Management
******
Posts: 3,545
Joined: Dec 2012
Reputation: 190
Re: Get HDMI status from commandline.
OK so it is working fine.
tbh Im not sure what you want to achieve

~~~~>>>Please always follow rules and read before you post<<<~~~~
Find all posts by this user
Quote this message in a reply
18th Apr, 2013, 10:31 PM
Post: #5
Fred Offline
Registered
Posts: 321
Joined: Apr 2013
Reputation: 36
RE: Get HDMI status from commandline.
I want to start XBMC when the tv is turned to the hdmi channel and stop XBMC again when the channel is changed back again. So I thougt of building a script that periodically calls this tvservice -s and then starts or stops XBMC.

I also tried doing this by running cec-client -m and running a script whenever the hdmi acces command comes along.
But now suddenly when I run 'cec-client -m' in commandline it gives a segmentation fault after a while (I didn't make any changes to libcec or the cec-client).

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
19th Apr, 2013, 02:58 AM
Post: #6
Fred Offline
Registered
Posts: 321
Joined: Apr 2013
Reputation: 36
RE: Get HDMI status from commandline.
Code:
xbian@xbian ~ $ cec-client -m
starting a monitor-only client. use 'mon 0' to switch to normal mode
No device type given. Using 'recording device'
CEC Parser created - libCEC version 2.1.1
no serial port given. trying autodetect:
path:     Raspberry Pi
com port: RPI

opening a connection to the CEC adapter...
DEBUG:   [             230]     unregistering all CEC clients
DEBUG:   [             235]     Broadcast (F): osd name set to 'Broadcast'
DEBUG:   [             244]     InitHostCEC - vchiq_initialise succeeded
DEBUG:   [             247]     InitHostCEC - vchi_initialise succeeded
DEBUG:   [             251]     InitHostCEC - vchi_connect succeeded
DEBUG:   [             256]     logical address changed to Broadcast (f)
DEBUG:   [             266]     RegisterLogicalAddress - registering address e
DEBUG:   [             449]     logical address changed to Free use (e)
DEBUG:   [             449]     logical address changed to Free use (e)
DEBUG:   [             449]     Open - vc_cec initialised
NOTICE:  [             449]     connection opened
DEBUG:   [             450]     processor thread started
waiting for input
Segmentation fault

Is there a way to reinstall libcec without screwing things up for XBMC?

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
19th Apr, 2013, 07:36 PM
Post: #7
Fred Offline
Registered
Posts: 321
Joined: Apr 2013
Reputation: 36
RE: Get HDMI status from commandline.
Okay I have build this script now as a work around. This script runs forever and should start XBMC on hdmi access and shut it down when the channel is changed away from the hdmi again. The code is below and this code doesn't start or stop anything yet but just prints stuff for debugging.

I would like to get some advice on this, maybe you know a better solution.

Code:
#!/bin/bash
while true

do

cec_client=`cec-client -m | egrep -m 1 '0f:86:30:00|0f:80:00:00:30:00|0f:80:30:00:00:00'`

echo "${cec_client}"

if (( `echo $cec_client | grep -c "0f:86:30:00|0f:80:00:00:30:00"` > 0 ));then
    echo "turning on and waiting"
    sleep 60
    echo "waiting over, restarting"
elif (( `echo $cec_client | grep -c "0f:80:30:00:00:00"` > 0 ));then
    echo "turning off and waiting"
    sleep 60
    echo "waiting over, restarting"
else
    echo "error, restarting" #this is true when there is a segmentation fault
fi

done

I would also like to extend it with option to wait an x amount of time before shutting down, if hdmi is accessed within that time cancel shutdown. But for this I should be able to do actions while cec-client is still running, I don't know how to do that.

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
27th Jan, 2014, 04:35 AM
Post: #8
koper89 Offline
Registered
Posts: 97
Joined: Jan 2014
Reputation: 8
RE: Starting XBMC on hdmi access
Is this still "under development" ? It could be really nice script, because xbmc uses a lot of resources in background, and i could use those f.e. for rtorrent.
Find all posts by this user
Quote this message in a reply
27th Jan, 2014, 09:36 PM
Post: #9
mk01 Offline
Registered
Posts: 2,485
Joined: Mar 2013
Reputation: 209
RE: Starting XBMC on hdmi access
@koper89

http://forum.xbian.org/thread-2040-post-20131.html#pid20131

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 11th May, 2025, 12:22 PM Powered By MyBB, © 2002-2025 MyBB Group.