I am trying to configure jukebox player when i select it in web browser and ask player to play it is not doing anything other than adding songs to play que. Log contains error
"ERROR --- o.a.p.s.JukeboxLegacySubsonicService : Error in jukebox: java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian is supported."
I tried to change player to "Java jukebox" (no audio device is listed in drop down settings) but it doesn't play either and no songs are added to play que. No error in the logs though.
"2018-10-15 23:40:40.090 INFO --- o.a.p.service.JukeboxJavaService : begin initAudioPlayer
2018-10-15 23:40:40.091 INFO --- o.a.p.service.JukeboxJavaService : use default mixer"
I tried to follow https://airsonic.github.io/docs/jukebox/ but having problems with running the java to find device list not sure how to do it, tried saving to a file and running java and filename but it was showing that it couldn't find the main class.
I am not a developer and not sure if i am posting in correct place.
you might need to tweak the audio device being picked up by Java sound.
i think this is the problem. make sure you run:
import java.io.*;
import javax.sound.sampled.*;
public class audioDevList {
public static void main(String args[]) {
Mixer.Info[] mixerInfo =
AudioSystem.getMixerInfo();
System.out.println("Available mixers:");
for(int cnt = 0; cnt < mixerInfo.length;cnt++) {
System.out.println(mixerInfo[cnt].getName());
}
}
}
and add the generate the proper _sound.properties_, e.g.:
javax.sound.sampled.Clip=#PCH [plughw:1,0]
javax.sound.sampled.Port=#Port PCH [hw:1]
javax.sound.sampled.SourceDataLine=#PCH [plughw:1,0]
javax.sound.sampled.TargetDataLine=#PCH [plughw:1,0]
i think you named the device _SourceDataLine_ and it's saying that it doesn't support what airsonic is giving it. then use the same device name for the java parameters when booting the jukebox.
that's just a guess, i've never used this.
you might need to tweak the audio device being picked up by Java sound.
i think this is the problem. make sure you run:
import java.io.*; import javax.sound.sampled.*; public class audioDevList { public static void main(String args[]) { Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo(); System.out.println("Available mixers:"); for(int cnt = 0; cnt < mixerInfo.length;cnt++) { System.out.println(mixerInfo[cnt].getName()); } } }and add the generate the proper _sound.properties_, e.g.:
javax.sound.sampled.Clip=#PCH [plughw:1,0] javax.sound.sampled.Port=#Port PCH [hw:1] javax.sound.sampled.SourceDataLine=#PCH [plughw:1,0] javax.sound.sampled.TargetDataLine=#PCH [plughw:1,0]i think you named the device _SourceDataLine_ and it's saying that it doesn't support what airsonic is giving it. then use the same device name for the java parameters when booting the jukebox.
that's just a guess, i've never used this.
I tried to follow the documentation but i am not able to run java program, how do i do it, i tried saving it to a file and running "java 'filename' " but i am getting error that it cannot find main class. Would you know how to do it or can provide .jar file that has java.io.; and javax.sound.sampled.; classes?
Try to compile your java file first and then run it.
Let's say the files is named : AudioDevList.java
javac AudioDevList.java
java AudioDevList
Try to compile your java file first and then run it.
Let's say the files is named :
AudioDevList.javajavac AudioDevList.java java AudioDevList
Thank you, that did the tric on listing devices. File has to be named the same as public class which is audioDevList.java.
So first copy code and put in file called audioDevList.java
javac audioDevList.java
java audioDevList
I will try to play with java sound.properties and let you know later as it didn't work for me. I will try to start from scratch to make sure it is not something i installed.
I think this should be added to document https://airsonic.github.io/docs/jukebox/ for users that are dumb as me not knowing how to compile java :)
Clean install of raspbian lite Linux raspberrypi 4.14.50-v7+ #1122 S, no proxy servers.
java audioDevList output
Available mixers:
ALSA [default]
ALSA [plughw:0,0]
ALSA [plughw:0,1]
Port ALSA [hw:0]
>
sudo nano /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/sound.properties
javax.sound.sampled.Clip=ALSA [plughw:0,0]
javax.sound.sampled.Port=Port ALSA [hw:0]
javax.sound.sampled.SourceDataLine=ALSA [plughw:0,0]
javax.sound.sampled.TargetDataLine=ALSA [plughw:0,0]
Rebooted pi but the same problems.
Using jukebox player I can see items in the play que but error in the logs
2018-10-18 18:49:31.531 ERROR --- o.a.p.s.JukeboxLegacySubsonicService : Error in jukebox: java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian is supported.
Used java jukebox player, can see items in play que and below info in the logs but no playback progress or sound.
2018-10-18 18:41:54.687 INFO --- o.a.p.service.JukeboxJavaService : begin initAudioPlayer
2018-10-18 18:41:54.689 INFO --- o.a.p.service.JukeboxJavaService : use default mixer
I tried adding # as per example but it didn't work either
javax.sound.sampled.Clip=#ALSA [plughw:0,0]
javax.sound.sampled.Port=#Port ALSA [hw:0]
javax.sound.sampled.SourceDataLine=#ALSA [plughw:0,0]
javax.sound.sampled.TargetDataLine=#ALSA [plughw:0,0]Just an update, I tried "#ALSA [default]" but it didn't work either.
javax.sound.sampled.Clip=#ALSA [default]
javax.sound.sampled.Port=#Port ALSA [hw:0]
javax.sound.sampled.SourceDataLine=#ALSA [default]
javax.sound.sampled.TargetDataLine=#ALSA [default]The only thing I haven't tried is section "Using Java parameters" from https://airsonic.github.io/docs/jukebox/
"You can pass the devicename as parameter into the launch script/service file"
Would anybody let me know which file to edit or any other suggestions?
Hello,
Just updating to show that I am still looking for assistance on this as i can't get it working. I tried searching online how to use sound in linux and with java but it is just a maze for me. The only thing i haven't tried is passing parameters to startup script as it is a long file /etc/init.d/tomcat8 and mentions that some variables are overwritten by /etc/default/tomcat8. Also i am not sure if it is off any benefit to be adding service startup script if it doesn't work with sound.properties.
I think I found the solution, there was no need in setting sound.properties or passing java parameters, all i had to do is add tomcat8 user to audio group. sudo adduser tomcat8 audio
I got this information from one post by rwdolson rasspberrypi forums
I will do a clean install to make sure that it is not something else and will report my findings.
Feel free to send an update to the documentation https://github.com/airsonic/documentation. Thanks
Most helpful comment
Try to compile your java file first and then run it.
Let's say the files is named :
AudioDevList.java