Master gain problem with Direct Audio Device: distorted sound

Hi everybody,
I'm in a bit of a fix here. I've got an application that plays music. Developped with 1.4.2, got it working.
However, when I run it with the the latest 1.5 release (5.0 update 6), the sound is distorted. More specifically, though I'm not entirely sure, I'd say it's the bass that gets distorted. By "distorted" I mean it's shrieking, scratching instead of... well, sounding.
I'm using the FloatControl.Type.MASTER_GAIN control to change the "volume". Since it's playback, I'm using a SourceDataLine, and that one ain't got no VOLUME control. Now the problem only appears when I'm amplifying the audio data, i.e. when the MASTER_GAIN's value is greater than 0.0 decibel.
Inverstigating a little more, I found out that 1.5 is using the "Direct Audio Device" Mixer as default as opposed to the "Java Sound Audio Engine" used by 1.4.2. If I force the use of the Java Sound Audio Engine with 1.5 (getting the line from the appropriate Mixer), the sound is OK. However, since the application is intended to be cross-platform, I'd prefer not to impose any such specific behaviour (plus the performance of the Direct Audio Device is twice as good).
Tested on Linux version 2.6.11-1.1369_FC4 and Windows NT.
Looked at www.jsresources.org, but didn't find any information specific to this problem.
Bugparade: no hits.
I'd be glad if anyone could help me on this.

Nobody ?
It narrowed it down to the following testcode. Please try to run it with Java 1.5 and some compatible audio file (a WAVE file, for instance):
import java.io.*;
import javax.sound.midi.*;
import javax.sound.sampled.*;
import javax.sound.sampled.spi.*;
* @author  futt
public class SoundTest {
    public static void main(String[] args)
    throws Exception
        if( args.length != 1 ){
            System.err.println("SYNOPSIS: SoundTest [FILE]");
            return ;
        final File f = new File(args[0]);
        AudioFileFormat aff = AudioSystem.getAudioFileFormat(f);
        Mixer.Info mymixer = null;
        Mixer.Info[] mixers = AudioSystem.getMixerInfo();
        for(int ii = mixers.length; --ii >= 0; ){
            if( mixers[ii].getName().toLowerCase().indexOf("direct audio device") != -1 ){
                mymixer = mixers[ii];
                break;
        Line.Info info = new DataLine.Info(SourceDataLine.class, aff.getFormat());
        SourceDataLine line;
        if( mymixer != null ){
            Mixer m = AudioSystem.getMixer(mymixer);
            if( m != null ){
                System.err.println("Using mixer: "+m);
            line = (SourceDataLine) m.getLine(info);
        else {
            System.err.println("Using default mixer");
            line = (SourceDataLine) AudioSystem.getLine(info);
        System.err.println("Got line: "+line.getClass());
        InputStream in = null;
        try{
            in = new BufferedInputStream(new FileInputStream(f));
            line.open( aff.getFormat() );
            line.start();
            FloatControl fc = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
            fc.setValue(3f);
            byte[] buf = new byte[ 1 << 14 ];
            for(int read; ! Thread.currentThread().isInterrupted() && (read = in.read(buf)) != -1; ){
                line.write(buf, 0, read);
            if( ! Thread.currentThread().isInterrupted() ){
                line.drain();
            line.stop();
        catch (Exception x){
            x.printStackTrace();
        finally {
            line.close();
            if( in != null ){
                try{ in.close(); } catch (IOException iox){}
}

Similar Messages

  • There's a problem with your audio device.

    Please help. I don't know what the problem is!

    i cant figure out what to do, everytime i call someone, it says "theres a problem with your audio device."

  • Problem with USB audio device

    Hi all
    I have many problem with a USB device sound, i have a plantronic headset with a usb adapter to connect on my macbook pro, I have already this problem in the past but i have found a astuce to fix this problem. Before, when i'm on teamspeak 2, 3 or other software to capture audio with my headset, after 10 minutes, the sound make noise and i have a robotic voice... Since mac OS 10.5.7 apple have change the USB audio driver. i have found on internet the previous driver and change it on mac os X but since the new mac os 10.6.5 the problem com back with the previous or the new driver audio. I don't know if other people have this problem but this is very annoying.
    I have test my device on windows with boot camp many hour and nothing, no problem of distord sound or robotic voice.
    PS : I'm french and my english can be bad, sorry for that.

    Apparently, your previous search for audio issues in these forums missed this one: http://discussions.apple.com/message.jspa?messageID=12574650

  • PROBLEM WITH BLUETOOTH AUDIO DEVICE,BLUEANT T1

    MY Q5 IS NOT RECOGNISING NOR PAIRING WITH MY BLUETOOTH DEVICE,WHAT CAN I DO?

    Hi
     With my Jabra speaker/micro I had to use a reset proceedure for it (Jabra). The problem was not with my Q5
    Good Luck

  • Problems with M-Audio Fasttrack Pro and Garageband after 10.5.2

    Hi all,
    I use GarageBand daily with my M-Audio FastTrack Pro and have had absolutely no problems until I installed the 10.5.2 update.
    Suddenly the Audio randomly cuts out when I'm recording, monitoring or playing back - also my recordings appear to skip and jump too. Usually I can rectify it by power cycling the Fasttrack but the problem re-occurs after about 30 seconds of recording.
    I have double checked the I am using M-Audio's latest drivers and have repaired permissions and the disk. I was wondering if anyone else had had any problems with this?
    All help would be appreciated, looks like I'm going back to 10.5.1 though.

    Hi !
    Still no answer from M-Audio but it seems that they are not in cause.
    I read on several topics of Apple's Forums some similar problems with other audio devices and also with some USBhubs.
    I ran some little tests and for my case, using the other USB port of the MacBook seems to resolve the problem (but that's not a permanent solution for my point of view).
    Using a selft-powered USBhub works also, even on the port that makes it crash without hub.
    As I studied a little bit of electronics, it looks really like a problem of power supply through USB to me. It could be some kind of micro-cuts (or micro-undervoltage) that are sufficient to cut the audio stream and freeze a bit the system but not enough for MacOSX to switch significantly to the internal audio.
    But two questions still remain :
    Why one USB port of the MacBook and not the other one ?
    Why since 10.5.2 ?
    Steve, if you hear me ;o)
    'Hope they will react quickly !

  • I just moved my itunes library from a win 7 computer to a win 8.1 computer. Getting an error message "iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly. Can't play CDs or get audio file from web!

    Help! I just moved my itunes library from a Win 7 computer to a new Win 8.1 computer following the instructions on the itunes website. Everything is good except I'm getting an error message on the Win 8 computer if I try to play a CD or get an audio file off of the internet. I get an error message that says "iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly. I don't know where to look for or fix the audio configuration on the win 8 computer. As far as I can tell the iTunes configuration looks the same as on the other computers in the house. At this point I don't dare plug my ipod touch into the Win 8 computer for fear it will get messed up.

    I have the same problem and I know that it is due to my PCI Audio driver not being compatible with WIndows 8.1.
    iTunes isn't the only program that can't direct sound to the built-in speakers anymore. The obvious solution would be to update the drivers, but unfortunately Dell does not provide an updated driver for my model, so I am stuck with that.
    However, saying that, only my laptop speakers are affected by this. I can use sound fine on applications where I can choose the output device and direct sound to the head phones, but for some reason iTunes does not let you choose the audio device manually.
    To listen to music I imported the iTunes Library in Windows Media Player and changed the audio output using the following instructions: http://windows.microsoft.com/en-us/windows7/c00d11ba
    However, I would also like to rent movie's from iTunes, 
    Would be great if iTunes would let you choose the output device, too, like most other applications using sound  from Skype to Windows Media Player,...

  • Problem in installing "audio device on high definition audio bus"

    i have cq40 144tu laptop
    i downgrade to XP with the nice tutorial posted on this forum.
    my laptop S/N - [text removed for privacy]
    P/N FZ736PA#ACJ
    I M GETTING PROBLEM IN INSTALLING AUDIO DEVICE ON HIGH DEFINITION AUDIO BUS
    i have tried sp39671 which was sugges in that tutorial but that not work

    The other sound driver is Intel HDMI driver, it is bundled in Intel GMA driver.
    Update your BIOS to the latest one and do a clean instalation of XP-SP3 then you dont need devcon utility.
    See XP downgrade guide for futher detail, here
    Pavilion DV2922TX, XP-SP3 32bit, Intel T5750 2.0Ghz, Nvidia Geforce 8400M GS with 128MB, 4GB 667 DDR2, 250GB HDD

  • I have a problem with the audio on a movie I downloaded

    I am having a problem with the audio on a movie that I downloaded.  It is scratchy and difficult to listen to.  How can I fix this?

    Depending upon what country that you are in (films can't be re-downloaded in all countries) then try deleting the film from your iTunes library and redownload it via the Purchased link under Quicklinks on the right-hand side of the iTunes store home page on your computer's iTunes (or delete it from your iOS device and redownload it via the Purchased tab in the iTunes Store app on it)
    If you aren't in a country where you can re-download films or if it re-downloads with the same problem then try the 'report a problem' page to contact iTunes Support : http://reportaproblem.apple.com
    If the 'report a problem' link doesn't work then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Problem with Direct OC, i assume

    So recently during playing some games, such as Heroes of Newerth and Wow for the most part ive been experiencing some random spiking(especially around parts where some animations happen fast) in the games and when i tab out and check processes on *system manager?*(not sure if its that in english) Direct OC takes some serious amount of memory, allmost allways its around 50% of what my current game is taking. Im not really familiar with Direct OC's business so i usually just reboot it and keep doing what im doing, usually it helps the experience sometimes it doesnt. Also i have a second problem with Direct OC, well maybe not a problem but i assume its related to it. When i have Direct OC on and computer idles ~30mins or so with screen power saving or screen saver on the recovery from screen saving takes a little while to react with desktop or so, mouse keeps moving and all but cant really do anything. So when i thought it was an issue with Direct OC, i tried without it ending up with recovery not really happening...ever! Mouse keeps moving like usual but when i try to interact with anything nothing happens and at around 10-20clicks with mouse the whole OS just freezes and thats about it for it until i force boot comp. So im guessing with this problem Direct OC is actually boosting my cpu to overcome the recovery process from the saving, but im not really too familiar with all this so im trying my luck here now.
    My Build:
    Intel Core i5 759 2.67GHz
    MSI P55M-GD45 (MS-7588)
    XFX Radeon 5850HD 1024MB
    4GB of 1600MHz DDR3
    Win7 Ultimate

    Hello,
    Please check the following note which has details for handling customer specific fields in Direct input program.
    Note 44410 - Integrating cust.-specific fields in matl master
    Cheers!
    Sam Kandas

  • Error message -ITunes has detected a problem with your audio config...HELP

    error message - itunes has detected a problem with your audio configuration. audio/video playback may not operate properly...
    ive gone through the itunes support steps such as reinstalling quicktime and itunes and nothing seems to work... itunes still open...but then nothing plays...please help me

    I've cobbled together a few ideas courtesy of some posts made by the inimitable b noir concerning this particular problem .
    First ...
    ... let's try swapping out your QuickTime, taking a few additional explicit precautions this time.
    head into your Add/Remove programs. uninstall QuickTime.
    Next, we’ll manually remove any leftover program files and folders.
    1. On the Start menu, click My Computer (or double-click My Computer on the Desktop).
    2. In My Computer, open Local Disk.
    3. Open Program Files.
    4. Right-click on the QuickTime folder and click Delete from the shortcut menu.
    5. Navigate to C:\Windows\system32\.
    6. Remove the files QuickTime.qts and QuicktimeVR.qtx.
    7. Restart your computer.
    next, we'll get a fresh copy of QuickTime into your PC by doing a repair install of itunes.
    switch off antivirus and antispyware applications prior to the repair install.
    go into Add/Remove and select itunes. click "Change" and then click "Repair".
    if the repair install goes through okay, restart the PC and try launching itunes again. does it launch properly now?
    Next ...
    If you're still getting the message with a fresh quicktime in place, let's check to see if something is awry with your sound card.
    Open your "Sounds and Audio Devices" control panel. Click the "Audio" tab. Is the correct default device showing up in the "Sound Playback" area?

  • This message recently popped up on my PC - "iTunes has detected a problem with your audio configuration. Audio/video playback may not operate properly." What does this mean and how to fix ??

    Hi Everyone - recently this message popped up on my PC, when I was trying to import cd's into the iTunes library and then onto my iPod - "iTunes has detected a problem with your audio configuration. Audio/video playback may not operate properly." Can anyone tell me what this means and how to fix it ?? I am not fantastically PC savvy, so any information explained fully and all steps to follow to get my music playing again would be great !! Thanks, SC

    Hi B, thanks so much for helping me troubleshoot !!
    Ok, so when I went in to check the Audio tab of the Sounds and Audio Device Properties, I found the following:-
    * Sound Playback Default Device = No Playback Devices.
    * Sound Recording Default Device = No Playback Devices.
    * MIDI Music Playback Default Device = No MIDI Playback Devices.
    All text in this drop-down box were light grey, and therefore unable to be selected or altered.
    I also tried playing a cd through Windows Media player, to see if I could get sound a different way. When I put the cd in and clicked on Play, the following message appeared, "Windows Media Player cannot play the file because there is a problem with your sound device. There may not be a sound device installed on your PC, it may be in use by another program, or it may not be functoning properly."
    Any ideas ? I had sound previously, but then a work colleague re-built the PC to add more space to the hard drive, and since then, no sound. I know this may now not just be an iTunes issue, but I would appreciate any assistance you can offer.
    Thanks again,
    Shell

  • When I open Itunes on my PC it says, Itunes has detected a problem with your audio configuration. Audio/video playback may not operate properly

    When I open Itunes on my PC it says, Itunes has detected a problem with your audio configuration. Audio/video playback may not operate properly. I removed some unused programs from my pc before this happened and I think I may have removed something I shouldn't have.

    I had this same problem and my sixteen year old figured it out. Since the Windows PC running iTunes (which supports a housefull of AppleTVs) was running in a closet, he suspected it was due to having no speakers attached.
    Sure enough, when I went into control panel to look at my sound settings, I noticed something I had missed previously. There was a red mark on the device. I took his advice and plugged in some earphones to the speaker jack and, wallah, the red mark turned green and the iTunes warning never popped up again.

  • After upgrade to iTunes 11 "iTunes has detected a problem with your audio configuration"

    After upgrading to iTunes 11 I have lost all sound on my PC running Windows XP.  When I try to open iTunes I get the following message: "iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly."  I have also lost sound when I attempt to listen to audio from a Website while in a browser session.  I notice I have also lost the volume setting icon from the system tray in the lower right corner of the screen.
    Please advise.

    Something went wrong during the upgrade to iTunes 11.  I have lost audio on my desktop PC running Windows XP.  No sound in iTunes: "iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly."  No sound during browser sessions.  The volume control icon disappeared from the system tray in the lower right corner of the screen.
    It seems that an audio driver(s) were damaged or deleted.  When I go into the Control Panel and check the reading for the audio hardware, the entry for the DVD/CD-ROM drive says:
    "Windows cannot start this hardware device because its configuration information (in the registry) is incomplete or damaged. (Code 19)
    Click Troubleshoot to start the troubleshooter for this device."
    Please advise.

  • TS1362 what happened?  itunes has detected a problem with your audio configuration.... playback may not operate properly.

    I run windows 7 and have used iTunes recently to listen to internet radio and iPod tracks (when loaded).  recently, I get the error message about the problem with my audio configuration every time I launch iTunes.  sure enough, nothing plays, yet internet audio/video clips play fine, so this is a specific problem with iTunes.  to address this, I have already
    1. removed and reinstalled iTunes using the add/remove programs windows
    2.  uninstalled and reinstalled Quicktime
    3.  updated my Windows audio device drivers
    4.  restarted the Windows audio and management something under
    i don't know what i'm doing wrong or why the problem is sudden.  but nothing will play from iTunes

    I'm having the same problem.  I have downloaded Itunes again but still the same problem.

  • Problem with Video capture Device

    i have a problem with FME. i am using Avermedia TV capture
    device and Canon 3ccd Digital Video Camcorder ( PAL ) when i open
    the FME interface the warning given for " Problem with Video
    Capture Device".
    i read all the topics in Flash Media Encoder Category, if
    this problem occures my capture device ( i expect MPEG ) how to
    solve this problem?
    Thanks,

    The Device Matrix is something we'll be updating in the
    future as we continue to test more and more equipement. Ideally, I
    would like for users such as yourselves to be able to add to it and
    tell us what has worked for you as well. If anyone has any ideas
    about what technology we should use to do this (e.g., this forum? a
    wiki?) please let me know.
    Regarding the devices not working - the main problem we see
    is that the system requirements are not being met. Here is what to
    check for:
    - are you running on Windows XP (only supported OS right
    now)?
    - do you have DirectX client runtime version 9c or higher
    installed?
    - do you have hardware acceleration enabled?
    - do you have 32bit graphics enabled?
    - do you have the latest direct show drivers from the
    card/device manufacturer?
    Thanks,
    Chris Hock
    Adobe Systems Inc.

Maybe you are looking for