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

Are there any low-latency alternative software options for Mac OS? #104

Open
luojiego opened this issue Aug 20, 2023 · 18 comments
Open

Are there any low-latency alternative software options for Mac OS? #104

luojiego opened this issue Aug 20, 2023 · 18 comments
Labels
help wanted Extra attention is needed

Comments

@luojiego
Copy link

About a year ago, I started experimenting with swyh-rs and noticed some latency on Windows. At that time, I felt it was acceptable as long as I could listen to music normally. However, recently I found that it's almost latency-free on Windows, making it suitable for watching videos or movies without any lag. But on Mac OS, I haven't come across software that's as efficient. I'm curious about what alternative software people use on Mac? Or is there any plan to adapt it for Mac?

@dheijl
Copy link
Owner

dheijl commented Aug 20, 2023

I'm sorry but I don't have a Mac so I can't adapt it myself, and I know nothing about Mac software...

@dheijl dheijl added the help wanted Extra attention is needed label Aug 20, 2023
@luojiego
Copy link
Author

Thank you for your response. I sought help in the Sonos subreddit but found that the latency is too significant to ignore. I believe I'll use Windows to watch movies.

@Nosh118
Copy link

Nosh118 commented Aug 27, 2023

Hi there - I appreciate that @dheijl doesn't have a mac, but I managed to successfully build swyh-rs on mac, but I keep receiving this error and no upnp devices are found. Do you have any idea on how I could possibly remedy this?

[ERROR] *E*E>Error reading SSDP M-SEARCH response: Resource temporarily unavailable (os error 35)
17:04:29 [ERROR] No renderers found!!!
Error: -1

@dheijl
Copy link
Owner

dheijl commented Aug 27, 2023

Apparently the MAC returns a non-standard error code for EAGAIN:

in src/rendercontrol.rs at line 561:

            Err(e) => {
                // ignore socket read timeout on Windows or EAGAIN on Linux
                if !(e.to_string().contains("10060") || e.to_string().contains("os error 11")) {
                    logger(format!("*E*E>Error reading SSDP M-SEARCH response: {e}"));
                }
            }

I suppose that adding an additional check for "os error 35" here could solve it. Could you try this?

@Nosh118
Copy link

Nosh118 commented Aug 27, 2023

Could you send across a specific code block to paste in? not very well versed in rust or error handling unfortunately

@dheijl
Copy link
Owner

dheijl commented Aug 28, 2023

I applied the change on Github, so you can use the current master. But this is the changed code:

Err(e) => {
                // ignore socket read timeout on Windows or EAGAIN/EWOULBLOCK on Linux/Unix/MacOS
                if !(e.to_string().contains("10060")
                    || e.to_string().contains("os error 11")
                    || e.to_string().contains("os error 35"))
                {
                    logger(format!("*E*E>Error reading SSDP M-SEARCH response: {e}"));
                }
            }

@Nosh118
Copy link

Nosh118 commented Aug 28, 2023

Thank you very much! Will report back once I rebuild.

@Nosh118
Copy link

Nosh118 commented Aug 28, 2023

Thank you @dheijl, that has resolved that error, although no devices are showing in the list, just as before. I have tried running with sudo and manually allowing through the firewall.

No worries if this isn't something you're able to solve though, I know you don't have a mac!

@dheijl
Copy link
Owner

dheijl commented Aug 28, 2023

Can you run it with log level debug, and then attach the log file here? Or did you check already in the log that no devices are responding to the ssdp query?

@Nosh118
Copy link

Nosh118 commented Aug 28, 2023

18:11:49 [DEBUG] (1) swyh_rs_cli: Try capturing system audio
18:11:49 [INFO] Capturing audio from: MacBook Pro Speakers
18:11:49 [INFO] Default audio SupportedStreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Range { min: 14, max: 4096 }, sample_format: F32 }
18:11:49 [INFO] Discover networks
18:11:49 [INFO] Starting SSDP discovery
18:11:49 [INFO] The streaming server is listening on http://192.168.1.71:5901/stream/swyh.wav
18:11:49 [DEBUG] (3) swyh_rs::openhome::rendercontrol: SSDP discovery started
18:11:49 [INFO] Streaming sample rate: 44100, bits per sample: 16, format: LPCM
18:11:49 [DEBUG] (4) tiny_http: Server listening on 192.168.1.71:5901
18:11:49 [DEBUG] (5) tiny_http: Running accept thread
18:11:52 [DEBUG] (3) swyh_rs::openhome::rendercontrol: Getting new renderer descriptions
18:11:52 [DEBUG] (3) swyh_rs::openhome::rendercontrol: SSDP discovery complete
18:11:54 [ERROR] No renderers found!!!
Error: -1

@dheijl
Copy link
Owner

dheijl commented Aug 28, 2023

Thanks, but:

  • debug logging is not activated (-l debug)
  • this is not the complete log file, just an excerpt

Can you attach the complete log file using the GitHub drag and drop feature?

But anyway it looks like the SSDP responses from UPNP devices are not getting through. Other programs seem to have similar problems using UDP on recent MAC OS versions according to Reddit ...

@dheijl
Copy link
Owner

dheijl commented Aug 28, 2023

Perhaps this explains it:

https://forum.xojo.com/t/big-sur-udp-broadcast-not-working-normally/58832

So goodbye to open source on MAC OS if this is true.

@Nosh118
Copy link

Nosh118 commented Aug 28, 2023

From what I read, it still looks possible - just with a couple of extra caveats. Completely understand why you might not want to put the effort into adapting this though, just a shame I can't find anything near as good as this project for macOS!

@dheijl
Copy link
Owner

dheijl commented Aug 28, 2023

Feel free to add anything needed and make a pull request if you get it to work!

@Nosh118
Copy link

Nosh118 commented Aug 28, 2023

Thanks, but:

  • debug logging is not activated (-l debug)
  • this is not the complete log file, just an excerpt

Can you attach the complete log file using the GitHub drag and drop feature?

But anyway it looks like the SSDP responses from UPNP devices are not getting through. Other programs seem to have similar problems using UDP on recent MAC OS versions according to Reddit ...

Sorry - missed this, have tried running with -l debug now and I'm not sure where the log file is saved to.

@dheijl
Copy link
Owner

dheijl commented Aug 28, 2023

It should be in a .swyhr-rs folder in your home directory, if such a thing exists on a MAC.

@Nosh118
Copy link

Nosh118 commented Aug 31, 2023

Found the folder, but can’t seem to find any log files unfortunately.

@dheijl
Copy link
Owner

dheijl commented Aug 31, 2023

Anyway, let's keep this open in the hope that someone with Mac and Rust knowledge is prepared to help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants