Sound card output as Player #3492
Replies: 8 comments 32 replies
|
+1! At the moment I'm running Home Assistant with a Docker Container which hosts 6 instances of MPD, which are then used in Home Assistant for Audio playback. However, MPD lacks volume normalization apart from replaygain (which does not work if you create custom playlists based on moods across artists and albums) and while it works fine with Home Assistant, HA does not show the media library at all. It's just limited to these entities and that's it. I have a USB 7.1 sound card attached and connected to a multi-zone audio amplifier. At the moment, I cannot use Music Assistant at all, because it does not support local sound devices from what I understand (at least the doc says it doesn't). I'm avoiding all these WIFI, cloud-based smart-speakers, because total local control and independence of cloud services is a MUST for me. |
|
Agreed .. just installed Music assistant to see i can't add my local usb audio card ... sad ... and even better can't even stream to a bluetooth device .. what a joke... uninstalling. |
|
While there is no local audio out support in the Builtin Provider, I believe you could workaround this by using Home Assistant player provider: Should work with USB Audio Device that supports USB Audio Class 2.0 pipeline, like example:
Another option to USB Audio Device that could technically provide the same function but would need other drivers and has not been tested are HiFiBerry's products like example "HiFiBerry DAC+ ADC PRO", "HiFiBerry DAC2 ADC PRO", or "HiFiBerry DAC+ ADC" (which as bonus using HiFiBerry can makes a whole Raspberry Pi based build an all-in-one package that could be aesthetically pleasing and almost have the clean look of a commercial appliance) While not recommended with Home Assistant as player provider should also be able to play through Home Assistant via ex. MPD add-on: |
|
I’m using the external Squeezelite add-on on HomeAssistant for this and have MusicAssistant connected to it and its “not great“™️. It’s the choice between high latency and broken audio (choose one or more). Since its also used to play the doorbell sound when someone presses the doorbell button, multi-second latency is not very satisfactory. The best settings for SqueezeLite integration I found are the following (for each instance of SqueezeLite):
Not using This gives about 1,8s delay – most of which appear to be coming from SqueezeLite (part might also be from SqueezeLite Music Assistant integration). Home Assistant and Music Assistant UI update almost immediately to show an “Announcement” when pressing the doorbell button. Using SqueezeLite ALSA is compare but even harder to get to work. Native SqueezeLite PulseAudio has at least 1s more latency (if you look at its logs it appears to just hang for about 1s on every change) and also messes up sampling rates and volume during this time (previous playback continues using new sampling rate and volume). Getting ALSA with direct hardware access to work is not possible in my setup since I need channel splitting. (Left and right speakers are in different rooms.) (Guess I should make this into a blog post…) |
|
@alphasixtyfive hi there fellow CT user, i am considering nuking the CT install and just installing linux and testing sqeezelite / sendspin / snapcast - did you ever try that? If not i feel an xmas project coming on....... |
|
Local audio out has been added to 2.9.0 beta 4 |
|
Hey @alphasixtyfive and others - had some discussion internally with the sendspin and MA team at ohf about this and I want to urge us to go in another direction. Right now I think we should pull the local audio out plugin from MA completely, and rely on either a CLI player installed locally or a docker container or HAOS add-on to expose local audio as a sendspin player. This means the hardware handling aspects are kept out of Music Assistant so it stays as agnostic as it can be about what you're running it on. We've got the multi-sendspin container and HAOS add on that I put a good bit of effort into (Shoutout @scyto as well) that is in use at a good number of places, as well as an upcoming sendspin-CPP cli that mirrors the usefulness of the squeezelite CLI. The plan is to make a SUPER basic HAOS plugin out of that as well, so folks that just want local audio out can use that without any extra work, but the code stays out of the server. Taking thoughts and opinions for and against of course, but I think this is a safer way forward.. |
|
@chrisuthe I spent the day testing the addon and the local audio provider and worked with Claude to develop an edited short list of issues and items for possible discussion. These observations and comparisons are based on the main branch of the multiplayer addon and the current UX
Non-UX
Summary — MA integration/UX, for someone not deep in Linux audio:
Summary — where the addon may suit a power user better: The addon gives more direct visibility and control if you're willing to use it: richer per-player telemetry, a working static delay control already in place, and a standalone REST-controllable service usable independent of MA/HA. Running one process per output is also a simpler mental model to debug in isolation — one player, one log — versus tracing behavior through a shared graph and MA's own abstraction layers. Thanks. |

Uh oh!
There was an error while loading. Please reload this page.
It would be fantastic to have the ability to specify a local soundcard as an audio output for a player. This feature would effectively turn Music Assistant into a full-fledged open-source wired multi-room audio system.
To elaborate, I have a multi-room audio player from a company called CasaTunes, which is essentially a low-spec PC with two physical soundcards. Each output of these soundcards represents a zone (or room) and acts as an independent player. There are other companies employing the same approach while charging unreasonably high prices for it.
The idea of implementing local players would simply require the ability to specify the device and subdevice, for example:
-a hw:1,0This enhancement would open up new possibilities for multi-room audio setups using wired connections, adding tremendous flexibility for users.
All reactions