Volume difference between Jack and Alsa

What other apps and distros do you use to round out your studio?

Moderators: MattKingUSA, khz

Post Reply
LocProg
Established Member
Posts: 5
Joined: Fri Apr 01, 2022 5:38 pm
Been thanked: 2 times

Volume difference between Jack and Alsa

Post by LocProg »

Hello everybody. This is my first post in this forum and I hope not to have the wrong session.
I have been using Ubuntu Mate for many years now and I use Lowlatency kernels to make music. Everything works fine but today (only today after many years) I realized that using jack the audio volume is considerably lower than what I have using Alsa. Is this normal, is there a specific reason? If so, is there a procedure to fix this?

Thank you all..
User avatar
milkii
Established Member
Posts: 477
Joined: Tue Jan 05, 2016 9:08 am
Location: Edinburgh
Has thanked: 92 times
Been thanked: 91 times
Contact:

Re: Volume difference between Jack and Alsa

Post by milkii »

What software are you using? Carla doesn't default to 100% volume out iirc

they/them ta / libreav.org / wiki.thingsandstuff.org/Audio and related pages / gh

LocProg
Established Member
Posts: 5
Joined: Fri Apr 01, 2022 5:38 pm
Been thanked: 2 times

Re: Volume difference between Jack and Alsa

Post by LocProg »

thanks for answering. I noticed that "issue" (if it is) using simply jack server. I connect direclty the capture to jack to oututputs (see the immagine attached).

Excuse me but maybe I omitted some details in my first post. When I play bass the volumes are similar with both direct monitoring and Jack. I don't think there are any problems in this respect.
The difference is heard with YouTube audio, for example. If I listen to it through Alsa the volume is quite louder than if I listen to it with Jack.

EDIT: What does it mean "iirc"?
Jack audio connections
Jack audio connections
Schermata a 2022-04-02 21-49-21.png (61.61 KiB) Viewed 2849 times
User avatar
bluzee
Established Member
Posts: 338
Joined: Mon Nov 30, 2020 11:43 pm
Has thanked: 18 times
Been thanked: 88 times

Re: Volume difference between Jack and Alsa

Post by bluzee »

Check all your mixer level settings. Listening to YouTube is probably going through pulse audio. In sound settings for pulse I can amplify it up to 150% if i remember correctly.
LocProg
Established Member
Posts: 5
Joined: Fri Apr 01, 2022 5:38 pm
Been thanked: 2 times

Re: Volume difference between Jack and Alsa

Post by LocProg »

Thanks Again. It seems to me 100%
Schermata a 2022-04-02 23-32-13.png
Schermata a 2022-04-02 23-32-13.png (47.16 KiB) Viewed 2839 times
User avatar
sunrat
Established Member
Posts: 915
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 151 times
Been thanked: 242 times

Re: Volume difference between Jack and Alsa

Post by sunrat »

Youtube videos vary a lot in volume. I mean a real lot, some I have to turn down and some I have to double the volume.
User avatar
onefang
Established Member
Posts: 148
Joined: Fri Feb 03, 2023 1:17 am
Location: Australia
Has thanked: 67 times
Been thanked: 11 times
Contact:

Re: Volume difference between Jack and Alsa

Post by onefang »

I have recently noticed the same, some things are much less volume through JACK than through ALSA.

A bit of a pre-amble before I continue.

I was studying music at school in the '60's and '70s, up to the end of high school, and singing in choirs as well as playing in school bands. Then in the '80s I was working in R&D designing MIDI equipment, and hanging out with bands. These days I'm a semi-retired computer programmer and sysadmin.

End of last year I stumbled across a MIDI keyboard Alesis V25 that a neighbour had thrown out. It had been sitting in a box outside soaking in dirty water coz it had rained and the box had other garbage in it. I pulled it apart, dried it, cleaned it, regreased it, put it back together, it works perfectly, and the lady who threw it out said I could keep it. I had been thinking for a while that I should buy something like this, read the reviews, lots of which used the word "durable", and if I had bought one, this model would have been on my short list. So starting New Years Eve (while I've been on holiday) I started learning how to play it (my previous instruments where flute and hand bells) and learning about all this fancy new music software that didn't exist in the '70s, plus relearning music theory. Including JACK stuff, and I use ALSA as the backend. BTW my holiday ends next week.

So I've been working on a cover for Pink Floyd's "Set The Controls For The Heart Of The Sun", to relearn musical theory, practice my new keyboard playing skills, and get familiar with the software. Mine will be titled "Set the controls for the drum and the bass" and I've modified the lyrics to be about climate change.

Couple of years ago I built what I call my super desktop, using a 64 core Threadripper and 256 GB of RAM. It has two sound chips on the motherboard, with several sound inputs and outputs, the video card has SIX (WTF!) audio outputs despite the fact there's only four actual outputs (two Display Port, two HDMI). On top of that I have a Plantronics RIG, which is a sorta mini mixer and USB sound device. So there's lots of audio inputs and outputs to play with.

END OF PRE-AMBLE.

I got to the point where I had to deal with getting the vocals laid down. I spend for too much of my time not talking coz I'm mostly typing to people on the Internet, so my old singing voice is very rusty, and delicate from lack of use. Also I have a small bedroom "studio", some cheap arsed microphone that came as a freebie long ago with something else, and lots of fans and air conditioning coz heatwave (37 C yesterday). So I decided to teach my computer to sing my lyrics. After much research trying to find pure open source singing things I decided to use Festival's inbuilt singing mode, crappy quality, but then I've only been an "electronic music producer" for a month, the rest of the music is also crap. This output a .wav file. So far so good.

FINALLY .... lol

Dragged this .wav file into MusE 4.1, it's both clipping AND very quiet. Huh? Plays loud enough in any ALSA software I try, but not in any JACK software. In particular VLC can easily switch between ALSA and JACK, so yep quiet through JACK, loud through ALSA. So it looks like it clips in MusE before it gets sent to JACK, then is quiet.

I have several other .wav files in this song already, none of them had this problem. I have recently noticed that some of the instruments I have been playing with are now less loud than they where when I first played with them. At least I think they are. It's entirely possible that between first playing with those instruments and now noticing they are less loud is the time I switched my JACK output to the other motherboard sound chip. Currently the ALSA is using the RIG USB output.

SOOOO it might be that this other motherboard sound chip is somehow incompatible with something about this .wav file and some of the instruments I'm using, but more compatible with the other instruments and .wav files. This may or may not be the same problem @LocProg has.

I need to experiment more. Switching hardware around between ALSA and JACK. Trying to output the .wav file with different parameters, or converting it to .flac first.

I prefer to be known as a figment of the 'nets imagination, living in the future, waiting for the rest of you to catch up.
Notes from Untalenz, an untalented old muso https://Untalenz.rocks/

User avatar
Impostor
Established Member
Posts: 1337
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 138 times
Been thanked: 346 times

Re: Volume difference between Jack and Alsa

Post by Impostor »

onefang wrote: Sat Feb 04, 2023 7:10 am

It has two sound chips on the motherboard,

What motherboard is that?

onefang wrote: Sat Feb 04, 2023 7:10 am

Dragged this .wav file into MusE 4.1, it's both clipping AND very quiet.

Try a wave editor instead, like Audacity. You can see if it's clipped or not, and I think audacity can switch between Jack and Alsa audio output for direct comparison. Also, check the mixer settings?

User avatar
onefang
Established Member
Posts: 148
Joined: Fri Feb 03, 2023 1:17 am
Location: Australia
Has thanked: 67 times
Been thanked: 11 times
Contact:

Re: Volume difference between Jack and Alsa

Post by onefang »

Impostor wrote: Sat Feb 04, 2023 12:37 pm
onefang wrote: Sat Feb 04, 2023 7:10 am

It has two sound chips on the motherboard,

What motherboard is that?

MSI Creator TRX40. Realtek ALC1220 7.1 channel HD audio is the main sound chip, it feeds the sockets at the back. ALC4050 is the USB front end for the ALC1220, as well as feeding the front panel microphone and headphone sockets, as well as the S/PDIF output on the back. Somewhere mixed in with that is an internal speaker / buzzer output which I don't think I plugged into anything.

Impostor wrote: Sat Feb 04, 2023 12:37 pm
onefang wrote: Sat Feb 04, 2023 7:10 am

Dragged this .wav file into MusE 4.1, it's both clipping AND very quiet.

Try a wave editor instead, like Audacity. You can see if it's clipped or not, and I think audacity can switch between Jack and Alsa audio output for direct comparison. Also, check the mixer settings?

That's what I used VLC for, to switch between ALSA and JACK, as I mentioned. MusE mixer settings clip even more when I pump up the mixer from the default 0. The actual file isn't clipped.

I prefer to be known as a figment of the 'nets imagination, living in the future, waiting for the rest of you to catch up.
Notes from Untalenz, an untalented old muso https://Untalenz.rocks/

User avatar
Impostor
Established Member
Posts: 1337
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 138 times
Been thanked: 346 times

Re: Volume difference between Jack and Alsa

Post by Impostor »

onefang wrote: Sat Feb 04, 2023 1:37 pm

settings clip even more when I pump up the mixer from the default 0. The actual file isn't clipped.

I just tried it myself:

Made an audio wave, normalized it to -0.3 dB in a wave editor, imported it into a MusE 4.1 wavetrack, and when playing, with the mixer sliders at zero (both the wave and audio out), the maximum level reached is indeed -0.3 dB, both on the wavetrack and the master.

When I mix mono and stereo waves on the same mono channel the stereo wave gets played louder than the mono wave (+6dB, even though both were normalized to -0.3dB), which may result in clipping. But I can't reproduce having a softer output sound simultaneously....

So part of the problem could be that maybe you've put a stereo wave file on a mono wavetrack?

User avatar
onefang
Established Member
Posts: 148
Joined: Fri Feb 03, 2023 1:17 am
Location: Australia
Has thanked: 67 times
Been thanked: 11 times
Contact:

Re: Volume difference between Jack and Alsa

Post by onefang »

Impostor wrote: Sat Feb 04, 2023 2:30 pm
onefang wrote: Sat Feb 04, 2023 1:37 pm

settings clip even more when I pump up the mixer from the default 0. The actual file isn't clipped.

I just tried it myself:

Made an audio wave, normalized it to -0.3 dB in a wave editor, imported it into a MusE 4.1 wavetrack, and when playing, with the mixer sliders at zero (both the wave and audio out), the maximum level reached is indeed -0.3 dB, both on the wavetrack and the master.

When I mix mono and stereo waves on the same mono channel the stereo wave gets played louder than the mono wave (+6dB, even though both were normalized to -0.3dB), which may result in clipping. But I can't reproduce having a softer output sound simultaneously....

So part of the problem could be that maybe you've put a stereo wave file on a mono wavetrack?

They are both mono, though the project itself is stereo.

I suspect it's 32 bit vs 16 bit. The other .wav files in the song are "32 bit float", the problem vocals one is "signed 16 bit". So it could be that MusE is amplifying the 16 bit to 32 bit for it's meter, which clips, but sending the 16 bit to the sound chip, which thinks the 16 bits are 32 bits, and plays it at half volume. Just a wild guess.

I prefer to be known as a figment of the 'nets imagination, living in the future, waiting for the rest of you to catch up.
Notes from Untalenz, an untalented old muso https://Untalenz.rocks/

User avatar
onefang
Established Member
Posts: 148
Joined: Fri Feb 03, 2023 1:17 am
Location: Australia
Has thanked: 67 times
Been thanked: 11 times
Contact:

Re: Volume difference between Jack and Alsa

Post by onefang »

Soooo I turned the 16 bit mono .wav file into a .flac file, then back into a 32 bit stereo .wav file, and now MusE is playing it properly as a stereo track at the correct volume.

PROGRESS!

Let's see if I can get that data flow to be saner.

It's still playing at lower volume when I use other things like VLC to play via JACK.

I prefer to be known as a figment of the 'nets imagination, living in the future, waiting for the rest of you to catch up.
Notes from Untalenz, an untalented old muso https://Untalenz.rocks/

User avatar
onefang
Established Member
Posts: 148
Joined: Fri Feb 03, 2023 1:17 am
Location: Australia
Has thanked: 67 times
Been thanked: 11 times
Contact:

Re: Volume difference between Jack and Alsa

Post by onefang »

Code: Select all

text2wave -mode singing verse0.xml -f 96000 -eval "(voice_rab_diphone)" -o temp.wav && sox temp.wav -b 32 -c 2 -e floating-point verse0.wav && rm temp.wav

In theory I can avoid the use of temp.wav by telling text2wave to pipe to stdout (which it does), then tell sox to pipe from stdin (which it does), but when I try both at once, it fails. shrug

So that uses Festival's text2wave utility to generate 96000 hz speech in singing mode, using the rab voice, from verse0.xml, which is the lyrics + notes + note duration, then uses sox to convert that to the needed 32 bit floating point stereo verse0.wav file.

I actually wanted to use the higher quality Festival voice_cmu_us_awb_cg voice, but that uses a different encoding that the singing mode pitch changing can't deal with, so no singing, just talking.

Solved my problem at least, dunno if it'll solve the problem of @LocProg . Note that it still plays at lower volume in OTHER file playing programs, but at least it's doing the correct thing for MusE.

I prefer to be known as a figment of the 'nets imagination, living in the future, waiting for the rest of you to catch up.
Notes from Untalenz, an untalented old muso https://Untalenz.rocks/

User avatar
onefang
Established Member
Posts: 148
Joined: Fri Feb 03, 2023 1:17 am
Location: Australia
Has thanked: 67 times
Been thanked: 11 times
Contact:

Re: Volume difference between Jack and Alsa

Post by onefang »

After more experimenting I've come to the conclusion that the sound chips on the motherboard just wont play nice with JACK, but the external Plantronics RIG USB sound card / mini mixer does. I set it to the default JACK device now. So now I don't have to filter the vocal .wav through sox, and all my instruments sound at their proper volume. All my other JACK programs play all the .wav files at the proper volume now.

Now I can actually hear the sub bass instrument I created. B-)

I prefer to be known as a figment of the 'nets imagination, living in the future, waiting for the rest of you to catch up.
Notes from Untalenz, an untalented old muso https://Untalenz.rocks/

Post Reply