Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio stopped working on Linux Mint 22 #100

Open
defensem3ch opened this issue Sep 21, 2024 · 9 comments
Open

Audio stopped working on Linux Mint 22 #100

defensem3ch opened this issue Sep 21, 2024 · 9 comments

Comments

@defensem3ch
Copy link
Contributor

It seems that I am not able to hear any audio output from the kit editor, possibly due to the patcher selecting an incorrect default audio output? I am still testing pipewire audio setup in Linux Mint, but it might be nice to consider if there is an easy way to select an audio device, possibly via commandline argument.

@jkotlinski
Copy link
Owner

jkotlinski commented Sep 21, 2024 via email

@jkotlinski
Copy link
Owner

jkotlinski commented Sep 21, 2024 via email

@defensem3ch
Copy link
Contributor Author

Yes, but the java app seems perhaps to ignore the default audio device. I've spent some time researching the issue but unfortunately haven't stumbled upon anything helpful yet.

@jhob101
Copy link

jhob101 commented Sep 23, 2024

Not sure if this is related, but wav files exported from Reaper only play the first 1 second in kit manager, but the whole loop is actually saved to the kit.

Other wav files seem fine, not quite sure what the difference would be.

@jkotlinski
Copy link
Owner

jkotlinski commented Sep 23, 2024 via email

@jhob101
Copy link

jhob101 commented Sep 23, 2024

I think I just figured it out. It's ok if exported as 16bit PCM wav, it's 24bit PCM wavs that it just plays first second.

So there is as solution, probably not a priority to fix, if a fix is even needed.

Links to download the 2 wavs:
24 bit: https://i.damselflycreative.com/media/16bit.wav
16 bit: https://i.damselflycreative.com/media/24bit.wav

@jkotlinski
Copy link
Owner

I tried adding the 24-bit sample and it worked just fine on my computer.
But it relies on native Java function AudioSystem.getAudioInputStream to do the conversion.
Maybe it is buggy on Linux and needs to be replaced with bespoke code that actually works.

@jhob101
Copy link

jhob101 commented Sep 24, 2024

Good to know. 16 bit is fine anyway, not like you need especially high quality source audio!

I'm using pipewire, so might be something related to that.

@defensem3ch
Copy link
Contributor Author

I was able to replace some of the code in Sound.java to use the "pulse" audio device and this is working for me. In the future it would be more ideal to implement this as a menu item, I may work on this and provide a pull request if I ever have enough free time.

// Get the specific mixer (audio device) containing "M4" in its name
        Mixer mixer = getMixerByName("pulse");
        if (mixer == null) {
            throw new LineUnavailableException("No audio device found containing 'pulse' in its name.");
        }

        // Get the Clip from the selected mixer
        Clip clip = (Clip) mixer.getLine(new DataLine.Info(Clip.class, new AudioFormat(PLAYBACK_RATE, 16, 1, true, false)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants