music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.2k stars 44 forks source link

Apple Homepod does not play track from the beginning. #2418

Open steveof2620 opened 3 weeks ago

steveof2620 commented 3 weeks ago

What version of Music Assistant has the issue?

2.0.4

What version of the Home Assistant Integration have you got installed?

2024.5.1

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

Individual audio tracks, announcement tones and TTS messages do not play for the beginning. Instead they are played after a delay and at some point AFTER the track has begun playing.

For example, when using the mass.play_announcement service:

alias: Test MA announcement
sequence:
  - service: mass.play_announcement
    metadata: {}
    data:
      url: http://192.168.1.##:8123/local/audio/sounds/gentle-alarm.mp3
      use_pre_announce: true
      announce_volume: 60
    target:
      entity_id: media_player.kitchen

The sound was not heard. After further testing it became apparent that the audio file was too short to play. When a longer audio track was played it was hear but after some midpoint.

For example, with TTS (modified from the MU documentation page):

service: tts.google_say
data:
  entity_id: media_player.kitchen
  message: This is a test message to see if this is working

The message plays from “to see if this is working”. ie… “this is a test message” isn’t played at all.

Similarly, this file skips the beginning of the audio file.

 service: mass.play_media
metadata: {}
data:
  media_id: good morning voice message
target:
  entity_id: media_player.kitchen

The file is a 252 KB MP3 audio file.

This is the configuration within MA for TTS announcements but the issue is also there for individual sound files..

Screenshot 2024-06-05 at 19 29 51

How to reproduce

Run the code below and note that the audio does not commence at the beginning as expected.

alias: Test MA announcement
sequence:
  - service: mass.play_announcement
    metadata: {}
    data:
      url: http://192.168.1.##:8123/local/audio/sounds/gentle-alarm.mp3
      use_pre_announce: true
      announce_volume: 60
    target:
      entity_id: media_player.kitchen
service: tts.google_say
data:
  entity_id: media_player.kitchen
  message: This is a test message to see if this is working

*Note.. The message plays from “to see if this is working”. ie… “this is a test message” isn’t heard.

 service: mass.play_media
metadata: {}
data:
  media_id: good morning voice message
target:
  entity_id: media_player.kitchen

Music Providers

Filesystem (local disk)

Player Providers

Airplay (through music assistant) on an homepod mini.

Following plays the entire TTS message and second sound file through homepod mini via home assistant:

service: tts.google_say
data:
  entity_id: media_player.home_pod_mini_kitchen
  message: This is a test message to see if this is working
service: media_player.play_media
metadata:
  title: gentle-alarm.mp3
  thumbnail: null
  media_class: music
  children_media_class: null
  navigateIds:
    - {}
    - media_content_type: app
      media_content_id: media-source://media_source
    - media_content_type: ""
      media_content_id: media-source://media_source/local/sounds
data:
  media_content_id: media-source://media_source/local/audio/sounds/gentle-alarm.mp3
  media_content_type: audio/mpeg
target:
  entity_id: media_player.home_pod_mini_kitchen

Full log output

MU_log.log

Additional information

I am running home assistant on proxmox on an intel NUC. Not sure that type of installation I have, though I am running the version with the add-ons store (I assume that is home assistant OS).

What version of Home Assistant Core are your running

2024.6.0

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

OzGav commented 3 weeks ago

I am seeing more reports about issues with the HomePod. Can you confirm you can play music ok? Can you confirm if you play announcements to other player types then that works ok? Do you have other Airplay players? If so, do they work ok?

steveof2620 commented 2 weeks ago

Yes I can play music, though I generally listen to streams so the missed start is less of an issue.

I can play messages though the general HA HomePod entities, so that is what I am doing for the time being.

I have two HomePod mini’s and a HomePod. They all seem to be displaying this behaviour.