Code Monkey home page Code Monkey logo

aioslimproto's People

Contributors

balloob avatar dependabot[bot] avatar github-actions[bot] avatar marcelveldt avatar martinhjelmare avatar terual avatar thijsputman avatar tjni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aioslimproto's Issues

add sync feature

add feature to create synchronized playergroups
shouldn't be hard as all the plumbing (accurate timestamps etc) is already there.

Add multiroom support

This is the last step I need to switch completely from lms to music-assistant and this slimproto integration here.

I really need a chance to create group of my squeezelite-esp32 clients.
Have no plan how difficult this is but this is really my last puzzle. :)

I am running squeezelite-esp32 on five ESP32-A1S modules. These modules a ready usable for non technical dudes who are not able to solder little boards. :) And easy flashable with usb, a chrome browser and this:
https://raspiaudio.github.io/
(You need to choose I2S and setup then some parameters, thats all)

I think these modules are ideal to enable anyone to build a multiroom system. Unfortunately, I think that lms is too old-fashioned for some users, so slimproto together with homeassistant could be an ideal solution.

Failure to Discover Squeezebox Boom

When running the example script i receive the following:

2022-07-11 00:34:27,782 ERROR aioslimproto.discovery -- Error occured while trying to parse a datagram from ('192.168.0.111', 3483) - data: b'd\x00\n9\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04 \x1e\xa7\\'
Traceback (most recent call last):
  File "/Users/noname/aioslimproto/aioslimproto/discovery.py", line 203, in datagram_received
    dgram = Datagram.decode(data)
  File "/Users/noname/aioslimproto/aioslimproto/discovery.py", line 42, in decode
    return ClientDiscoveryDatagram(data)
  File "/Users/noname/aioslimproto/aioslimproto/discovery.py", line 62, in __init__
    msg = struct.unpack("!cxBB8x6B", data.encode())
struct.error: unpack requires a buffer of 18 bytes

Transcoding support

At this time, playback is kept as simple as possible, by just utilizing the "direct stream" feature of SLIMproto.
In other words: the player has to deal with the content if it supports it. If a player does not support a specific codec or HTTPS it will fail to play.

The idea behind this is that the consumer of this library should take care of any needed transcoding. For example the Music Assistant integration for Home Assistant. The downside is that it adds additional complexity for the lib consumer (and probably the enduser too).

We could also implement a minimum transcoding implementation within the lib using ffmpeg or libsoxr:

  • check if player supports schema/codec
  • if the player supports the stream natively --> let player handle the stream
  • if the player does not support the stream natively --> fire up basic http server and feed the source transcoded to pcm

This might be a requirement to implement player synchronization if we can 't guarantee players to receive the same audio chunks.

Fails on setup because port is in use

Tried to install this integration to try out the new music assistant. Installed squeezelite on a raspberry pi. When adding this integration in home assistant it fails straight away (no error message or config options). In the log is the following:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/slimproto/__init__.py", line 19, in async_setup_entry
    await slimserver.start()
  File "/usr/local/lib/python3.9/site-packages/aioslimproto/server.py", line 60, in start
    self._socket_servers += await self.cli.start()
  File "/usr/local/lib/python3.9/site-packages/aioslimproto/cli.py", line 120, in start
    await asyncio.start_server(
  File "/usr/local/lib/python3.9/asyncio/streams.py", line 94, in start_server
    return await loop.create_server(factory, host, port, **kwds)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1506, in create_server
    raise OSError(err.errno, 'error while attempting '
OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 9091): address in use

Note that on an earlier attempt, the port in use was actually 3483. I'm running home assistant core 2022.6.4 in a docker container, network set to host, can't find any other binds for port 3483 so not sure why that one failed and afterwards worked, but 9091 is in use by another process (transmission RPC). Can you make the port editable?

Just checked, and looks like these are the ports used (together with 9090) by the slimserver.

Add display support

The original squeezebox (classic) players have a small display. The content of this display is supposed to be updated over SLIMproto. I did not yet implement any of that display updating magic so the display would probably still be blank.

If there's enough interest we could add the display support to the code.
Not sure if it bring any extra to the table as all newer squeezebox models and the DIY alternatives no longer use slimproto for updating the display but retrieve the info theirselves from CLI.

Extend CLI

We could extend the CLI support a bit so that players with a touchscreen/large display can show a bit more info.
At this time only basic player/button controls are implemented.

  • Media Browsing (using lib consumer callbacks?)
  • Retrieve players
  • sync/unsync

Drops login request from Squeezelite-X on same subnet

The HA server is on 192.168.100.10 and I'm running Squeezelite-X on 192.168.100.9.

The Squeezelite-X log output shows it tries to login, but doesn't receive a response after 4 seconds, so it fails:

                    Connecting to Logitech Media Server
                    ----------------------------------------------------------------------------------------------------
DBUG  19:06:13.952  Lms.ConnectTelnet called (Host=192.168.100.10:9090)
DBUG  19:06:13.952  DisconnectTelnet Called
INFO  19:06:13.952  Telnet.Status: Connecting to 192.168.100.10.
INFO  19:06:13.953  Telnet.Status: Connected.
DBUG  19:06:13.954  TelNet.Connect succeeded [2 ms]
DBUG  19:06:14.018  OnNavigationStarting: about:blank
DBUG  19:06:14.018  OnNavigationCompleted: about:blank
INFO  19:06:14.035  SND (CLI): login SlxUser ******
DBUG  19:06:14.035  ...Wait for login response
ERROR 19:06:18.035  No response to login message.
DBUG  19:06:18.035  DisconnectTelnet Called
INFO  19:06:18.035  Telnet.Status: Disconnecting.
INFO  19:06:18.035  Telnet.Status: Disconnected.
INFO  19:06:18.036  Stop Squeezelite Processes
INFO  19:06:18.041  ConnectAll Complete
INFO  19:06:18.041  Can't connect to LMS Telnet on port=9090.  Check Port Number is correct and ensure server password e
                    nabled for remote connections.

The only entry from aioslimproto is:
DEBUG (MainThread) [aioslimproto.server.jsonrpc] handle request: SlxUser for player login

When running LMS on that same machine, Squeezelite-X connects to it perfectly well, so it's probably not a networking issue on my side.

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.