Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream to output devices through sound mode selection #20

Merged
merged 22 commits into from
Jul 8, 2024

Conversation

albaintor
Copy link
Contributor

@albaintor albaintor commented Jun 25, 2024

This PR lets select one ore several output devices to stream audio to.
How it works : at connection, the list of available output devices are retrieved (airplay compatible)
The through the sound mode selection, a list of possible combinations is displayed :

  1. First entry with the name of apple tv : disable all output devices except Apple TV
  2. Next entries : list of possible combinations

For example if you have 2 homepods e.g "Homepod 1" and "Homepod 2" you will have :

  1. Apple TV
  2. Homepod 1 => stream audio to AppleTV + Homepod1
  3. Homepod 2 => stream audio to AppleTV + Homepod1
  4. Homepod 1, Homepod 2 stream audio to AppleTV + Homepod1 + Homepod2

image

The dropdown list should be improved in the webconfigurator because entries are cropped, otherwise it works perfectly.
I guess this is a temporary approach : the list can grow up fastly if you have many airplay devices. I limited the number of items between 1 (1 device enabled) and 5 (5 devices enabled)

@zehnm zehnm self-requested a review June 26, 2024 06:41
Copy link
Contributor

@zehnm zehnm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review and thanks a lot for the audio output selection feature!

Please fix the duplicate output devices and the instance names. The remaining comments are cosmetic things and questions.

intg-appletv/tv.py Outdated Show resolved Hide resolved
intg-appletv/tv.py Show resolved Hide resolved
intg-appletv/tv.py Outdated Show resolved Hide resolved
intg-appletv/tv.py Outdated Show resolved Hide resolved
intg-appletv/tv.py Outdated Show resolved Hide resolved
intg-appletv/tv.py Show resolved Hide resolved
@zehnm
Copy link
Contributor

zehnm commented Jul 8, 2024

I'll add a task in the web-configurator to better scale the sound mode dropdown list, and maybe even make it a free-text entry as for the input/app selection.

@martonborzak is there already a sound-mode selection feature in the media-player UI? I couldn't find it :-)

@zehnm zehnm mentioned this pull request Jul 8, 2024
@albaintor
Copy link
Contributor Author

I am testing modifications....

@albaintor
Copy link
Contributor Author

albaintor commented Jul 8, 2024

Illustration of the dropdown too small. Possible to grow it up (max-width=XXX) ?
image

@albaintor albaintor requested a review from zehnm July 8, 2024 15:03
intg-appletv/tv.py Show resolved Hide resolved
@zehnm
Copy link
Contributor

zehnm commented Jul 8, 2024

Have you already looked into the outputdevices_update callback?
It looks like this could be used to update the currently selected outputs and propagate the sound_mode attribute to R2.
Quick test with deselecting a speaker in control center:
image

intg-appletv/tv.py Outdated Show resolved Hide resolved
@albaintor
Copy link
Contributor Author

Have you already looked into the outputdevices_update callback? It looks like this could be used to update the currently selected outputs and propagate the sound_mode attribute to R2. Quick test with deselecting a speaker in control center: image

The callback was already there in your code but not used, I added the missing lines to notify the remote of updated output devices

@albaintor albaintor requested a review from zehnm July 8, 2024 18:43
Copy link
Contributor

@zehnm zehnm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks again!
The number of calls to self.output_devices could be reduced, but that's something we can fix with the upcoming speaker group feature.

@zehnm zehnm merged commit 5452b03 into unfoldedcircle:main Jul 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants