Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Minecraft and Pulseaudio (was: OSS4) woes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
JohnLM
n00b
n00b


Joined: 20 Apr 2009
Posts: 71
Location: LATVIA

PostPosted: Mon Nov 19, 2018 8:42 pm    Post subject: [SOLVED]Minecraft and Pulseaudio (was: OSS4) woes Reply with quote

Hi! After a little hiatus (2 years) I thought of spinning up Minecraft, but found that sound is very choppy. :(

OK -- as you may have gathered from title -- I'm using OSS4
Code:
# ossinfo | head -n 2
Version info: OSS 4.2 (b 2017/201805291235) (0x00040100) GPL
Platform: Linux/x86_64 4.9.76-aufs-r1 #3 SMP Thu Jun 28 19:41:22 EEST 2018 (isg005)


and I believe it may have something to do with it (but it may not).

First, things I've tried already:

  1. Changing sampling rate (from default 48000 Hz to 44100Hz) with vmixctl didn't help. :(
  2. Tried different Java VMs (in addition Oracle JDK) -- still same. :(
  3. Fruitlessly (and I later found, also needlessly) tied changing sound.properties settings.


I found that Minecraft routes its audio via Pulseaudio (unlike Java's default). I don't know if it did so previously, but playing something with paplay sounds well and so does playing a .wav via Java Sound API which -- much against my expectations -- does not use Pulseaudio. That's weird since I thought one of the ways would also produce choppy sound. My only hunch it is something more specific to the LWJGL library the Minecraft uses, or specifically the OpenAL the LWJGL is bundled with. But I have no idea where to go from here or what else to test. Any help would be appreciated. Thanks!
_________________
"I reject your reality and substitute my own" - A. Savage


Last edited by JohnLM on Tue Nov 20, 2018 9:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
JohnLM
n00b
n00b


Joined: 20 Apr 2009
Posts: 71
Location: LATVIA

PostPosted: Tue Nov 20, 2018 8:25 pm    Post subject: Reply with quote

New find today!
I tested aplay because Chewi recalled (in PM) that LWJGL's bundled OpenAL used to use ALSA. aplay plays fine (for record I've set up ALSA userland to patch sound via OSS), BUT a retest of paplay quickly showed that it in some cases have stuttering playback or/and glitches when it finishes and audio data is "drained". This must be Pulseaudio -- isn't that unexpected!? :roll: Well to be fair, having Pulseaudio use OSS as backend is deprecated (on Linux at least).
_________________
"I reject your reality and substitute my own" - A. Savage


Last edited by JohnLM on Tue Nov 20, 2018 9:51 pm; edited 2 times in total
Back to top
View user's profile Send private message
JohnLM
n00b
n00b


Joined: 20 Apr 2009
Posts: 71
Location: LATVIA

PostPosted: Tue Nov 20, 2018 9:43 pm    Post subject: Minecraft and Pulseaudio woes Reply with quote

Got it! :!:

All this came down to OpenAL and the fix was awfully simple! Ubuntu lads had a sound problem where they tried doing the reverse, i.e., get OpenAL to use Pulseaudio, but since this already happens for me, I want to reverse it.
And that's easy -- Create an ~/.alsoftrc file with:
Code:
drivers=oss

Or in /etc/openal/alsoft.conf file if you need this global.

It works equally well for me if I configure for ALSA, so any ALSA user with similar problem should write:
Code:
drivers=alsa

And being non-OSS-specific, I'm changing the topic title.

If this worked for you too, write it here or drop a PM. (I want to know if my posts help anyone)
_________________
"I reject your reality and substitute my own" - A. Savage
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum