Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to detect Sonos One speaker #466

Open
michaelelleby opened this issue May 24, 2024 · 5 comments
Open

Unable to detect Sonos One speaker #466

michaelelleby opened this issue May 24, 2024 · 5 comments

Comments

@michaelelleby
Copy link

I am using the code at Git commit 1d14cdfdc87bab288c889b073ac2e222e9a8309d

> pip3 install soco
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: soco in /home/michael/.local/lib/python3.10/site-packages (0.30.4)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from soco) (2.25.1)
Requirement already satisfied: xmltodict in /home/michael/.local/lib/python3.10/site-packages (from soco) (0.13.0)
Requirement already satisfied: ifaddr in /usr/lib/python3/dist-packages (from soco) (0.1.7)
Requirement already satisfied: appdirs in /home/michael/.local/lib/python3.10/site-packages (from soco) (1.4.4)
Requirement already satisfied: lxml in /home/michael/.local/lib/python3.10/site-packages (from soco) (5.2.2)

> bin/mkchromecast -t
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
Mkchromecast v0.3.9
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
Selected backend: BackendInfo(name='parec', path='/usr/bin/parec')
Selected audio codec: mp3
Using bitrate: 192
Using sample rate: 44100Hz
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
 
List of Devices Available in Network:
-------------------------------------

Index   Type    Friendly Name 
=====   =====   ============= 
0 	Gcast 	Soveværelse
1 	Gcast 	Legestue Google TV
2 	Gcast 	Stue TV
available_devices received
Available Media Streaming Devices [AvailableDevice(index=0, name='Soveværelse', type='Gcast'), AvailableDevice(index=1, name='Legestue Google TV', type='Gcast'), AvailableDevice(index=2, name='Stue TV', type='Gcast')]

I have a Sonos One speaker running at 192.168.1.122 and it is reachable using https://github.com/pascalopitz/unoffical-sonos-controller-for-linux which is to say that I can reach it from my Linux pc. As seen in the log above mkchromecast does not detect it.

@xsdg
Copy link
Collaborator

xsdg commented May 24, 2024

*sigh* I thought I had written up a bug about this, but it looks like I had only mentioned it in a comment; my apologies for that.

Long story short, I had disabled sonos support as part of an ongoing refactor that is not complete. The easy thing would be to check out the stable branch and use that instead of master. You could also use commit 07598801 if you wanted a more recent (thought still unstable, to be clear) version of the code.

@xsdg
Copy link
Collaborator

xsdg commented May 24, 2024

I just filed #467 to track restoring Sonos support.

@michaelelleby
Copy link
Author

Unfortunately neither stable branch nor commit 07598801 worked

~/git/mkchromecast$ git status
HEAD detached at 07598801
nothing to commit, working tree clean

~/git/mkchromecast$ ./bin/mkchromecast -t
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
Mkchromecast v0.3.9
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
Selected backend: BackendInfo(name='parec', path='/usr/bin/parec')
Selected audio codec: mp3
Using bitrate: 192
Using sample rate: 44100Hz
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
:::config::: WARNING: USING BETA CONFIG PATH: /home/michael/.config/mkchromecast/mkchromecast_beta.cfg
:::config::: Creating missing section 'settings'
:::config::: Missing keys _not_ being saved for read-only config
 
List of Devices Available in Network:
-------------------------------------

Index   Types   Friendly Name 
=====   =====   ============= 
0 	Gcast 	Legestue Google TV
1 	Gcast 	Soveværelse
2 	Gcast 	Stue TV
available_devices received
Available Media Streaming Devices [[0, 'Legestue Google TV', 'Gcast'], [1, 'Soveværelse', 'Gcast'], [2, 'Stue TV', 'Gcast']]

~/git/mkchromecast$ git checkout stable
Previous HEAD position was 07598801 Merge pull request #456 from xsdg/noop_fixups
Switched to branch 'stable'
Your branch is up to date with 'origin/stable'.

~/git/mkchromecast$ ./bin/mkchromecast -t
Mkchromecast v0.3.9
Selected backend: /usr/bin/parec
Selected audio codec: mp3
Default bitrate used: 192k
Default sample rate used: 44100Hz.
 
List of Devices Available in Network:
-------------------------------------

Index   Types   Friendly Name 
=====   =====   ============= 
0 	Gcast 	Legestue Google TV
1 	Gcast 	Soveværelse
2 	Gcast 	Stue TV
available_devices received
Available Media Streaming Devices [[0, 'Legestue Google TV', 'Gcast'], [1, 'Soveværelse', 'Gcast'], [2, 'Stue TV', 'Gcast']]

@xsdg
Copy link
Collaborator

xsdg commented May 25, 2024 via email

@muammar
Copy link
Owner

muammar commented May 27, 2024

mkchromecast --debug --discover

This does not work either:

muammar@pupa ~/git/mkchromecast [master]
± % bin/mkchromecast --debug --discover                                                                                                                                                                         !3222
Traceback (most recent call last):
  File "/Users/muammar/git/mkchromecast/bin/mkchromecast", line 285, in <module>
    mkcc = mkchromecast.Mkchromecast()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muammar/git/mkchromecast/bin/../mkchromecast/__init__.py", line 194, in __init__
    elif self.codec in constants.CODECS_WITH_BITRATE:
         ^^^^^^^^^^
AttributeError: 'Mkchromecast' object has no attribute 'codec'. Did you mean: 'vcodec'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants