Oss2jack and fusd

hi all
i tried to get oss2jack working to redirect the sound from TeamSpeak to the Jack Audio Server. But the installation failed, because of the fusd-kor package.
could someone pls rebuild fusd-kor?
http://aur.archlinux.org/packages.php?O … _Search=Go
best regards!

The fusd-kor package I think it totally dead. Months and months ago I spent hours trying to get it to compile. but I wasn't able to. I think the coder who made it is gone.

Similar Messages

  • I've adopted the oss2jack and fusd-kor packages, but need help

    Some people are still using this software (and I'm eyeing it) and I felt I should do them a favor. Problem is, I'll need some help.
    For fusd-kor, the PKGBUILD looks like this:
    # Contributor: nut543 <[email protected]>
    # Contributor: Shadowhand <[email protected]>
    pkgname=fusd-kor
    pkgver=1.10.12
    _realver=konstruktiv.org_hack
    pkgrel=1
    pkgdesc="FUSD hack developed for the oss2jack project and 2.6.x > udev kernels."
    arch=(i686)
    url="http://hg.konstruktiv.org/fusd/"
    license=('GPL')
    depends=()
    makedepends=('mercurial')
    source=(fusd.install fusd.rules)
    md5sums=('982f0b5b6c7af5fe7f4b9e3134c5f1fb' 'dd880fac320283c9c134f8efa0b5bb84')
    install=fusd.install
    build() {
    cd $startdir/src
    msg "Connecting to mercurial server...."
    hg clone http://hg.konstruktiv.org/fusd
    cd fusd
    sed -i 's|local/||' Makefile
    sed -i 's|-O2 -g|-O2 -fomit-frame-pointer -march=i686|g' make.include
    sed -i 's|-Werror||g' make.include
    msg "Starting make..."
    make || return 1
    cp Makefile Makefile.save
    cp kfusd/Makefile kfusd/Makefile.save
    sed -i "s|/usr/|$startdir/pkg/usr/|g" Makefile
    sed -i "s|/lib/|$startdir/pkg/lib/|g" Makefile
    sed -i "s|\(/lib/modules/\$(shell uname -r)/misc\)|${startdir}/pkg\1|g" kfusd/Makefile
    mkdir -p $startdir/pkg/lib/modules/$(uname -r)/misc
    mkdir -p $startdir/pkg/usr/{lib,include}
    sed -i 's|/sbin/depmod -a||' Makefile
    make install || return 1
    # Restore original Makefiles
    rm {Makefile,kfusd/Makefile}
    cp Makefile.save Makefile
    cp kfusd/Makefile.save kfusd/Makefile
    cd $startdir/src
    install -D -m 644 fusd.rules $startdir/pkg/etc/udev/rules.d/30-fusd.rules
    msg "If you saw an error about not finding the kfusd.ko module, do the following:"
    msg "as root: cd /usr/src/linux-$(uname -r) && make"
    First off, it seems to me like sticking in optimizations as is done here is a bad idea.
    Second - there's still a version of fusd-kor available on the oss2jack homepage, shouldn't that be used? The homepage for the one above seems to be dead anyway, although it claims to be a later version.
    I might be asking further questions too, as I've never maintained a kernel module PKGBUILD before.
    Also, here's the install file:
    # This is a default template for a post-install scriptlet. You can
    # remove any functions you don't need (and this header).
    # arg 1: the new package version
    pre_install() {
    rm -f /etc/udev/permissions.d/fusd.permissions
    rm -f /etc/udev/rules.d/??-fusd.rules
    /bin/true
    # arg 1: the new package version
    post_install() {
    depmod -ae
    sleep 1
    echo "Modprobe'ing kfusd"
    modprobe kfusd && echo sucess\! || echo failure to modprobe kfusd\, try to \-f\(force\) it
    echo 'add kfusd to your /etc/rc.conf MODULES array to have it load at startup.'
    /bin/true
    # arg 1: the new package version
    # arg 2: the old package version
    pre_upgrade() {
    /bin/true
    # arg 1: the new package version
    # arg 2: the old package version
    post_upgrade() {
    /bin/true
    # arg 1: the old package version
    pre_remove() {
    /bin/true
    # arg 1: the old package version
    post_remove() {
    rm -f /etc/udev/permissions.d/fusd.permissions
    rm -f /etc/udev/rules.d/??-fusd.rules
    /bin/true
    op=$1
    shift
    $op $*
    Is there anything in there that should be modified?
    And now, oss2jack:
    # Contributor: nut543 <[email protected]>
    pkgname=oss2jack
    pkgver=0.25
    arch=('i686')
    pkgrel=7
    pkgdesc="Routes /dev/dsp to Jack enabling TeamSpeak and other OSS-only mmap apps to work."
    depends=(jack-audio-connection-kit libsamplerate fusd-kor)
    source=(http://fort.xdas.com/~kor/oss2jack/$pkgname-$pkgver.tar.gz \
    oss2jack)
    url="http://fort.xdas.com/~kor/oss2jack/"
    license=('GPL')
    md5sums=(7fd10dd2391cbef147fa36563969e3e2\
    596661877446a02c7e9497178db60af7)
    install=oss2jack.install
    build() {
    mkdir -p $startdir/pkg/etc/rc.d
    install -g root -o root -m 755 $startdir/oss2jack $startdir/pkg/etc/rc.d/oss2jack
    cd $startdir/src/$pkgname-$pkgver
    ./configure --with-fusd=/usr --prefix=/usr
    make || return 1
    make DESTDIR=$startdir/pkg install
    And the install file:
    # This is a default template for a post-install scriptlet. You can
    # remove any functions you don't need (and this header).
    # arg 1: the new package version
    pre_install() {
    echo 'see http://wiki.archlinux.org/index.php/Allow_multiple_programs_to_play_sound_at_once#ALSA_with_oss2jack for help starting up oss2jack'
    /bin/true
    # arg 1: the new package version
    post_install() {
    /bin/true
    # arg 1: the new package version
    # arg 2: the old package version
    pre_upgrade() {
    /bin/true
    # arg 1: the new package version
    # arg 2: the old package version
    post_upgrade() {
    /bin/true
    # arg 1: the old package version
    pre_remove() {
    /bin/true
    # arg 1: the old package version
    post_remove() {
    /bin/true
    op=$1
    shift
    $op $*
    The PKGBUILD looks fine to me. Not so sure about the install file, it looks a little... redundant? But if you guys notice anything gravely wrong with these, please post it, okay?
    Edit: And sorry for the long post... wow.
    Last edited by Gullible Jones (2008-06-04 01:29:55)

    Okay, I modified the PKGBUILD for fusd-kor, but I get this when I try to compile...
    make[2]: Entering directory `/usr/src/linux-2.6.25-ARCH'
    CC [M] /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.o
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:60:26: error: linux/config.h: No such file or directory
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:70:35: error: linux/devfs_fs_kernel.h: No such file or directory
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:181: error: expected ')' before string constant
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c: In function 'fusd_register_device':
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:2036: warning: label 'register_failed2' defined but not used
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c: At top level:
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:2517: error: unknown field 'writev' specified in initializer
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:2517: warning: initialization from incompatible pointer type
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c: In function 'init_fusd':
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:2941: warning: label 'fail2' defined but not used
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:2929: warning: label 'fail7' defined but not used
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c: In function 'cleanup_fusd':
    /home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.c:2960: error: implicit declaration of function 'devfs_remove'
    make[3]: *** [/home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd/kfusd.o] Error 1
    make[2]: *** [_module_/home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd] Error 2
    make[2]: Leaving directory `/usr/src/linux-2.6.25-ARCH'
    make[1]: *** [default] Error 2
    make[1]: Leaving directory `/home/proteus/Packages/fusd-kor/src/fusd-kor-1.10-11/kfusd'
    make: *** [obj.i686-linux/kfusd.ko] Error 2
    ==> ERROR: Build Failed.
    Aborting...
    What's going on?

  • Jack-audio-connection-kit with oss2jack

    I have an onboard Ali soundcard that I just use the intel8x0 driver for and I've never had any sound problems. Today I decided I wanted to try out a sound server so that I could play multiple sounds at once. Everything seemed to go as planned. I built the the oss2jack and fusd-kor packages with makepkg and then installed them with makepkg and everything seemed to go without hitch. I put os2jack after jack-audio-connection-kit (which is the longest daemon name I've seen by far, I might add) in my daemon's list in my rc.conf and upon reboot there were no issues starting either daemon. However when I attempt to play something in rhythmbox or vlc (changing between the OSS and the ALSA output methods) nothing would play and this error would come up in the messages on vlc:
    oss error: cannot open audio device (/dev/dsp)
    Here is my modprobe.conf:
    # /etc/modprobe.conf (for v2.6 kernels)
    # OSS Compatibility
    install snd-pcm modprobe -i snd-pcm ; modprobe snd-pcm-oss ; true
    install snd-seq modprobe -i snd-seq ; modprobe snd-seq-oss ; true
    # --- BEGIN: Generated by ALSACONF, do not edit. ---
    # --- ALSACONF version 1.0.10 ---
    alias snd-card-0 snd-intel8x0
    alias sound-slot-0 snd-intel8x0
    # --- END: Generated by ALSACONF, do not edit. ---
    Here are the settings from my /etc/conf.d/jack-audio-connection-kit (they're the same as the ones in the wiki).
    SERVER_PARAMS="-R -s -d alsa"
    DRIVER_PARAMS="hw:0 -p 64 -r 44100"
    And I also have the modules snd-intel-8x0, kfusd, and snd-pcm-oss in my rc.conf modules list.
    If you need any more information I will gladly provide. I'm sorry if this is a stupid error, I know next to nothing about audio on linux.

    your not supposed to use the /etc/modprobe.conf file in archlinux. your not supposed to use the snd-pcm-oss module with oss2jack because snd-pcm-oss is alsa's oss emulation. That creates problems because the oss sound dev node is /dev/dsp which oss2jack also creates; and can't create because you load snd-pcm-oss which creates the dev node before oss2jack is loaded which then makes it impossible for oss2jack to create it. (hope that made sense)
    (modinfo module-name to see what a specific kernel module does)
    anyway:
    1. remove everything which isn't comments from /etc/modprobe.conf
    2. remove snd-pcm-oss from rc.conf
    3. reboot
    4. try it, it should work

  • Linux is constantly capturing my mic :S

    Well I tried following this guide: http://wiki.archlinux.org/index.php/All … nd_at_once and the part about oss2jack and after that the system is constantly capturing my mic...
    I didn't even succeed with the install so I removed all of the packages but it's still doing it :S (with alsa)
    So the i tried this : http://wiki.archlinux.org/index.php/OSS … cial_Setup and i got sound working with multiple programs but Linux is still constantly capturing my mic and this is driving me crazy!
    Skype gives me an error:
    mixer_fd=28
    skype: relocation error: skype: symbol snd_mixer_free, version ALSA_0.9 not defined in file libasound.so.2 with link time reference
    Maybe it helps maybe it doesn't.
    I really would like a solution to this!

    My guess is that it's just unmuted. Run alsamixer in a terminal, use the arrows to navigate to the Mic fader, and press "m" to mute it. That may work.

  • Jack and oss2jack consume too much memory

    This is my free output when I load jack and oss2jack at startup:
    total used free shared buffers cached
    Mem: 250148 244720 5428 0 5160 67224
    -/+ buffers/cache: 172336 77812
    Swap: 2449860 66048 2383812
    A check in top reveals that jack and oss2jack are the main culprits.
    Because of this, I cannot load hydrogen with the ns_kit7free samples (which is 200MB worth of .wav files). It terminates (probably due to trying to access too much memory) when I attempt to switch the drumkit to ns_kit7free. I have managed to load it before, when I was just using ALSA directly. Is there any way to reduce the memory consumption of jack and oss2jack?
    I have increased my swap space to > 2GB (as seen in the free output) but it doesn't help.

    jonathantan86 wrote:From top's output jack took up 2/3rd of the memory used. About adding more memory, well...it's a laptop so it's difficult to add memory.
    Well, if this can't be solved and you don't have to use ALSA, try OSS/Commercial (wiki); it has a virtual mixer in kernel-space and supports up to 32 sound output streams

  • Fusd-kor error

    Here as well error in the package........
    ./PKGBUILD: line 21: cd: fusd: No such file or directory
    sed: can't read Makefile: No such file or directory
    sed: can't read make.include: No such file or directory
    sed: can't read make.include: No such file or directory
    ==> Starting make...
    ./PKGBUILD: line 26: make: command not found
    ==> ERRORE: Compilazione interrotta.
    L'operazione sta per essere interrotta...
    # Contributor: nut543 <[email protected]>
    # Contributor: Shadowhand <[email protected]>
    pkgname=fusd-kor
    pkgver=1.10.12
    _realver=konstruktiv.org_hack
    pkgrel=1
    pkgdesc="FUSD hack developed for the oss2jack project and 2.6.x > udev kernels."
    arch=(i686)
    url="http://hg.konstruktiv.org/fusd/"
    license=('GPL')
    depends=()
    makedepends=('mercurial')
    source=(fusd.install fusd.rules)
    md5sums=('982f0b5b6c7af5fe7f4b9e3134c5f1fb' 'dd880fac320283c9c134f8efa0b5bb84')
    install=fusd.install
    build() {
    cd $startdir/src
    msg "Connecting to mercurial server...."
    hg clone http://hg.konstruktiv.org/fusd
    cd fusd
    sed -i 's|local/||' Makefile
    sed -i 's|-O2 -g|-O2 -fomit-frame-pointer -march=i686|g' make.include
    sed -i 's|-Werror||g' make.include
    msg "Starting make..."
    make || return 1
    cp Makefile Makefile.save
    cp kfusd/Makefile kfusd/Makefile.save
    sed -i "s|/usr/|$startdir/pkg/usr/|g" Makefile
    sed -i "s|/lib/|$startdir/pkg/lib/|g" Makefile
    sed -i "s|\(/lib/modules/\$(shell uname -r)/misc\)|${startdir}/pkg\1|g" kfusd/Makefile
    mkdir -p $startdir/pkg/lib/modules/$(uname -r)/misc
    mkdir -p $startdir/pkg/usr/{lib,include}
    sed -i 's|/sbin/depmod -a||' Makefile
    make install || return 1
    # Restore original Makefiles
    rm {Makefile,kfusd/Makefile}
    cp Makefile.save Makefile
    cp kfusd/Makefile.save kfusd/Makefile
    cd $startdir/src
    install -D -m 644 fusd.rules $startdir/pkg/etc/udev/rules.d/30-fusd.rules
    msg "If you saw an error about not finding the kfusd.ko module, do the following:"
    msg "as root: cd /usr/src/linux-$(uname -r) && make"
    There is a way to have teamspeak or mumble working under archlinux? it gives error in both packages...
    Thank you very much

    hm oss2jack is nice but if you want to route alsa sound into jack you need the alsa-plugins, there is a version in aur when i correct remeber.
    After you installed you need to configure alsa to do what you want, there
    are two way, first edit the global or edit the user specific alsa config and
    insert :
    pcm.jackplug {
    type plug
    slave { pcm "jack" }
    pcm.jack {
    type jack
    playback_ports {
    0 alsa_pcm:playback_1
    1 alsa_pcm:playback_2
    capture_ports {
    0 alsa_pcm:capture_1
    1 alsa_pcm:capture_2
    for more information look : http://www.alsa-project.org/alsa-doc/do … p#jackplug

  • Oss2jack problem [Solved]

    I recently set up mpd and sonata and it worked, but I wanted to allow multiple programs to play sound so I decided to install oss2jack.  It worked, but then  I rebooted and I get an error when trying to play something.  For example, I type: ogg123 music/file.ogg, I get:
    ALSA lib pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave
    === Could not load default driver and no driver specified in config file. Exiting.
    This is my /etc/rc.conf:
    # /etc/rc.conf - Main Configuration for Arch Linux
    # LOCALIZATION
    # LOCALE: available languages can be listed with the 'locale -a' command
    # HARDWARECLOCK: set to "UTC" or "localtime"
    # TIMEZONE: timezones are found in /usr/share/zoneinfo
    # KEYMAP: keymaps are found in /usr/share/kbd/keymaps
    # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
    # CONSOLEMAP: found in /usr/share/kbd/unimaps
    # USECOLOR: use ANSI color sequences in startup messages
    LOCALE="en_US.utf8"
    HARDWARECLOCK="localtime"
    TIMEZONE="US/Eastern"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    # HARDWARE
    # Scan hardware and load required modules at bootup
    MOD_AUTOLOAD="yes"
    # Module Blacklist - modules in this list will never be loaded by udev
    MOD_BLACKLIST=()
    # Modules to load at boot-up (in this order)
    # - prefix a module with a ! to blacklist it
    MODULES=(snd_pcm_oss snd_pcm snd_intel8x0)
    # Scan for LVM volume groups at startup, required if you use LVM
    USELVM="no"
    # NETWORKING
    HOSTNAME="arch"
    # Interfaces to start at boot-up (in this order)
    # Declare each interface then list in INTERFACES
    # - prefix an entry in INTERFACES with a ! to disable it
    # - no hyphens in your interface names - Bash doesn't like it
    # Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
    lo="lo 127.0.0.1"
    eth0="dhcp"
    INTERFACES=(lo eth0)
    # Routes to start at boot-up (in this order)
    # Declare each route then list in ROUTES
    # - prefix an entry in ROUTES with a ! to disable it
    gateway="default gw 192.168.0.1"
    ROUTES=(!gateway)
    # Enable these network profiles at boot-up. These are only useful
    # if you happen to need multiple network configurations (ie, laptop users)
    # - set to 'menu' to present a menu during boot-up (dialog package required)
    # - prefix an entry with a ! to disable it
    # Network profiles are found in /etc/network-profiles
    #NET_PROFILES=(main)
    # DAEMONS
    # Daemons to start at boot-up (in this order)
    # - prefix a daemon with a ! to disable it
    # - prefix a daemon with a @ to start it up in the background
    DAEMONS=(syslog-ng hal network portmap fam alsa mpd jack-audio-connection-kit crond)
    # End of file
    This is my /etc/rc.local:
    #!/bin/bash
    # /etc/rc.local: Local multi-user startup script.
    modprobe kfusd
    oss2jack &> /dev/null &
    Does anyone know why it isn't working?

    brainwasher wrote:
    yankees26 wrote:yup, yup, fixed.
    how ?
    depends on the app you use to play sound 

  • FUSD - Shipper's Exp. Decl.

    Hello,
    I am unable to print out the form for FUSD output type by using the transaction VF02. I have done all the config and settings in NACE.
    Please let me know if i have to take care of anything more

    Form SD_EXPORT_FUSD is sapscript, so it's client dependent (if it was smartform you wouldn't face this problem since smartform objects are client independent).
    You can ask your basis team to create a transport for this object and move it from client 000 to your sandbox client - or you can also do it having the necessary access / authorrization.

  • A problem with Threads and loops.

    Hi, I have some code that needs to be constantly running, like while(true)
          //code here
    }However, the code just checks to see if the user has input anything (and then if the user has, it goes to do some other stuff) so I don't need it constantly running and hogging up 98% of the CPU. So I made my class (which has the method that needs to be looped, call it ClassA) implement Runnable. Then I just added the method which needed to be looped into the public void run()
    I have another class which creates an instance of the above class (call it ClassB), and the main(String[] args) is in there.
    public static void main(String[] args)
              ClassA test = new ClassA();
              Thread thread = new Thread(test.getInstanceOfClassA());
              thread.start();
              while(true)
                           //I do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...) but I can't think of away to get it to run - sleep - run -sleep forever. Can someone help me?

    Hi, I have some code that needs to be constantly
    running, like while(true)
    //code here
    }However, the code just checks to see if the user has
    input anything (and then if the user has, it goes to
    do some other stuff) so I don't need it constantly
    running and hogging up 98% of the CPU. Where does the user input come from. Are you reading from an InputStream? If so, then your loop will be blocked anyway when reading from the InputStream until data is available. During that time, the loop will not consume processor cycles.
    public static void main(String[] args)
              ClassA test = new ClassA();
    Thread thread = new Thread(test.getInstanceOfClassA());I have never seen this idiom. If ClassA instanceof Runnable, you simply write new Thread(test).
              thread.start();
              while(true)
    //I do not know what to put
    do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...)Yeah, why would you want to call it more than once given that you have an infinite loop in ClassA.run()?
    Harald.
    Java Text Crunching: http://www.ebi.ac.uk/Rebholz-srv/whatizit/software

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with Threads and "plase wait..."-Window

    Hi everyone,
    I have a problem that I'm not able to solve in any way... I have a time-consuming task (a file decryption) which I execute in a separate thread; I've used the SwingWorker class, like suggested by sun-tutorial, and it works right. The problem is that I have to wait that the decryption have finished before continuing with program-execution. Therefore I would like to display a "please wait"-window while the task runs. I've tryed all the possible ways I know but the problem is always the same: the waitWindow is displayed empty, the bounds are painted but the contents no; it's only painted when the decrypt-task has finished. Please help me, I have no more resources....
    decrypt-file code:
    public class DecryptFile {
      private String cryptedFileNameAndPath;
      private ByteArrayInputStream resultStream = null;
      // need for progress
      private int lengthOfTask;
      private int current = -1;
      private String statMessage;
      public DecryptFile(String encZipFileNameAndPath) {
        cryptedFileNameAndPath = encZipFileNameAndPath;
        //Compute length of task...
        // 0 for indeterminate
        lengthOfTask = 0;
      public ByteArrayInputStream getDecryptedInputStream() {
        return this.resultStream;
       * Called from ProgressBarDemo to start the task.
      public void go() {
        current = -1;
        final SwingWorker worker = new SwingWorker() {
          public Object construct() {
            return new ActualTask();
        worker.start();
       * Called from ProgressBarDemo to find out how much work needs
       * to be done.
      public int getLengthOfTask() {
        return lengthOfTask;
       * Called from ProgressBarDemo to find out how much has been done.
      public int getCurrent() {
        return current;
      public void stop() {
        current = lengthOfTask;
       * Called from ProgressBarDemo to find out if the task has completed.
      public boolean done() {
        if (current >= lengthOfTask)
          return true;
        else
          return false;
      public String getMessage() {
        return statMessage;
       * The actual long running task.  This runs in a SwingWorker thread.
      class ActualTask {
        ActualTask () {
          current = -1;
          statMessage = "";
          resultStream = AIUtil.getInputStreamFromEncZip(cryptedFileNameAndPath); //here the decryption happens
          current = 0;
          statMessage = "";
      }The code that calls decryption and displays waitWindow
          final WaitSplash wS = new WaitSplash("Please wait...");
          final DecryptFile cryptedTemplate = new DecryptFile (this.templateFile);
          cryptedTemplate.go();
          while (! cryptedTemplate.done()) {
            try {
              wait();
            } catch (Exception e) { }
          this.templateInputStream = cryptedTemplate.getDecryptedInputStream();
          wS.close();Thanks, thanks, thanks in advance!
    Edoardo

    Maybe you can try setting the priority of the long-running thread to be lower? so that the UI will be more responsive...

  • Problem with threads and graphics

    I have a thread that chooses paths for a Travelling salesman problem, it then calls a TSPdraw class and passes it the path, which the class then draws. the problem is when i have two threads it creates two windows but only draws a path in one of them. any ideas where i`m going wrong

    Are you using swing components? Swing isn't threadsafe. If you have multiple threads that want to update your UI you need to use the SwingUtilities.invokeLater(...)or invokeAndWait(...). There is a page in the swing tutorial about this at: http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

  • Problem with threads and ProgressMonitor

    Dear Friends:
    I have a little problem with a thread and a ProgressMonitor. I have a long time process that runs in a thread (the thread is in an separate class). The thread has a ProgressMonitor that works fine and shows the tasks progress.
    But I need deactivate the main class(the main class is the user interface) until the thread ends.
    I use something like this:
    LongTask myTask=new LongTask();
    myTask.start();
    myTask.join();
    Now, the main class waits for the task to end, but the progress monitor don`t works fine: it shows only the dialog but not the progress bar.
    What's wrong?

    Is the dialog a modal dialog? This can block other UI updates.
    In general, you should make sure that it isn't modal, and that your workThread has a fairly low priority so that the UI can do its updating

  • Problem with threads and/or memory

    I'm developing an application where there are 3 threads. One of them sends a request to the other, and if the 2nd can't answer it, it sends it to the 3rd (similar to CPU -> CACHE -> MEMORY). When i run the program with 1000-10.000 requests, no problem occurs. When i run it with 300.000-1.000.000 requests, it sometimes hangs. Is this a problem with the garbage collector, or should it be related to the threads mecanism.
    (note: eache thread is in execution using a finite state machine)

    i had been running the program inside Netbeans.
    Running the jar using the command line outside
    Netbeans i have no more problems... Does Netbeans use
    it's own JVM?Depends how you set it up, but look under the options. There are settings for the compiler and jvm that it uses.

Maybe you are looking for

  • How do I map a windows shared drive to my mac?

    how do I map a windows shared drive to my mac?

  • Supprise Formatting got rid of Photos- Any chance of recovery?

    I acciddentally formatted my mothers' iPhone, therefore I lost my pictures. Beforehand, an attempt to save a back up actually failed, I didnt pay attention I must admit...but surely there is a file that stores this information on, even if its only a

  • Link  to a Datagrid

    I have a data grid with values as follows Jan | Feb 100 | 200 when I want the column data say 100, 200 have hyerlink and on clicking oh that i want to go to another grid which will show me the break up of Rupees 100 in next grid for the month jan. ho

  • HFM can not authentificate MSAD users

    Hello, we have an issue on our HFM (9.2.0.3) server. We want to use externall authentification with MSAD. Shared service server is correctly configure for that an it works fine ( it works fine for our Workspace / BI+ server as well). But, HFM is not

  • FlashCS4 and Cintiq and Symbols

    So we've gone from CS3 to CS4 now. Our animators are finding that drawing inside a symbol is painfully slow. Outside on the stage is fine, but when in a symbol, Flash simply cannot keep up with the pen. This a fresh install of Mac OS X Leopard 10.5.6