GithubHelp home page GithubHelp logo

Comments (4)

postlund avatar postlund commented on June 2, 2024 2

It does not support that part of the AirPlay protocol (only Apple TV does). Use stream_file instead (call it in the same way).

from pyatv.

Docjones avatar Docjones commented on June 2, 2024

okay -that seems to work - however, this is a blocking call? And the Homepod vanishes from the list of airplay devices in iOS?

from pyatv.

Docjones avatar Docjones commented on June 2, 2024

And shairplay refuses streaming:

Traceback (most recent call last):
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 978, in _run_application
    return await cli_handler(loop)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 723, in cli_handler
    return await _handle_commands(args, config, storage, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 862, in _handle_commands
    ret = await _handle_device_command(args, cmd, atv, storage, loop)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 916, in _handle_device_command
    return await _exec_command(atv.stream, cmd, True, *cmd_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 945, in _exec_command
    value = await tmp(*args)
            ^^^^^^^^^^^^^^^^
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/core/facade.py", line 371, in stream_file
    await self.relay("stream_file")(
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/protocols/raop/__init__.py", line 356, in stream_file
    await client.initialize(self.core.service.properties)
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/protocols/raop/stream_client.py", line 337, in initialize
    await self._protocol.setup(self.timing_server.port, self.control_client.port)
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/protocols/raop/protocols/airplayv2.py", line 108, in setup
    await self._setup_base(timing_server_port)
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/protocols/raop/protocols/airplayv2.py", line 51, in _setup_base
    self._verifier = await verify_connection(
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/protocols/airplay/auth/__init__.py", line 104, in verify_connection
    has_encryption_keys = await verifier.verify_credentials()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/protocols/airplay/auth/hap_transient.py", line 48, in verify_credentials
    await self.http.post("/pair-pin-start", headers=_AIRPLAY_HEADERS)
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/support/http.py", line 432, in post
    return await self.send_and_receive(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrink/pyatv/lib/python3.11/site-packages/pyatv/support/http.py", line 495, in send_and_receive
    raise exceptions.HttpError(
pyatv.exceptions.HttpError: HTTP/1.1 method POST failed with code 400: Bad Request


from pyatv.

postlund avatar postlund commented on June 2, 2024

Yes, it uses RTP streaming to stream audio to the device. Basically is streams audio from the remote source (internet radio in your case), converts it into raw PCM frames and forwards to the device. I.e. this is normal AirPlay audio streaming. I have not managed to figure out how to use built in apps (like Music), so no support for that. The API used on Apple TVs to just stream directly from a URL does not exist on HomePod.

Only one can stream via AirPlay so I assume that is expected.

from pyatv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.