LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-17-2016, 05:46 PM   #1
dalgrim
Member
 
Registered: Nov 2014
Location: Michigan, USA
Distribution: slackware14.1 x64
Posts: 37

Rep: Reputation: Disabled
no usable sound from java commandline programs - pulseaudio


**READ BELOW FOR CURRENT STATUS**
OK so under ALSA commandline java apps had sound(slackware14.1). Now that I'm on 14.2 this beast of pulseaudio was shoved upon us and now I can not get usable sound. I say usable sound because I can see in pavucontrol that the sound is being forced to my videocard's hdmi port. I have no way of telling it to use my sound card (EMU20K2 Soundblaster X-fi) I've tried pctl and still no luck. I tried clicking on the output but can not select the other card.

Any ideas?

Edit:
**** CURRENT STATUS ****
I thought I had it working, but after a power outage(with graceful shutdown, Thanks APC Backups) I booted this morning and I still have sound problems.
I'm using official Java8u112.
OpenAL1.17.2 via slackbuilds

Here is the symptoms.
When I boot the system I have sound. I can watch a youtube video, etc. I can see volume controls and use KDE's Audio and Video Settings. I can click each of the 4 speakers and hear "front left" "Rear right" etc. The second I run Java it kills ALL sounds. It even stops a youtube video dead in its tracks. This persists through logouts! I must reboot to clear this and get sound again from my sound card. Interestingly enough if I use pavucontrol and change the "CubeUtils (Firefox youtube)'s playback to GM204 HDMI I'll see mixer activity and the video will start playing(without sound). The video pauses(hangs) the second I select EMU20k2 again.

Things I've tried:
ps -ef | grep java (after Java is closed) no results so java is not currently running. yet sound is still dead.
~/.asoundrc configs (see below for both I've tried)
~/.alsoftrc (Quite possibly the worst documented sound plugin ever.)
/usr/lib64/java/jre/lib/sound.properties (see below for lines added)
/etc/pulse/default.pa (see below for lines added)
removing official Java and installing OpenJDK. (see below for sound.properties lines added)

I'm out of ideas now. I'm especially confused as to why it worked before and making the exact same changes results in different results now.

-Brian
Attached Thumbnails
Click image for larger version

Name:	nosound1.png
Views:	65
Size:	25.3 KB
ID:	23553   Click image for larger version

Name:	nosound2.png
Views:	62
Size:	40.7 KB
ID:	23554  

Last edited by dalgrim; 11-21-2016 at 08:20 AM.
 
Old 11-17-2016, 06:11 PM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
Have you tried using `aplay -l` to identify your sound cards, and then creating an .asoundrc file to define which card gets priority? Example, assuming your Emu card is card 1:


Code:
defaults.ctl.card 1
defaults.pcm.card 1
defaults.timer.card 1

pcm.!default {
type hw
card 1
device 0
}

ctl.!default {
type hw
card 1
device 0
}

pcm.dsp {
type plug
slave.pcm "dmix"
}
Remember that Pulse sits on top of ALSA, so anything you know about ALSA should still apply.
 
Old 11-17-2016, 07:35 PM   #3
dalgrim
Member
 
Registered: Nov 2014
Location: Michigan, USA
Distribution: slackware14.1 x64
Posts: 37

Original Poster
Rep: Reputation: Disabled
The problem is pulse is grabbing the sound. it is then forcing it to the wrong output. If you look at the first image, it shows that there is sound output on the hdmi device. (The bottom bar is a current output level display. That bar moves as sound it supposed to play. When I click the box that says "GM204 High...HDMI" it gives me an option button selection dropdown containing EMU20k2 however selecting it with either the mouse or keyboard and "space" to select it does nothing. It immediately reverts back to the HDMI.

And yes I have tried the asoundrc file.

my next step is to kill Pulse and see if the sound works in asla. Which I assume it will. This isn't a permanent solution as Pulse is required now...


-------Edit-------
If I "pactl exit" killing pulseaudio the sound works fine in the java app. The second I restart pulseaudio the sound is gone. So I am now sure it's a pulseaudio problem. Any idea how to fix it?

surely someone else here has a nvidia card and plays minecraft right?

-Brian

Last edited by dalgrim; 11-17-2016 at 07:41 PM.
 
Old 11-17-2016, 09:38 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Have you tried setting your analog card as the default device in your /etc/pulse/default.pa?

https://wiki.archlinux.org/index.php..._output_source

You could try blacklisting the snd_hda_codec_hdmi module.
 
Old 11-18-2016, 01:30 AM   #5
number22
Member
 
Registered: Sep 2006
Location: Earth
Distribution: Slackware 14.1 Slackware64-current multilib
Posts: 278
Blog Entries: 7

Rep: Reputation: Disabled
modify sound.properties:
add
Code:
javax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider
javax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider
javax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider
javax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider
 
Old 11-18-2016, 02:24 PM   #6
dalgrim
Member
 
Registered: Nov 2014
Location: Michigan, USA
Distribution: slackware14.1 x64
Posts: 37

Original Poster
Rep: Reputation: Disabled
updates:
So far none of the above worked. I was however able to figure out a way to get it working kinda

OpenAL was part of the problem
I needed to make a file ~/.alsoftrc
Code:
# ~/.alsoftrc
[pulse]
allow-moves=yes
I also needed to update my ~/.asoundrc file with:
Code:
pcm.!default {
    type pulse
}

ctl.!default {
    type pulse
}

pcm.pulse {
    type pulse
}

ctl.pulse {
    type pulse
}
The combination of these allows me to use pavucontrol (pulse Audio Volume Control) to select the output device once it is started (first file change) and the second file allows the sound to play.

I still have to manually change the output device every time from HDMI to EMU20k2 but at least I have sound. I believe the default device is from OpenAL
Code:
bash-4.3$ openal-info 
Available playback devices:
    GM204 High Definition Audio Controller Digital Stereo (HDMI)
    EMU20k2 [X-Fi Titanium Series] (SB0880 [SoundBlaster X-Fi Titanium PCI-e]) Analog Surround 4.0
Available capture devices:
    EMU20k2 [X-Fi Titanium Series] (SB0880 [SoundBlaster X-Fi Titanium PCI-e]) Analog Stereo
    Monitor of GM204 High Definition Audio Controller Digital Stereo (HDMI)
    Monitor of EMU20k2 [X-Fi Titanium Series] (SB0880 [SoundBlaster X-Fi Titanium PCI-e]) Analog Surround 4.0
Default playback device: GM204 High Definition Audio Controller Digital Stereo (HDMI)
Any idea how to change that?

-Brian

Last edited by dalgrim; 11-18-2016 at 02:25 PM.
 
Old 11-18-2016, 07:51 PM   #7
number22
Member
 
Registered: Sep 2006
Location: Earth
Distribution: Slackware 14.1 Slackware64-current multilib
Posts: 278
Blog Entries: 7

Rep: Reputation: Disabled
in /etc/modprobe.d/sound.conf add your sound card drive modules options:

Code:
options snd-ctxfi index=0 id=sb
use lspci -vv to find which kernel module for HDMI. if it uses snd_hda_intel
Code:
options snd_hda_intel index=1 id=hdmi

Last edited by number22; 11-18-2016 at 08:02 PM.
 
Old 11-20-2016, 10:54 AM   #8
dalgrim
Member
 
Registered: Nov 2014
Location: Michigan, USA
Distribution: slackware14.1 x64
Posts: 37

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by number22 View Post
in /etc/modprobe.d/sound.conf add your sound card drive modules options:

Code:
options snd-ctxfi index=0 id=sb
use lspci -vv to find which kernel module for HDMI. if it uses snd_hda_intel
Code:
options snd_hda_intel index=1 id=hdmi
I've tried this but it is not a sound card enum issue in ALSA. This made no change in the results. I've update the top post with the current status.

-Brian
 
Old 11-21-2016, 08:18 AM   #9
dalgrim
Member
 
Registered: Nov 2014
Location: Michigan, USA
Distribution: slackware14.1 x64
Posts: 37

Original Poster
Rep: Reputation: Disabled
Update: Sound is now completely fubar. Anything that tries to use sound except pulse native kills the sound system. I'm sure I've probably caused it by changing so many config files. I thought I changed them all back but I must have missed one.

I also tried removing official Java and installing OpenJDK and adding:
Code:
javax.sound.sampled.Clip=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
javax.sound.sampled.Port=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
javax.sound.sampled.SourceDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
javax.sound.sampled.TargetDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
to Java's sound.properties with no luck.

If I can't get this working I'll have to uninstall and go back to 14.1.

-Brian
 
Old 11-21-2016, 01:30 PM   #10
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Try reinstalling (upgradepkg --reinstall) your audio packages, then go through the .new files and see what wasn't reverted back to the original conf files.

Also, check for an .asoundrc in your home directory to make sure it isn't overriding system defaults.
 
Old 11-22-2016, 04:34 PM   #11
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
What java program that is using audio are you running?
 
Old 11-23-2016, 09:50 PM   #12
dalgrim
Member
 
Registered: Nov 2014
Location: Michigan, USA
Distribution: slackware14.1 x64
Posts: 37

Original Poster
Rep: Reputation: Disabled
In this case the Java program is Minecraft. But the current status is that the entire sound system is now messed up even native sounds are not working anymore. I'll be trying bassmadrigal's suggestion of reinstalling all the sound subsystems. I think that's just ALSA and Pulse correct?

-Brian
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Winecfg crashes on sound tab with Pulseaudio and no 'sounddrivers' without pulseaudio William (Dthdealer) Linux - Software 5 06-13-2010 07:30 AM
How do I make Sun Java output sound through PulseAudio using a browser? Mr Beanjamin Linux - Desktop 1 04-27-2010 07:50 PM
Linking Programs to the commandline BorgKiller Linux - Software 2 04-05-2005 09:10 PM
Problem starting programs from commandline Error1312 Slackware 10 06-20-2004 09:16 AM
creating graphical front ends to commandline programs seidren Programming 5 02-05-2004 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration