This discussion is archived
1 2 Previous Next 20 Replies Latest reply: Jun 30, 2011 3:32 AM by 855587 RSS

ERROR while querying ACM driver's information

855587 Newbie
Currently Being Moderated
I am using following scheme to transmit sound over network:

file -> input datasource -> processor -> output datasource -> RTPManager -> network

File from which i am transmitting is temporary. I am create this file before transmit and delete it after.

1. Application starts
2. I am perform transmit first time - everything fine, but in std otput i see message "ERROR while querying ACM driver's information".
3. I am perform transmit second time - everything fine, but file that i am created for transmitting stays locked by JMF for about 20 minutes.
4. Any transmit after "ERROR while querying ACM driver's information" locks input file for about 15-20 minutes.

Any suggestions will be appreciated.

Thanks for advance!
  • 1. Re: ERROR while querying ACM driver's information
    captfoss Pro
    Currently Being Moderated
    2. I am perform transmit first time - everything fine, but in std otput i see message "ERROR while querying ACM driver's information".
    Sounds like an issue with a (1) sound card driver (2) a bad portion of your input file
  • 2. Re: ERROR while querying ACM driver's information
    855587 Newbie
    Currently Being Moderated
    1. This is not sound driver, because there is no sound card installed on machine where is app launched. And there is no output to sound card in my scheme.
    2. Input file is wav file earlier created by JMF, i think it is ok.
  • 3. Re: ERROR while querying ACM driver's information
    captfoss Pro
    Currently Being Moderated
    Ok.

    ACM is "Windows Audio Compression Manager", which means that error is saying that JMF can't communicate with the native libraries it uses on Windows to transcode some audio format...

    So JMF probably isn't installed correctly... try reinstalling it.
  • 4. Re: ERROR while querying ACM driver's information
    855587 Newbie
    Currently Being Moderated
    I know what is ACM, but i cannot understand why JMF trying to communicate with ACM, because i am using native JMF codec - G711u. And i dont install JMF on target machines, just using JMF library. What for i need to install JMF if i am using only native JMF features?
  • 5. Re: ERROR while querying ACM driver's information
    captfoss Pro
    Currently Being Moderated
    852584 wrote:
    I know what is ACM, but i cannot understand why JMF trying to communicate with ACM, because i am using native JMF codec - G711u. And i dont install JMF on target machines, just using JMF library. What for i need to install JMF if i am using only native JMF features?
    You shouldn't use the phrase "native" in the way you are. "Native features" mean features that are implemented in a precompiled library... so actually the opposite of the way you're using the phrase. Native = compiled library.

    Are you using the JMF.jar file from the Cross-platform pack, or the JMF.jar from the Windows Performance Pack?

    You need to be using the one from the cross-platform pack. The one from the Windows package is going to look for native libraries and fail when it can't find them...

    Just because JMF can do something purely in Java doesn't mean it's not going to do it in native code in one of the performance packs, because native code is faster.
  • 6. Re: ERROR while querying ACM driver's information
    855587 Newbie
    Currently Being Moderated
    Now i am using Cross-platform pack and this is dont solve problem. Nothing changed.

    Edited by: 852584 on Apr 26, 2011 5:12 PM
  • 7. Re: ERROR while querying ACM driver's information
    captfoss Pro
    Currently Being Moderated
    852584 wrote:
    Now i am using Cross-platform pack and this is dont solve problem. Nothing changed.
    If it's still telling you that it's querying the ACM drivers then you aren't using the cross-platform version of the JMF.jar file...
  • 8. Re: ERROR while querying ACM driver's information
    855587 Newbie
    Currently Being Moderated
    I have downloaded a cross-platform pack from Oracle site. And using cross-platform JMF pack. Size of cross-platform jmf.jar file is 1 904 171 bytes, size of windows perfomance pack jmf.jar file is 2 082 557 bytes. And i am sure that i am using an cross-patform pack! Can i understand from code what version of jmf i am using?

    I have located a place where error occured. Its occured in Manager.createRealizedProcessor wiht following params:

    Datasource is com.sun.media.protocol.file.DataSource, contentType = audio.x_wav, have one PullSourceStream = com.sun.media.protocol.file.DataSource$RAFPullSourceStream.

    Formats contains one format "ULAW/rtp, 8000.0 Hz, 8-bit, Mono".

    Content descriptor is RAW/RTP.
  • 9. Re: ERROR while querying ACM driver's information
    captfoss Pro
    Currently Being Moderated
    Simply put, it doesn't much matter what you think you're using... if your code is giving you an error saying it can't find a windows library, then I'm almost absolutely sure that somehow you're using the Windows version of the JAR... it's probably a path issue, or something, with your console path or your IDE path or something... I'm almost positive the cross-platform pack wouldn't be querying the ACM for info.

    Uninstall / delete all of the Windows Performance Pack stuff off your computer... and try then. Check your console path, IDE path, etc...

    And repost the exact error message you're getting, por favor.
  • 10. Re: ERROR while querying ACM driver's information
    855587 Newbie
    Currently Being Moderated
    *1. About ACM*

    I've created a very very simple project for you. Its available on rapidshare - https://rapidshare.com/files/459546217/JMF_ACM_test.rar. Please, download it and run. Project contains jmf.jar. Feel free to put a "right" version of jmf.jar and see what happens.

    Ive tested this app on two clear machines - there is no error. But on my computer i am still getting error, this is full description: "ERROR while querying ACM driver's information". This is not exception or else, jmf just put this string in std output while creating processor.

    My command line for launch:

    "C:\Program Files (x86)\Java\jre6\bin\java.exe" -classpath "D:\Projects\Test projects\JMF ACM test;D:\Projects\Test projects\JMF ACM test\jmf.jar" Test

    If i dont write in a classpath for jmf.jar, java will not find JMF. I think this is guarantees that jmf is used from file attached to project.

    *2. Deallocating resources*

    We have focused on ACM error. But major bug is that JMF dont free resources after playing wav file. I have tested this behaviour with my test app and figured out that there is no connection between ACM error and resource locking. I've tested my app on two clear machines where is no ACM error, but there is same resource locking bug as with ACM error. If you launch my app you can see that first file processed with JMF processor is successfully deleted, but in next two attempts files cannot be deleted because they locked by JMF.

    Waiting for your answer... Thanks for advance!

    Edited by: 852584 on Apr 28, 2011 1:13 PM
  • 11. Re: ERROR while querying ACM driver's information
    captfoss Pro
    Currently Being Moderated
    852584 wrote:
    Ive tested this app on two clear machines - there is no error.
    First off, I can't download or test code on the machine I use to post to the forums, so I can't help you test your code.

    I suppose it's possible that the ACM issue you're having is a JavaSound issue. JavaSound is built into the JRE and is presumably what JMF would be using to transcode to ULAW in the cross-platform pack, so I suppose it's possible that it's the one failing to query the ACM...

    You can verify if JavaSound is the one throwing the error by using the following sample utility to convert a WAV file to a ULAW encoding:
    http://www.jsresources.org/examples/UlawEncoder.html

    If that's the case, I'd recommend you reinstall Java.
    *2. Deallocating resources*
    If you launch my app you can see that first file processed with JMF processor is successfully deleted, but in next two attempts files cannot be deleted because they locked by JMF.
    If JMF is maintaining a file lock, then I assume you've improperly shutdown the processor / datasink...

    I can't download your code RAR, so can you just post the code you're using to handle the shutdown? (and please use the code tags)
  • 12. Re: ERROR while querying ACM driver's information
    855587 Newbie
    Currently Being Moderated
    I can't download your code RAR, so can you just post the code you're using to handle the shutdown? (and please use the code tags)
    Thanks for anwser. There is entire test code i wrote (code with "mutex" variable is not nessesary, i wrote it just for clearer output):
    import javax.media.*;
    import javax.media.format.AudioFormat;
    import javax.media.protocol.ContentDescriptor;
    import javax.media.protocol.DataSource;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.File;
    import java.nio.channels.FileChannel;
    
    public class Test {
        public static void main(String[] args) {
    
            File sourceFile = new File("1.wav");
    
            for (int i = 0; i < 3; i++) {
    
                System.out.format("Try number %d\n", i);
    
                File tempFile;
    
                try {
                    tempFile = File.createTempFile("TestTemp", ".wav");
                } catch (IOException e) {
                    System.err.format("Cannot create temporary file %s \n", e);
                    return;
                }
    
                if (!copyFile(sourceFile, tempFile)) {
                    return;
                }
    
                DataSource ds;
                try {
                    ds = javax.media.Manager.createDataSource(new MediaLocator("file:" + tempFile.getPath()));
                } catch (Exception e) {
                    System.err.format("Cannot create datasource %s \n", e);
                    return;
                }
    
                Format[] formats = new Format[1];
    
                formats[0] = new AudioFormat(AudioFormat.ULAW_RTP, 8000, 8, 1);
    
                ProcessorModel prm = new ProcessorModel(ds, formats, new ContentDescriptor(ContentDescriptor.RAW_RTP));
    
                Processor processor;
    
                try {
                    processor = Manager.createRealizedProcessor(prm);
                } catch (Exception e) {
                    System.err.format("Cannot create processor %s \n", e);
                    return;
                }
    
                processor.close();
    
                Object mutex = new Object();
    
                synchronized (mutex) {
                    try {
                        mutex.wait(1000);
                    } catch (InterruptedException e) {
                        System.err.format("Thread interrupted, try number " + i + "\n");
                        return;
                    }
                }
    
                if (!tempFile.delete()) {
                    System.err.format("Cannot delete temporary file, try number " + i + "\n");
                }
    
                System.out.format("Try end number %d\n", i);
            }
        }
    
        public static boolean copyFile(File sourceFile, File destFile) {
            FileChannel source = null;
            FileChannel destination = null;
            try {
                source = new FileInputStream(sourceFile).getChannel();
                destination = new FileOutputStream(destFile).getChannel();
                destination.transferFrom(source, 0, source.size());
            } catch (Exception e) {
                System.err.format("Error while copying files %s \n", e);
                return false;
            }
            finally {
                if (source != null) {
                    try {
                        source.close();
                    } catch (IOException e) {
                        System.err.format("Error while trying close source file %s \n", e);
                    }
                }
                if (destination != null) {
                    try {
                        destination.close();
                    } catch (IOException e) {
                        System.err.format("Error while trying close destination file %s \n", e);
                    }
                }
            }
    
            return true;
        }
    }
    I have figured out that if i continue to try deleting files used by processor (that already closed) while program is running, files will be deleted after ~15 minutes. I have figured out this while testing my main application. This test app also may be modified to reproduce this behaviour. If you want, i can submit a modified test code to reproduce this behaviour.
    If JMF is maintaining a file lock, then I assume you've improperly shutdown the processor / datasink...
    About resource deallocation. First, there is no datasink i have been created manually (may be jmf create it internally, but i dont think so). In my test application i've been created only input datasource and processor. I have tried deallocate datasource also, but this is dont have any effect. In JMF reference we can see this description of method Processor.close():

    "Releases all resources and cease all activity."

    I think this is enough to call Processor.close() to deallocate input file, is that right?
  • 13. Re: ERROR while querying ACM driver's information
    captfoss Pro
    Currently Being Moderated
    "Releases all resources and cease all activity."

    I think this is enough to call Processor.close() to deallocate input file, is that right?
    Processor isn't what's reading the input file, it's the DataSource that reads the file.

    The DataSource will release the file when it is stopped and disconnected... those things normally happen automatically with JMF, but, normally you would stop the processor before you close it.

    Try the following suggestions in the order given:
    1) Try stopping the processor before you close it
    2) Try calling stop and then disconnect on the DataSource directly
  • 14. Re: ERROR while querying ACM driver's information
    855587 Newbie
    Currently Being Moderated
    Now i am using following code to deallocate resources
                processor.stop();
                processor.close();
    
                try {
                    ds.stop();
                } catch (IOException e) {
                    System.err.format("Error while stopping datasource %s \n", e);
                }
    
                ds.disconnect();
    but nothing have changed.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points