1 2 Previous Next 15 Replies Latest reply: Aug 8, 2011 10:59 AM by captfoss RSS

    How to use AudioSystem that reports no TargetDataLines, only Target Ports?

    845492
      I've sent a prototype to a friend to test on his machine. He's tested it on a Dell Windows laptop and another Dell Windows desktop. The laptop is one year old and the desktop is two years old. The prototype (which is "listening" to audio being played on the machine) won't function, so I've written a simple diagnostic tool that queries the AudioSystem to determine the hardware configuration as exposed through Java sound.

      The diagnostics tool reports the following:

      0 (none) Source Ports
      1 Target Port
      2 SourceDataLines
      0 (none) TargetDataLines

      The way that I've been "listening" to audio is through TargetDataLine.open() and TargetDataLine.read(). With no TDL at all on the system, how can I do this? I first thought that these must be old and/or unusual systems, but they are both mainstream, current Dell systems. It seems I'm completely missing the boad on this.

      The diagnostic code is really very simple. It is (mostly) this:
                Line.Info portInfo = new Line.Info(Port.class);
                Line.Info[] lineInfoAr = AudioSystem.getSourceLineInfo(portInfo);
                lineInfoAr = AudioSystem.getTargetLineInfo(portInfo);
                Line.Info tdlInfo = new Line.Info(TargetDataLine.class);
                lineInfoAr = AudioSystem.getSourceLineInfo(tdlInfo);
                lineInfoAr = AudioSystem.getTargetLineInfo(tdlInfo);
      Much appreciation to anyone that can point me towards the correct way to query and/or use a system like this. Thanks.

      Edited by: ags on Jul 5, 2011 1:56 PM (made title a question)
        • 1. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
          873499
          MySQL allows impact statement scheduling features, this would allow queries from several clients to better collaborate, to a single client can not be locked for too long. Change the scheduling feature can guarantee specific query processing faster. Let's look at MySQL's default scheduling policy, then
          Take a look at this strategy can be used to change what kind of options. For discussion purposes, assume that the implementation of retrieval (SELECT), the client program to read the program. A modification table operations (DELETE, INSERT, REPLACE, or UP DATE) program for another client to replica breitling watcheswrite the program.
          • 2. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
            captfoss
            Try the Javasound scanning utility from this article:
            http://www.developerfusion.com/article/84314/wired-for-sound/

            And post the results of the scan.
            • 3. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
              845492
              Here's the output from the VSJQueryMixers utility that was suggested:

              Mixer: Primary Sound Driver; supports SourceDataLine Clip ; Direct Audio Device: DirectSound Playback
              Mixer: Speakers (Realtek High Definition Audio); supports SourceDataLine Clip ; Direct Audio Device: DirectSound Playback
              Mixer: Java Sound Audio Engine; supports SourceDataLine Clip ; Software mixer and synthesizer
              Mixer: Port Speakers (Realtek High Definiti; supports Port ; Port Mixer

              This is the same that I found using my own diagnostic tool. I have to admit that this has me really stuck/stumped. I would have expected at least a "Primary Sound Capture" Mixer. Both of the systems do provide audio playback capability. I'm beginning to wonder if there is a problem with the Microsoft Windows Audio Drivers? Has the world devolved so much that RIAA has found a way to prevent systems from allowing audio capture?
              • 4. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                captfoss
                ags wrote:
                Has the world devolved so much that RIAA has found a way to prevent systems from allowing audio capture?
                I'm not entirely sure Microsoft + Skype, Google + GChat, Apple + Facetime would allow that to happen ;-)

                In all actuality, you probably are looking at either a (1) permission issue somehow (2) audio driver issue (3) JVM installation issue.
                • 5. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                  845492
                  OK, so it sounds (no pun intended) like I haven't missed the bus completely on this. I do need a TargetDataLine, there should be at least one available, and the code I've been using (with the javax.sound.sampled API) is not wrong.

                  Are there any suggestions about how to diagnose a driver, permission or JVM installation problem? (BTW, the diagnostic code was run with Admin permission).
                  • 6. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                    captfoss
                    ags wrote:
                    Are there any suggestions about how to diagnose a driver, permission or JVM installation problem? (BTW, the diagnostic code was run with Admin permission).
                    Only word of advise I can offer is "reinstall"
                    • 7. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                      845492
                      Ugh. Seems like I'm good at finding the "fun" problems.

                      Reinstall what? The audio system drivers? The JVM? It's odd that the tester has two machines (not an enterprise installation), one a desktop and one a laptop, and both are reporting no TargetDataLines.
                      • 8. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                        captfoss
                        Reinstall what? The audio system drivers? The JVM?
                        Yes. o_O
                        It's odd that the tester has two machines (not an enterprise installation), one a desktop and one a laptop, and both are reporting no TargetDataLines.
                        In that case, reinstalling probably won't do anything except waste time.

                        What OS are you using?
                        • 9. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                          845492
                          Windows 7 in both cases. Standard (mainstream) machines from Dell.
                          • 10. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                            810604
                            On some soundcards under Win 7 inputs do not become available until you plug something into them, try plugging something into an audio input socket on the test machines.
                            • 11. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                              845492
                              Will do. However, that is confusing (if it works): playing streaming music (Pandora, Rhapsody, etc.) works (meaning it produces sound on the speakers) with nothing attached to any input (line in, microphone). If connecting a microphone caused a mixer to appear, I wouldn't expect it to have access to the streaming audio (which is what I'm trying to capture). It's all hypothetical at this point, I'll post what I find out after the experiment.
                              • 12. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                                captfoss
                                ags wrote:
                                Will do. However, that is confusing (if it works): playing streaming music (Pandora, Rhapsody, etc.) works (meaning it produces sound on the speakers) with nothing attached to any input (line in, microphone).
                                Playing and capturing are different, obviously ;-)
                                If connecting a microphone caused a mixer to appear, I wouldn't expect it to have access to the streaming audio (which is what I'm trying to capture).
                                Plugging a microphone in would probably give you access to record from the microphone, and nothing else.

                                The fact that you're looking at a "high definition" audio device suggests you're looking at a sound card that produces "encoded" audio (probably Dolby 5.1 or something). As such, there's very likely not going to be a loopback interface you can read from.

                                Coupled with Win7 not showing input ports without something plugged into them... you're not going to have any recording devices by default.
                                It's all hypothetical at this point, I'll post what I find out after the experiment.
                                Ok.

                                You can also try the age-old trick of plugging the headphone jack into the line in jack and recording from it ;-)
                                • 13. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                                  845492
                                  I tried plugging in a microphone but that didn't cause a TDL to appear that would capture the streamed audio.

                                  It's a very interesting idea about the HD card and encoded (Dolby 5.1) sound. That does make some sense - but I have a card in another machine that supports 5.1 and it does offer a mixer with a TDL to capture the audio that is being played on the speakers (or headphones).

                                  I hadn't thought of the "age old trick" but that's very ingenious!

                                  I have no intention of being inflammatory here, but I'm wondering: is Java Sound a robust system upon which to build an application dependent upon sound capture with Windows? It is incredibly simple and easy to use. Does that ease of use come with a penalty of not being supported on most machines? Or are the issues I'm having mostly due to my lack of experience with Java Sound? I really don't want to program in Windows native...

                                  Thanks.
                                  • 14. Re: How to use AudioSystem that reports no TargetDataLines, only Target Ports?
                                    810604
                                    JavaSound works well on Windows, I have many thousands of Windows users of a Java acoustic analysis package. It also seems to work well on Linux. It is poor on OS X, Apple's JavaSound implementation is incomplete and very buggy, maybe that will improve when Oracle take over the OS X runtime.
                                    1 2 Previous Next