i-rinat / apulse

PulseAudio emulation for ALSA
MIT License
610 stars 35 forks source link

gurgly audio #91

Open Tcll opened 6 years ago

Tcll commented 6 years ago

just recently got this working with Discord since pulse decided to die after an update... (I'm completely happy with pulse dieing because it sucked anyways)

so while this works in Discord, all audio coming through it is gurgly, and any call just drops audio after 10 seconds at most if not instantly. note that this does not include my mic, that has no problems at all and works perfectly.

no it's not discord as everything but voice works perfectly fine on alsa

SoniEx2 commented 5 years ago

set the audio buffer to 128.

I'm not sure how to do that on discord, but with chrome it's --audio-buffer-size=128

bigger buffers are worse.

ch-f commented 5 years ago

seems to be the same issue on Firefox 67.0.2, any idea how to increase buffer for Firefox?

Crypto90 commented 5 years ago

I run into some similar issues. Im currently testing apulse with firefox 66 and chromium on linux. I play a test stereo mp3 file and analyze the buffer from the apulse-stream.

It looks like, apulse gets „null bytes“ from both browsers during playback. If I write the buffer into a file in binary mode, the content looks like:

(Simplistic showcase): 0x00 0x00 0x00 0x00 0x00 DATA DATA 0x00 0x00 DATA 0x00 0x00 DATA 0x00 0x00

Which results in „stuttering“ because the audio stream gets somewhere corrupted by those 0x00. I tried debugging this and analyzed this with audacity and played the saved file with the raw buffer data. Those 0x00 bytes are silences gaps between the audio (which plays well) butt its stuttering like hell.

I tried setting „—audio-buffer-size=128“ in the chromium tests, but this did not change anything with this stuttering 0x00 byte issue.

Any idea whats going on here?

ch-f commented 5 years ago

Crypto90: just for testing, can you throw those 0x00s out when they do enter the stream?

Crypto90 commented 5 years ago

Crypto90: just for testing, can you throw those 0x00s out when they do enter the stream?

I tried. The output is totally corrupted garbage :( Im stuck with this issue since 4-5 days still searching for a solution. I tried l: apulse mplayer test.mp3 which worked great. No silence stutter gaps between the sound data. Firefox and chromium create all those issues. I just want to record the audio into a file, i will not pass the data to alsa. I set the default input and output device with the environment variable to null. I tried different browser versions, tested firefox 67, 66, 60, also firefox-esr, chromium. All do get the same issue.

Yesterday I made some more tests and saw, that those stuttering gaps between the sound data is not persistent. If I run the test 10 times, the recorded output file will have 10 times different sizes. So it looks like those silence gaps gets produced in a way each time is different. My test mp3 file is 30 seconds long, the recorded output file is 7-10 minutes long, bloated with those silence gaps all over the track.