home-assistant / home-assistant/android

[REQUEST] AUX input and audio casting built-into Home Assistant Companion for Android so can stream music to a Music Provider for Music Assistant?

Open
#4,479 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
3.9k
Forks
1.1k
Avg merge
1d 12h
Merged PRs (30d)
81

Description

**Is your feature request related to a problem? Please describe.**

Feature request for AUX input, audio conversion/transcoding, and audio casting in/from Home Assistant Companion for Android.

(FYI, a matching feature request has also been submitted for the iOS Companion app -> https://github.com/home-assistant/iOS/discussions/2823)

Please add features for enabling AUX input and allowing audio casting capability built-into Home Assistant Companion for Android so it can stream music from audio jack (USB Audio Device) to a "Music Provider" for Music Assistant which can then be forwarded to players.

https://www.home-assistant.io/blog/2024/05/09/music-assistant-2/

Music Assistant is a music library manager for your offline and online music sources which can easily stream your favourite music to a wide range of supported players and be combined with the power of Home Assistant.

Music Assistant (MA) Home Assistant (HA) Integration is an addon and integrations that provides a connection between Music Assistant and Home Assistant . This means that MA players are visible in HA and can be controlled via the HA UI or via automations or scripts.

https://music-assistant.io/integration/

If possible please also look into if could also add Audio ACR (Automatic Content Recognition) to detect using fingerprints of the raw audio stream and match the current song being played from AUX input and add the related metadata to enable rich metadata to be displays in Music Assistant when playback from AUX input. That way playback history of songs played could be saved in Music Assistant.

The main purpose want this feature request is to make it very easy for anyone to achieve stable music streaming from an analog audio source like example a vinyl record player (also known as a turntable) by connecting it to an audio jack (USB Audio Device) that has a ADC (Analog-to-Digital Converter) on an Android app which runs an app that will perform conversion to an appropriate format for music streaming and stream that to an "Music Provider" in Music Assistant so that it in turn can forward that to a Player Provider (i.e. network-attached audio receiver and/or smart speaker).

https://music-assistant.io/faq/stream-to/#music-assistant

So what is missing is a way for getting AUX audio + audio conversion + music casting inside Home Assistant Companion for Android.

**Describe the solution you'd like**

Add abilities for AUX input, audio conversion/transcoding, and audio-only casting built-into Home Assistant Companion for Android.

Bonus would be if could also add Audio ACR (Automatic Content Recognition) to detect and match the current song being played from AUX input and add the related metadata to enable rich metadata to be displays in Music Assistant when playback from AUX input.

Optionally could also add Music Assistant integration for automatic configuration of "Music Provider" inside Music Assistant addon.

Architecture:

Analog audio -> AUX input via USB Audio Device -> Home Assistant Companion -> Music Assistant -> players (receivers/speakers)

User-guide steps if and when implemented:

1. Acquire Hardware = Use audio source with embedded USB audio codec output or get external stand-alone USB Audio Device. Note that a phone preamplifier (phone preamp) is needed, either built-into the audio source or inside the USB Audio Device.
3. Configure Music Assistant integration addon and setup local AUX-input as Music Provider in the Home Assistant Companion app.
4. Configure Player Provider (players = compatible network-attached recievers and smart speakers in Music Assistant).
4. Select playback from Local AUX input and start playback.

**Describe alternatives you've considered, if any**

This is a feature/function that could previously be achieved via the no longer maintained open-source "Vinyl Cast" app for Android:

https://github.com/aschober/vinyl-cast

https://vinylcast.schober.tech/

https://play.google.com/store/apps/details?id=tech.schober.vinylcast.playstore

https://youtu.be/HBDkxEvCcHQ

**Additional context**

You can also achieve this using an USB Audio Device + a combination of [Darkcast](http://www.darkice.org/) to capture and [Icecast](https://www.icecast.org/) running on ex. a Raspberry Pi:

You could use [Darkcast](http://www.darkice.org/) to capture and [Icecast](https://www.icecast.org/) to build a solution that will digitize and stream audio from your analog audio equipment like a vinyl record player (turntable/phonograph/gramophone) as a web radio stream (URL) that you could add as a radio station in Music Assistant.

For such a project you need an audio-capture and ADC (analogue-to-digital converter) device that provides audio-input and digitalization. For example, you can use either a USB Audio Device Interface adapter from [Behringer](https://www.behringer.com/catalog.html?catalog=Category&category=C-BEHRINGER-AUDIOINTERFACES-USBAUDIOINTERFACES) or [IK Multimedia](https://www.ikmultimedia.com/products/irigstream/), or a [HiFiBerry board with ADC](https://www.hifiberry.com/blog/need-some-input/).

You can find a generic tutorial [here](https://maker.pro/raspberry-pi/projects/how-to-build-an-internet-radio-station-with-raspberry-pi-darkice-and-icecast), and for those that like step-by-step guides look [here](https://github.com/quebulm/Raspberry-Pi-Vinyl-Streamer) and [here](https://github.com/gieljnssns/darkice-libaacplus-rpi-guide/blob/master/README.md) (the first of which also offers a pre-configured Linux appliance image for Raspberry Pi 3 / Raspberry Pi Zero 2 W).

https://github.com/quebulm/Raspberry-Pi-Vinyl-Streamer

https://github.com/gieljnssns/darkice-libaacplus-rpi-guide/blob/master/README.md

https://maker.pro/raspberry-pi/projects/how-to-build-an-internet-radio-station-with-raspberry-pi-darkice-and-icecast

PS: Personally I would suggest that interested developers should look into testing AUX inputs from USB Audio Devices like these:

* [Behringer UCA222](https://www.behringer.com/product.html?modelCode=0805-AAG) (without pre-amp, newer model that is a direct replacement for the UCA202)
* [Behringer UCA202](https://www.behringer.com/behringer/product?modelCode=0805-AAC) (without pre-amp)
* [Behringer UFO202](https://www.behringer.com/product.html?modelCode=P0484) (with pre-amp)
* [ART USB Phono Plus](https://artproaudio.com/product/usb-phono-plus-project-series/) (a standalone pre-amp with USB interface that needs external power-suppy).
* [IK Multimedia iRig Stream](https://www.ikmultimedia.com/products/irigstream/) (without pre-amp)
* [IK Multimedia iRig Stream Pro](https://www.dlxmusic.se/produkter/studio/ljudkort/externa/ik-irig-stream-pro) (with pre-amp)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.