home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.15k stars 29.83k forks source link

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

Open jshank opened 9 months ago

jshank commented 9 months ago

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

home-assistant[bot] commented 9 months ago

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)

mrmultifunk commented 9 months ago

I have this issue aswell.

fredamn76 commented 9 months ago

I have this issue aswell.

imagoX86 commented 9 months ago

I have this issue aswell.

spunkt123 commented 9 months ago

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
greenmojo2 commented 8 months ago

I also have this issue with my Hisense tv.

notownblues commented 8 months ago

Same issue on Shield TV Pro

petwri commented 7 months ago

Can confirm, same problem on 2019 Shield.

lubinos commented 7 months ago

Same problem on 2019 Shield Tv Pro

petwri commented 7 months ago

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

jshank commented 7 months ago

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.

ollo69 commented 7 months ago

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.

jshank commented 7 months ago

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.

bpmich commented 7 months ago

I'm having this issue with my shield pro 2019

wisheh commented 7 months ago

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

radumarinoiu commented 7 months ago

I also have this issue with my shield pro 2019

Andrewdlec commented 7 months ago

I also have this issue with my Firestick 4k 2023

Yoanf26 commented 6 months ago

I have this error with my Nvidia Shield Pro 2019

Mis1ify commented 4 months ago

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

erik-bjork commented 4 months ago

Me too.

nversluis commented 4 months ago

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

mrmkrs commented 4 months ago

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.

Mis1ify commented 4 months ago

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.

JagerSprinkles commented 4 months ago

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!

issue-triage-workflows[bot] commented 1 month ago

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.

dc911x commented 1 month ago

Not stale, still getting this (screenshot attached)

afbeelding

Moustik2002 commented 1 month ago

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