core icon indicating copy to clipboard operation
core copied to clipboard

Android Debug Bridge (AndroidTV) app_id frequently shows "Failed to write while dumping service window: Broken pipe"

Open jshank opened this issue 2 years ago • 23 comments

The problem

I have an automation (below) that triggers based on the app_Id from the device via Android Debug Bridge. Since 2023.10.4, the platform state attributes often responds with:

app_id: Failed to write while dumping service window: Broken pipe
app_name: Failed to write while dumping service window: Broken pipe
source: Failed to write while dumping service window: Broken pipe
adb_response: null

This causes automations to trigger based on the state change away from the expected values (testing for com.valvesoftware.steamlink).

What version of Home Assistant Core has the issue?

core-2023.10.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Android Debug Bridge

Link to integration documentation on our website

https://www.home-assistant.io/integrations/androidtv/

Diagnostics information

config_entry-androidtv-7afc03507b3c3581fd74a1456248daa2.json.txt

Example YAML snippet

- id: Game Mode On 
  alias: Game mode on
  trigger:
    platform: state
    entity_id: media_player.living_room_nvidia_shield
    attribute: app_id
    to: com.valvesoftware.steamlink
  action: ...

- id: Game Mode Off
  alias: Game mode off
  trigger:
    platform: state
    entity_id: media_player.living_room_nvidia_shield
    attribute: app_id
    from: com.valvesoftware.steamlink
  action: ...

Anything in the logs that might be useful for us?

No response

Additional information

One other user (spunkt123) has reported the issue https://community.home-assistant.io/t/home-assistant-community-add-on-adb-android-debug-bridge/96375/445

jshank avatar Nov 28 '23 15:11 jshank

Hey there @jefflirion, @ollo69, mind taking a look at this issue as it has been labeled with an integration (androidtv) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of androidtv can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign androidtv Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


androidtv documentation androidtv source (message by IssueLinks)

home-assistant[bot] avatar Nov 28 '23 15:11 home-assistant[bot]

I have this issue aswell.

mrmultifunk avatar Dec 12 '23 14:12 mrmultifunk

I have this issue aswell.

fredamn76 avatar Dec 13 '23 18:12 fredamn76

I have this issue aswell.

imagoX86 avatar Dec 15 '23 11:12 imagoX86

I have the same issue. I use the ADB addon with my Philips Android TV to read the app ID of the current app on the TV. Unfortunately, this no longer works reliably since the update to 2023.10.5. Here I receive the following feedback at irregular intervals, but very often:

app_id: Failed to write while dumping service window: Broken pipe
app_name: Failed to write while dumping service window: Broken pipe
source: Failed to write while dumping service window: Broken pipe
adb_response: null

spunkt123 avatar Dec 19 '23 11:12 spunkt123

I also have this issue with my Hisense tv.

greenmojo2 avatar Jan 12 '24 18:01 greenmojo2

Same issue on Shield TV Pro

notownblues avatar Jan 13 '24 21:01 notownblues

Can confirm, same problem on 2019 Shield.

petwri avatar Jan 21 '24 18:01 petwri

Same problem on 2019 Shield Tv Pro

lubinos avatar Jan 22 '24 17:01 lubinos

Is anybody looking into this, or can ADB be considered broken?

petwri avatar Jan 22 '24 18:01 petwri

Good morning @JeffLIrion or @ollo69. Thank you for your work on creating this! Can you confirm if you are still supporting this integration or if it's been abandoned?

@frenck sorry to bug but would appreciate guidance on integrations that may no longer be maintained and how to mark them inactive.

jshank avatar Jan 22 '24 18:01 jshank

Problem with Android is that there are a lot of version and keep library update is a huge work. I honestly have no idea on what is causing Broken pipe error, my first suggestion is just try to disable android debug on device, remove integration and try to pair again. I just have a FireTV stick and basic controls are still working using this integration. Talk about inactive integration seems excessive, I created a couple of PR waiting for review to add remote platform. But I'm not sure about support related to the library, so my suggestion is to open this issue not here but at library site.

ollo69 avatar Jan 22 '24 22:01 ollo69

Talk about inactive integration seems excessive, I created a couple of PR waiting for review to add remote platform. But I'm not sure about support related to the library, so my suggestion is to open this issue not here but at library site.

Acknowledged with thanks @ollo69.

jshank avatar Jan 22 '24 23:01 jshank

I'm having this issue with my shield pro 2019

bpmich avatar Jan 29 '24 00:01 bpmich

I'm having this issue with my shield pro 2019.

wisheh avatar Jan 31 '24 18:01 wisheh

I also have this issue with my shield pro 2019

radumarinoiu avatar Feb 05 '24 17:02 radumarinoiu

I also have this issue with my Firestick 4k 2023

Andrewdlec avatar Feb 09 '24 18:02 Andrewdlec

I have this error with my Nvidia Shield Pro 2019

Yoanf26 avatar Mar 09 '24 16:03 Yoanf26

Any update on this? I have this error on Nvidia Shield Pro 2019 too.

Mis1ify avatar Apr 20 '24 07:04 Mis1ify

Me too.

erik-bjork avatar Apr 20 '24 07:04 erik-bjork

I also experience this problem. If there are any logs I can help with, let me know.

nversluis avatar May 02 '24 11:05 nversluis

I'm also having this issue on both a Shield Tube and the Shield pro. Removing and add the integration, as well as toggling network debugging off/on did not help. I noticed I had two integrations enabled: Android Debug Bridge and Android TV Remote. The later did show the current app and interestingly also at a much faster speed, like almost instant. Where as in the debug bridge integration, it can take a few seconds to update. Disabling the tv remote integration and only using the debug bridge also did not help.

Workaround (shield only) Anyway the workaround I now have is using both integrations. I use the debug bridge to determine the current playing state (playing, pause), and the tv remote integration to determine the current app. This workaround wont help Fire TV users since the tv remote integration does not work on that device. But no problems on the shield so far.

mrmkrs avatar May 09 '24 08:05 mrmkrs

Workaround (shield only) Anyway the workaround I now have is using both integrations. I use the debug bridge to determine the current playing state (playing, pause), and the tv remote integration to determine the current app. This workaround wont help Fire TV users since the tv remote integration does not work on that device. But no problems on the shield so far.

Confirming this works as a good workaround for shield. Also, I'm using android TV remote integration with google cast integration to determinate the current playing state. Then, I've set up "Universal media player" integration to make one media player from these two. Only time i'm using ADB integration now is to send adb commands in automations.

Mis1ify avatar May 09 '24 08:05 Mis1ify

Workaround (shield only) Anyway the workaround I now have is using both integrations. I use the debug bridge to determine the current playing state (playing, pause), and the tv remote integration to determine the current app. This workaround wont help Fire TV users since the tv remote integration does not work on that device. But no problems on the shield so far.

I can confirm this workaround seems to be working for me as well on my Shield. Thanks for the idea!

JagerSprinkles avatar May 09 '24 21:05 JagerSprinkles

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Not stale, still getting this (screenshot attached)

afbeelding

dc911x avatar Aug 08 '24 07:08 dc911x

Same issue happening on my TCL android TV. I've tested with wifi as mention on the android TV HA page wothout success. I'm not able to have the picture of what i'm watching.

I've noticed something weird as well. The icon doesn't show when i'm selecting my android TV ( the ADB one)

image

Moustik2002 avatar Aug 14 '24 00:08 Moustik2002