Author Topic: 3D Sound System  (Read 322956 times)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: 3D Sound System
« Reply #120 on: July 30, 2018, 08:44:43 AM »
I'll do some googling to see what has changed for SourceDataLine usage.  I've been out of Java programming for a while, so will take a little catching up.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: 3D Sound System
« Reply #121 on: July 30, 2018, 09:00:20 AM »
Some output about the system might also be helpful.  Could you run the following (with Java 10 on the system that has the problem) to get information about available mixers and supported formats?

Code: [Select]
        Mixer.Info[] mi = AudioSystem.getMixerInfo();
        for (Mixer.Info info : mi) {
            System.out.println("info: " + info);
            Mixer m = AudioSystem.getMixer(info);
            System.out.println("mixer " + m);
            Line.Info[] sl = m.getSourceLineInfo();
            for (Line.Info info2 : sl) {
                System.out.println("    info: " + info2);
                Line line = AudioSystem.getLine(info2);
                if (line instanceof SourceDataLine) {
                    SourceDataLine source = (SourceDataLine) line;

                    DataLine.Info i = (DataLine.Info) source.getLineInfo();
                    for (AudioFormat format : i.getFormats()) {
                        System.out.println("    format: " + format);
                    }
                }
            }
        }

I'm not at my computer to do any tests now, so if the above code is outdated and doesn't work, no problem.  I'll see if I can recreate the problem on my computer when I get home later.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline regice202

  • bit
  • Posts: 5
    • View Profile
Re: 3D Sound System
« Reply #122 on: July 30, 2018, 02:40:18 PM »
Hey Paul!

This is the output I got from running that snippet you posted on Java 10. Thanks for the help!

Code: [Select] [nofollow]
info: Port Unknown Name, version Unknown Version
mixer com.sun.media.sound.PortMixer@77ec78b9
info: Port Unknown Name, version Unknown Version
mixer com.sun.media.sound.PortMixer@1a3869f4
    info: MICROPHONE source port
info: Primary Sound Driver, version Unknown Version
mixer com.sun.media.sound.DirectAudioDevice@3aeaafa6
    info: interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes
    format: PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
    format: PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
    format: PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian
    format: PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian
    format: PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
    format: PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
    format: PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian
    format: PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian
    info: interface Clip supporting 8 audio formats, and buffers of at least 32 bytes
info: Speakers (Realtek High Definition Audio), version Unknown Version
mixer com.sun.media.sound.DirectAudioDevice@1b26f7b2
    info: interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes
    format: PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
    format: PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
    format: PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian
    format: PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian
    format: PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
    format: PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
    format: PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian
    format: PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian
    info: interface Clip supporting 8 audio formats, and buffers of at least 32 bytes
info: Primary Sound Capture Driver, version Unknown Version
mixer com.sun.media.sound.DirectAudioDevice@491cc5c9
info: Microphone (Realtek High Defini, version Unknown Version
mixer com.sun.media.sound.DirectAudioDevice@74ad1f1f

- regice202

Offline regice202

  • bit
  • Posts: 5
    • View Profile
Re: 3D Sound System
« Reply #123 on: August 06, 2018, 03:43:05 PM »
Bump!

Offline regice202

  • bit
  • Posts: 5
    • View Profile
Re: 3D Sound System
« Reply #124 on: August 10, 2018, 09:44:09 PM »
So I've been doing some digging and debugging, trying to figure out what's the issue is between java versions and I've got something that seems worth mentioning. It seems using Java 8 when retrieving the SDL (which is where the error occurs in Java 9+), a DirectAudioDevice is used to run getLine(Info). While in contrast in Java 9+ a PortMixer is used to run getLine(Info). Not quite sure why it chooses a different device. I'm really hoping you'll help me here Paul, you've got a lot more knowledge of the structure of this program and what exactly is going on here. Thanks again!

EDIT: I think this is due to the ranking system. It seems this method of finding the correct mixer might be dated. Going to try and enable debug messages (forgot which class you just ended the try catch with a semicolon) and keep digging.

- regice202
« Last Edit: August 10, 2018, 11:04:43 PM by regice202 »