[mythtv-users] writeStringList error no data written on writeBlock (Python bindings?)

Roger Siddons dizygotheca at ntlworld.com
Sun Sep 8 22:05:33 UTC 2013


On Aug 13th 2013 Mark Perkins wrote:

> I have been experiencing something that I would term (probably  
> incorrectly)FE disconnects from BE (happens to both remote FE and BE/FE  
> machine). Itseemed to only occur rarely, perhaps about once every 3 days  
> or so (but moreoften on the remote FE) and it seems to fix itself after  
> about 5-15minwithout any intervention. During this time Live TV does not  
> work andRecording Playback does not work.

> I am getting 1,000's (10,000's) of the following errors in the  
> mythbackendlog file:

> Aug 19 18:25:29 mark-P5K-Deluxe mythlogserver: mythbackend[500]: E 
> CoreContext mythsocket.cpp:375 (writeStringList) MythSocket(9d89210:159): 
> writeStringList: Error, No data written on writeBlock (622 
> errors)#012#011#011#011starts with: 122406 
> BACKEND_MESSAGE[]:[]GENERATED_PIXMAP[]:[]OK[]:[]1009...Aug 19 18:25:30  
> mark-P5K-Deluxe mythlogserver: mythbackend[500]: ECoreContext  
> mythsocket.cpp:375 (writeStringList) MythSocket(9f10f80:157): 
> writeStringList: Error, No data written on writeBlock (603 
> errors)#012#011#011#011starts with: 122406 
> BACKEND_MESSAGE[]:[]GENERATED_PIXMAP[]:[]OK[]:[]1009...

Mark,

Sorry for starting a new thread - I had to retrieve this from the  
archives. And apologies for not responding sooner - until tonight I hadn't  
read that it was causing you grief.

I too have noticed these errors for a while on 0.26/fixes but they have no  
adverse effect on my system so I have never got around to investigating.  
However I've always had a worry/feeling that they are related to the  
silence commflagging script.

Tonight we watched a recording whilst it was in progress (something we  
rarely do) and I was irritated to see that the adverts weren't being  
skipped. Some cursory debugging showed that these errors were the the  
cause. I had a brief chance to log the network (mythbackend --setverbose  
network) and ominously saw;

Sep 8 20:13:16 htpc mythlogserver: mythbackend[1959]: I Socket  
mythcorecontext.cpp:1203 (dispatch) MythEvent: SYSTEM_EVENT  
CLIENT_DISCONNECTED HOSTNAME htpc SENDER htpc
Sep 8 20:13:16 htpc mythlogserver: mythbackend[1959]: I Socket  
mythcorecontext.cpp:1203 (dispatch) MythEvent:  
LOCAL_SLAVE_BACKEND_ENCODERS_OFFLINE
Sep 8 20:13:16 htpc mythlogserver: mythbackend[1959]: I Socket  
mythcorecontext.cpp:1203 (dispatch) MythEvent: SYSTEM_EVENT  
CLIENT_DISCONNECTED HOSTNAME htpc SENDER htpc
Sep 8 20:13:16 htpc mythlogserver: mythbackend[1959]: I Socket  
mythcorecontext.cpp:1203 (dispatch) MythEvent:  
LOCAL_SLAVE_BACKEND_ENCODERS_OFFLINE
Sep 8 20:13:16 htpc mythlogserver: mythbackend[1959]: E CoreContext  
mythsocket.cpp:375 (writeStringList) MythSocket(11d1750:209):  
writeStringList: Error, No data written on writeB
lock (812 errors)
starts with: 660 BACKEND_MESSAGE[]:[]RECORDING_LIST_CHANGE UPDATE[]:[...

I believe these events relate to slave backends but I have none.

Your dropbox link no longer works but I also see lots of;

Sep 8 19:26:07 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1395 (HandleAnnounce) MainServer::ANN Playback
Sep 8 19:26:07 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1397 (HandleAnnounce) adding: htpc as a client (events: 0)
Sep 8 19:26:07 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1395 (HandleAnnounce) MainServer::ANN Monitor
Sep 8 19:26:07 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1397 (HandleAnnounce) adding: htpc as a client (events: 1)
Sep 8 19:26:10 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1395 (HandleAnnounce) MainServer::ANN Playback
Sep 8 19:26:10 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1397 (HandleAnnounce) adding: htpc as a client (events: 0)
Sep 8 19:26:10 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1395 (HandleAnnounce) MainServer::ANN Monitor
Sep 8 19:26:10 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1397 (HandleAnnounce) adding: htpc as a client (events: 1)
Sep 8 19:26:19 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1395 (HandleAnnounce) MainServer::ANN Playback
Sep 8 19:26:19 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1397 (HandleAnnounce) adding: htpc as a client (events: 0)
Sep 8 19:26:19 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1395 (HandleAnnounce) MainServer::ANN Monitor
Sep 8 19:26:19 htpc mythlogserver: mythbackend[1959]: I ProcessRequest  
mainserver.cpp:1397 (HandleAnnounce) adding: htpc as a client (events: 1)
Sep 8 19:26:24 htpc mythlogserver: mythbackend[1959]: E CoreContext  
mythsocket.cpp:375 (writeStringList) MythSocket(1128f00:207):  
writeStringList: Error, No data written on writeBlock (815 errors)
starts with: 100816 BACKEND_MESSAGE[]:[]GENERATED_PIXMAP[]:[]OK[]:[]1005...

which do seem closely related to the start of commflagging.

The errors all stopped when some recordings finish. I had 3 concurrent  
recordings at the time so I wonder if multiple commflagging jobs are a  
factor in it.

My initial hypothesis is that the commflagging messages are being  
interpreted as a slave backend repeatedly connecting/disconnecting, which  
is overloading Myth's sockets somehow. I haven't seen any of your "socket  
unconnected" errors, but they arise from the same area.

I don't have time/opportunity to investigate further at the moment but, if  
it's screwing your system, I'd suggest you simply disable the commflag  
messages and see if the errors re-occur. Just comment out the line  
containing "be.backendCommand" (and the following "if") in silence.py.  
Your programmes will still be commflagged but, if you watch in-progress  
recordings, you'll have to stop and restart playback to pick up the  
skiplist.

And if Mr Wagner is watching, can he offer any advice on how to send  
occasional messages from a python script to the backend ? The full script  
is at  
http://www.mythtv.org/wiki/Commercial_detection_with_silence_for_UK_freeviewHD#silence.py  
but the relevant code is;

db = MythTV.MythDB()
be = MythTV.BECache(None, False, db)

# send advert skiplist to MythPlayers
tuplelist = [(str(x) + ':' + str(rec.markup.MARK_COMM_START), str(y) + ':'  
+ str(rec.markup.MARK_COMM_END)) for x, y in rec.markup.getskiplist()]
mesg = 'COMMFLAG_UPDATE ' + progId + ' ' + ','.join([x for tuple in  
tuplelist for x in tuple])
result = be.backendCommand("MESSAGE[]:[]" + mesg)

Not great code but it was my first attempt at Python and I couldn't find  
any examples to copy...

I did notice http://www.gossamer-threads.com/lists/mythtv/dev/548233 but  
it's probably the way I'm using the bindings.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20130908/d01f49ad/attachment.html>


More information about the mythtv-users mailing list