SamDel / ChromeCast-Desktop-Audio-Streamer

Stream the sound of your desktop to your Chromecast Audio device
MIT License
411 stars 30 forks source link

Audio crackling #90

Closed ceddiec closed 3 years ago

ceddiec commented 3 years ago

I notice some audio crackling whatever setting I use (stream format or lag control). More precisely there's a lot of crakling from web browsers, much less from apps like Amazon music. I'm using Windows 10 on Surface Pro and streaming to Chromecast Audio.

SamDel commented 3 years ago

It can be the capturing of audio from the soundcard, or the encoding to mp3. Have you tried switching to WAV?

ceddiec commented 3 years ago

Yes, WAV does improve the quality but some craklings are still there.

SamDel commented 3 years ago

I have no clue. Have you tried this tool https://github.com/acidhax/chromecast-audio-stream? Also craklings?

ceddiec commented 3 years ago

https://github.com/acidhax/chromecast-audio-stream seems to do the trick, no more craklings it seems. On first launch only icon displayed, with no menu appearing. second launch was OK. I guess I should cross my fingers whenever I'm launching the app. Thank you anyway!

SamDel commented 3 years ago

Thanks for letting me know.

For capturing the audio I use CSCore. There's an issue there about bad sound quality. I applied the patch mentioned there to the dll in this zip file.

Can you try to replace CSCore.dll in the install folder (C:\Program Files (x86)\Desktop Audio Streamer\Desktop Audio Streamer) with the one in the zip file? It's easier to install Setup 3.1.7.zip. Hope you're still there.

ceddiec commented 3 years ago

Hi, Copied the new dll with no real improvement. I notice the "normalize" option in deezer app does improve things a bit but there's still crakling depending on music.

WimdeGelder commented 3 years ago

I had the same problem but I found out that there is an digital overload from the source (musicplayer, website, Spotify) to Audio Streamer. If you put the source on 30% or 50%, there is no more digital distortion. When the signal is transferred internally to your soundcard or computerspeakers there is no problem, so it looks like the old analogue "too much input gain" distortion. It wouldn´t be a bad idea to look at this problem, for example to make the input of the Audio Streamer 50% less sensitive. For the rest, all together the program works very fine, thanks!

SamDel commented 3 years ago

Thanks, good research! Is the dB meter in Audio Streamer at 100% when the source is at 100% ?

WimdeGelder commented 3 years ago

Hi, the dB meter varies between 40% when the sourcelevel is at 1%, and 70% when sourcelevel is at 100%. So it is not a reliable instrument, it just shows that there is a signal present.

Perhaps you can contact a digital audio engineer to provide you with the right parameters to organise your inputlevels and to implement a real dB meter?

WimdeGelder commented 3 years ago

In the versions of AudioCast this problem didn´t occur. Perhaps you can use the audio input stage of one of these versions? Just thinking....

SamDel commented 3 years ago

Thanks, i'm going to do some tests with the dB meter and inputlevels later. Do you mean this AudioCast?

WimdeGelder commented 3 years ago

I mean the earlier version of your program, that is called Audio-Cast: https://github.com/acidhax/chromecast-audio-stream/releases/download/0.3/audio-cast-win32-ia32.zip

SamDel commented 3 years ago

Thanks for waiting.

Ah, that's a completely different program, but it inspired me to make this one. I can't really use any part of it because the code is completely diffeent.

How's Setup 3.3.1.zip for you? I removed changing the samplerate to 44100 in this version.

WimdeGelder commented 3 years ago

Thanks for your effort!

This version works fine, no cracklings at all. Together with the clear layout and the ease of use it is a very nice program. The dB meter isn’t of any use, but that is not important.

You removed a sort of resampling loop as I could see. That could well be the problem. I can still choose the 44,1 kHz output option, which I do of course.

Thanks! What do I owe you 😊?

Kindest regards, Wim.

SamDel commented 3 years ago

Nice!

The resampling was added because of this issue. Chromecast TV didn't support Wav 48kHz (it looks like 48kHz is supported now). That's why I always resampled to 44,1kHz.

I forgot to change the label in the dropdown (Wav 44100) in version 3.3.1. When wav is selected it now streams the audio in the samplerate of your soundcard. In Setup 3.3.3.zip I changed the label to 'Wav', I'll make a 3.4 release of it later!

Thanks! What do I owe you 😊?

Maybe I'll ask you to do a test another time 😉 .

SamDel commented 3 years ago

How's Setup 3.3.5.zip for you @WimdeGelder?

I added some Wav formats in the stream format dropdown:

The sample rate that's used is logged like "Stream format set to Pcm 48000 24 bit" on the log tab.

WimdeGelder commented 3 years ago

Hi, thank you very much, it works perfect for me, in all streaming formats.

Sorry I kept you waiting, I haven’t been in my restaurant for a while where I have my multiroom setup.

And….. thanks for thanking me 😊 !

SamDel commented 3 years ago

Good to hear this software is being used in a restaurant 😃! I removed the 32 bit wav option from the 3.4 release (I wasn't sure about the quality) but will add it again in the next release.

Thanks again for testing 😊.

WimdeGelder commented 3 years ago

Thanks! The 32-bit option isn´t of any use, because the best quality of the Audiocast is 96 KHz / 24-bit on the optical output, the analogue output is far worse than that.

I use an external DA converter in combination with a pair of professional loudspeakers (https://www.dbaudio.com/global/en/products/heritage/f1222/) so I can easily hear imperfections.

SamDel commented 3 years ago

It looks like 32-bit is not supported (not sure). I'm closing this one, please open a new issue if you have further issues.

WimdeGelder commented 3 years ago

Of course! Thanks for the great app en the great support!