Re: [Alsa-devel] DMX6fire / ice1712: Long initialization time for playback with Java
Takashi Iwai wrote: Hi, does it access via OSS API? yes I have to use the oss-emulation device, because the alsa devices to show up in java but can't be used at all. Though they appear as "DMX6Fire [plughw:0,0]" they dont seem to be using the plug layer properly. When asked for what format they support, they say "signed pcm, 32-bit mono, little-endian" but they can't be used even for streams in that specific format. All formats I try to play with them just throw an java.lang.IllegalArgumentException: Line unsupported. I found out that mpg123 has exactly the same problem with the oss-emulation, beginning from alsa-driver-0.9.3b, it takes 30 seconds for playback to start. both mplayer and xmms don't show this problem with oss output, they only need about 1/2 second for skipping in the stream as I told before. strangely 'alsaplayer -o oss' works fine, as does 'aoss mpg123' (using dmixed output) could you try stace to check what gets into sleep? in case you meant strace, I have attached the output of 'strace -r mpg123 some.mp3' for both alsa-driver 0.9.3a and b. Never used strace before, so if the information you need is not in the files, please tell me exactly how to invoke it. gruss, Steffen 0.00 execve("/usr/bin/mpg123", ["mpg123", "Abstrakt.mp3"], [/* 51 vars */]) = 0 0.000303 uname({sys="Linux", node="braunschweig", ...}) = 0 0.000154 brk(0)= 0x8093ba8 0.61 open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory) 0.90 open("/etc/ld.so.cache", O_RDONLY) = 3 0.47 fstat64(3, {st_mode=S_IFREG|0644, st_size=63041, ...}) = 0 0.79 mmap2(NULL, 63041, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40014000 0.46 close(3) = 0 0.58 open("/lib/libm.so.6", O_RDONLY) = 3 0.47 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\2405\0"..., 1024) = 1024 0.74 fstat64(3, {st_mode=S_IFREG|0755, st_size=186329, ...}) = 0 0.57 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40024000 0.47 mmap2(NULL, 136416, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40025000 0.40 mprotect(0x40046000, 1248, PROT_NONE) = 0 0.41 mmap2(0x40046000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x20) = 0x40046000 0.56 close(3) = 0 0.54 open("/lib/libc.so.6", O_RDONLY) = 3 0.45 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`X\1\000"..., 1024) = 1024 0.58 fstat64(3, {st_mode=S_IFREG|0755, st_size=1449773, ...}) = 0 0.57 mmap2(NULL, 1215204, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40047000 0.40 mprotect(0x4016a000, 23268, PROT_NONE) = 0 0.38 mmap2(0x4016a000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x122) = 0x4016a000 0.60 mmap2(0x4016e000, 6884, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4016e000 0.41 close(3) = 0 0.000354 munmap(0x40014000, 63041) = 0 0.000113 write(2, "High Performance MPEG 1.0/2.0/2."..., 69) = 69 0.000469 write(2, "Version 0.59r (1999/Jun/15). Wri"..., 69) = 69 0.000191 write(2, "Uses code from various people. S"..., 54) = 54 0.000162 write(2, "THIS SOFTWARE COMES WITH ABSOLUT"..., 71) = 71 0.000185 open("/dev/dsp", O_WRONLY) = 3 0.068083 ioctl(3, SNDCTL_DSP_GETBLKSIZE, 0x80732c0) = 0 0.005557 ioctl(3, SNDCTL_DSP_RESET, 0) = 0 0.55 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000403 ioctl(3, SNDCTL_DSP_STEREO, 0xb364) = 0 0.31 ioctl(3, SOUND_PCM_READ_RATE, 0xb388) = 0 0.76 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000156 ioctl(3, SNDCTL_DSP_STEREO, 0xb364) = 0 0.30 ioctl(3, SOUND_PCM_READ_RATE, 0xb388) = 0 0.29 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000148 ioctl(3, SNDCTL_DSP_STEREO, 0xb364) = 0 0.30 ioctl(3, SOUND_PCM_READ_RATE, 0xb388) = 0 0.29 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000145 ioctl(3, SNDCTL_DSP_STEREO, 0xb364) = 0 0.30 ioctl(3, SOUND_PCM_READ_RATE, 0xb388) = 0 0.29 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000145 ioctl(3, SNDCTL_DSP_STEREO, 0xb364) = 0 0.30 ioctl(3, SOUND_PCM_READ_RATE, 0xb388) = 0 0.29 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000146 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000148 ioctl(3, SNDCTL_DSP_STEREO, 0xb364) = 0 0.30 ioctl(3, SOUND_PCM_READ_RATE, 0xb388) = 0 0.000149 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000148 ioctl(3, SNDCTL_DSP_STEREO, 0xb364) = 0 0.31 ioctl(3, SOUND_PCM_READ_RATE, 0xb388) = 0 0.29 ioctl(3, SNDCTL_DSP_SETFMT, 0xb364) = 0 0.000146 ioctl(3, SNDCTL_DSP_STEREO, 0xb364) = 0 0.29 ioctl(3, SOUND_PCM_READ_RATE, 0xb388) = 0 0.29 ioc
Re: [Alsa-devel] DMX6fire / ice1712: Long initialization time for playback with Java
Hi, does it access via OSS API? could you try stace to check what gets into sleep? Takashi At Sun, 02 Nov 2003 23:12:05 +0100, Steffen Sauder wrote: > > [1 ] > Hello, > > I am working on an audio-application with java 1.4, and I noticed that > with the current alsa-release the time neccessary to initialize my > Terratec DMX6fire card for playback (in oss emulation mode) increased a > lot since older versions. > > I wrote a small program to measure the time it takes for simply starting > the playback of a wav/aiff file. I noticed that the 0.9.8 release uses a > _lot_ more time on the AudioSystem.getMixerInfo() call (which searches > for all available devices) than older versions. I also noticed that the > times differ a lot for different JDKs, so here are the results for the > sun-jdk-1.4.2.01, blackdown-jdk-1.4.1 and ibm-jdk-1.4.1 with the > different alsa-driver versions. > > alsa-driver 0.9.2 - 0.9.3a: > sun: 3.2- 3.3 sec bdn: 1.9- 2.0 sec ibm: 0.7- 0.8 sec > > alsa-driver 0.9.3b - 0.9.7: > sun: 6.2- 6.3 sec bdn: 13.7-13.8 sec ibm: 3.7- 3.9 sec > > alsa-driver 0.9.8: > sun: 48.0-48.5 sec bdn: 24.7-24.8 sec ibm: 13.7-13.8 sec > > alsa-driver cvs-nov-02: > sun: 20.7-20.9 sec bdn: 24.8-24.9 sec ibm: 13.8-13.9 sec > > So things got worse between 0.9.3a and .b (the same moment the > mplayer-oss-emulation-delay problem occured!) and 0.9.7 and 0.9.8. > Current CVS version is working a bit better for sun's jdk, but not for > the others. I did not try different alsa-lib versions (used 0.9.2 all > the time) - don't know if this would make any difference. > > I attached the source code of the small programm, its syntax is: > > java AudioTest AUDIOFILE [DEVICE_NO] > > where DEVICE_NO is the index of the java-mixer-device to be used (they > get listed if you start it without the second parameter) > > Gruss, > Steffen > [2 AudioTest.java ] > > import javax.sound.sampled.*; > /** > * > * @author fali > */ > public class AudioTest { > > /** Creates a new instance of AudioTest */ > public AudioTest() { > } > > private static void playAudioFile(String fileName, int device) throws > UnsupportedAudioFileException, LineUnavailableException, java.io.IOException { > long beginTime = System.currentTimeMillis(); > > System.out.println("checking for available devices on this system..."); > Mixer.Info[] mixerInfos = AudioSystem.getMixerInfo(); > for (int i=0; i System.out.println(i+" > "+mixerInfos[i].getName()+"\t"+mixerInfos[i].getVendor()); > } > System.out.println(); > > System.out.println("getting mixer device "+mixerInfos[device].getName()+"..."); > Mixer mixer = AudioSystem.getMixer(mixerInfos[device]); > System.out.println("got mixer device, trying to open it..."); > mixer.open(); > System.out.println("mixer device opened, checking supported lines..."); > > Line.Info[] supportedLines = mixer.getSourceLineInfo(); > for (int i=0; i System.out.println(supportedLines[i].toString()); > } > System.out.println(); > > java.io.File file = new java.io.File(fileName); > AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(file); > AudioFormat audioFormat = audioInputStream.getFormat(); > System.out.println("audio file opened, format is "+audioFormat.toString()); > > Line.Info lineInfo = new DataLine.Info(SourceDataLine.class, audioFormat); > System.out.println("obtaining SourceDataLine for that AudioFormat..."); > SourceDataLine sourceDataLine = (SourceDataLine)mixer.getLine(lineInfo); > System.out.println("opening SourceDataLine..."); > sourceDataLine.open(audioFormat); > System.out.println("starting SourceDataLine..."); > sourceDataLine.start(); > > long endTime = System.currentTimeMillis(); > float seconds = (endTime-beginTime)/1000.0f; > System.out.println("it took "+seconds+" seconds to start playback."); > > byte[] buf = new byte[1024]; > int bytesRead = 0; > while(bytesRead>=0) { > bytesRead = audioInputStream.read(buf); > if (bytesRead>0) { > sourceDataLine.write(buf, 0, bytesRead); > } > } > > sourceDataLine.stop(); > sourceDataLine.close(); > audioInputStream.close(); > > } > > public static void main(String[] args) { > try { > if (args.length==0) { > System.err.println("first argument has to be an audio file."); > System.exit(-1); > } > String fileName = args[0]; > int device = 0; > if (args.length==2) { > device = Integer.parseInt(args[1]); > } > playAudioFile(fileName, device); > } catch (Exception e) { > e.printStackTrace(); > } > } > > } --- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it hel
Re: [Alsa-devel] DMX6fire / ice1712: Long initialization time for playback with Java
Not JavaSound, just the ice1712 with ALSA, JACK, Ardour, and JAMin. Jan On Sun, 2003-11-02 at 17:24, Steffen Sauder wrote: > Jan Depner wrote: > > >Just curious, but have you tried making sure that artsd is dead prior to > >starting? I only get these types of delays if I forget to kill it first > >(an OS beep will start it). > > > > > > > I have disabled the "start aRts soundserver on KDE startup" option, and > there is no artsd process running, > so I think that arts can't be the cause. > > Did you run my sample program or are you speaking of our experience with > JavaSound in general? > > Steffen > > > > --- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > ___ > Alsa-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/alsa-devel --- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ ___ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel
Re: [Alsa-devel] DMX6fire / ice1712: Long initialization time for playback with Java
Jan Depner wrote: Just curious, but have you tried making sure that artsd is dead prior to starting? I only get these types of delays if I forget to kill it first (an OS beep will start it). I have disabled the "start aRts soundserver on KDE startup" option, and there is no artsd process running, so I think that arts can't be the cause. Did you run my sample program or are you speaking of our experience with JavaSound in general? Steffen --- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ ___ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel
Re: [Alsa-devel] DMX6fire / ice1712: Long initialization time for playback with Java
Just curious, but have you tried making sure that artsd is dead prior to starting? I only get these types of delays if I forget to kill it first (an OS beep will start it). Jan On Sun, 2003-11-02 at 16:12, Steffen Sauder wrote: > Hello, > > I am working on an audio-application with java 1.4, and I noticed that > with the current alsa-release the time neccessary to initialize my > Terratec DMX6fire card for playback (in oss emulation mode) increased a > lot since older versions. > > I wrote a small program to measure the time it takes for simply starting > the playback of a wav/aiff file. I noticed that the 0.9.8 release uses a > _lot_ more time on the AudioSystem.getMixerInfo() call (which searches > for all available devices) than older versions. I also noticed that the > times differ a lot for different JDKs, so here are the results for the > sun-jdk-1.4.2.01, blackdown-jdk-1.4.1 and ibm-jdk-1.4.1 with the > different alsa-driver versions. > > alsa-driver 0.9.2 - 0.9.3a: > sun: 3.2- 3.3 sec bdn: 1.9- 2.0 sec ibm: 0.7- 0.8 sec > > alsa-driver 0.9.3b - 0.9.7: > sun: 6.2- 6.3 sec bdn: 13.7-13.8 sec ibm: 3.7- 3.9 sec > > alsa-driver 0.9.8: > sun: 48.0-48.5 sec bdn: 24.7-24.8 sec ibm: 13.7-13.8 sec > > alsa-driver cvs-nov-02: > sun: 20.7-20.9 sec bdn: 24.8-24.9 sec ibm: 13.8-13.9 sec > > So things got worse between 0.9.3a and .b (the same moment the > mplayer-oss-emulation-delay problem occured!) and 0.9.7 and 0.9.8. > Current CVS version is working a bit better for sun's jdk, but not for > the others. I did not try different alsa-lib versions (used 0.9.2 all > the time) - don't know if this would make any difference. > > I attached the source code of the small programm, its syntax is: > > java AudioTest AUDIOFILE [DEVICE_NO] > > where DEVICE_NO is the index of the java-mixer-device to be used (they > get listed if you start it without the second parameter) > > Gruss, > Steffen > > > > import javax.sound.sampled.*; > /** > * > * @author fali > */ > public class AudioTest { > > /** Creates a new instance of AudioTest */ > public AudioTest() { > } > > private static void playAudioFile(String fileName, int device) throws > UnsupportedAudioFileException, LineUnavailableException, java.io.IOException { > long beginTime = System.currentTimeMillis(); > > System.out.println("checking for available devices on this system..."); > Mixer.Info[] mixerInfos = AudioSystem.getMixerInfo(); > for (int i=0; i System.out.println(i+" > "+mixerInfos[i].getName()+"\t"+mixerInfos[i].getVendor()); > } > System.out.println(); > > System.out.println("getting mixer device "+mixerInfos[device].getName()+"..."); > Mixer mixer = AudioSystem.getMixer(mixerInfos[device]); > System.out.println("got mixer device, trying to open it..."); > mixer.open(); > System.out.println("mixer device opened, checking supported lines..."); > > Line.Info[] supportedLines = mixer.getSourceLineInfo(); > for (int i=0; i System.out.println(supportedLines[i].toString()); > } > System.out.println(); > > java.io.File file = new java.io.File(fileName); > AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(file); > AudioFormat audioFormat = audioInputStream.getFormat(); > System.out.println("audio file opened, format is "+audioFormat.toString()); > > Line.Info lineInfo = new DataLine.Info(SourceDataLine.class, audioFormat); > System.out.println("obtaining SourceDataLine for that AudioFormat..."); > SourceDataLine sourceDataLine = (SourceDataLine)mixer.getLine(lineInfo); > System.out.println("opening SourceDataLine..."); > sourceDataLine.open(audioFormat); > System.out.println("starting SourceDataLine..."); > sourceDataLine.start(); > > long endTime = System.currentTimeMillis(); > float seconds = (endTime-beginTime)/1000.0f; > System.out.println("it took "+seconds+" seconds to start playback."); > > byte[] buf = new byte[1024]; > int bytesRead = 0; > while(bytesRead>=0) { > bytesRead = audioInputStream.read(buf); > if (bytesRead>0) { > sourceDataLine.write(buf, 0, bytesRead); > } > } > > sourceDataLine.stop(); > sourceDataLine.close(); > audioInputStream.close(); > > } > > public static void main(String[] args) { > try { > if (args.length==0) { > System.err.println("first argument has to be an audio file."); > System.exit(-1); > } > String fileName = args[0]; > int device = 0; > if (args.length==2) { > device = Integer.parseInt(args[1]); > } > playAudioFile(fileName, device); > } catch (Exception e) { > e.printStackTrace(); > } > } > > } --- This SF.net email is sponsored by: SF.net Giveback Program. Doe