Opened 3 years ago

Last modified 3 years ago

#17235 new bug

[Media Kit] Distressed/Zombie nodes create ports that cause message timeouts

Reported by: waddlesplash Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Media Kit Version: R1/beta3
Keywords: Cc: pulkomandy
Blocked By: Blocking:
Platform: All

Description

In hrev55048, pulkomandy added some checks to MultiAudioNode to sanitize inputs. These tests actually trigger for the usb_audio driver (not yet included in builds) in some cases at present, and thus the node is created but left in an invalid not-quite-initialized state.

When the media_server or Media preferences attempt to query the node, they get no response and hit timeouts. Most of these queries are blocking, so they lock up the window for a few seconds at a time before a timeout is hit.

What should we do in these cases? There is not really a good way to check if a node is "alive" in the Media Kit so far as I can see besides simply hitting a timeout when querying its control port.

Change History (4)

comment:1 by waddlesplash, 3 years ago

Cc: pulkomandy added

comment:2 by pulkomandy, 3 years ago

I blame kallisti5 :D

He did the original version of this change, I just moved the checks in different places.

https://review.haiku-os.org/c/haiku/+/3491

If this creates problems, it means something does not call InitCheck() when it should. These nodes should be immediately deleted because their InitCheck says there is a problem.

Or maybe... we need to use exceptions?

comment:3 by waddlesplash, 3 years ago

Well, deleting the nodes immediately will be non-ideal too, because then users will wonder why they have a device in /dev but it does not appear in Media preferences. It is also the case that nodes which fail init should not leave ports open, I guess, so those two fixes combined should improve things.

However, I have a better patch for this case: simply skip initializing inputs or outputs when one or the other is invalid or not available, as in the case of usb_audio. I will push it shortly.

comment:4 by waddlesplash, 3 years ago

The bug that exposed this one was corrected in hrev55380, so you will have to manually trigger it now to reproduce this (hopefully).

Note: See TracTickets for help on using tickets.