LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Delay before audio level changes take effect (https://www.linuxquestions.org/questions/slackware-14/delay-before-audio-level-changes-take-effect-4175436690/)

croftad1 11-11-2012 03:56 PM

Delay before audio level changes take effect
 
In Slackware 14 I'm noticing a perceptible delay between the time the audio volume level is changed and when it takes effect. For example, if I use the mouse scroll wheel to change the volume in Amarok there is a half-second delay and then the audio level jumps to the new setting. I've also noticed that muting a video in SMplayer has a similar but more pronounced effect; there is a delay of up to two seconds before the volume is muted. Changing the volume level via Alsamixer does not cause a delay (that I can perceive). I had been using Slack 13.37 prior to installing Slack 14 fresh and I never noticed this before. Does anyone know a way to address this?

qweasd 11-11-2012 04:39 PM

I have this happening with 14.0 and mplayer.

GasPipe 11-12-2012 01:05 AM

Same here with VLC. When I haven't changed the output module and it was set to default the lag was almost intolerable. Sometimes it froze the video and audio just kept playing. It took about five seconds to change the volume.
Then I tried to change the output module to ALSA audio output and the delay is now tolerable. Not immediate but almost.

I'm using Nvidia HDMI audio and dmix ALSA plugin.

dwblas 11-13-2012 05:36 PM

Audio and video playbacks use a buffer so anything read before the change, i.e anything in the current buffer, would not be affected.

qweasd 11-13-2012 07:42 PM

That figures. It's not that bad, by the way. I totally don't mind it and will probably do nothing to fix it.

croftad1 11-15-2012 08:23 PM

Quote:

Originally Posted by dwblas (Post 4828752)
Audio and video playbacks use a buffer so anything read before the change, i.e anything in the current buffer, would not be affected.

What you're saying makes sense but I don't think it applies here. As I said, with 13.37 I had no such issues. Same hardware, different result. The only thing that's changed is upgrading to 14. I'm not sure what exactly is causing the problem. Playing a mp3 with mpg123 and adjusting volume via alsamixer works as expected. I get instantaneous volume change. It seems like another layer is introducing lag. Amarok is setup to use the gstreamer backend. Could that have any effect? I don't remember how Amarok was configured in 13.37.

GasPipe 01-13-2013 05:14 AM

I think I found a solution.

Well for me VLC audio delay was tolerable but when I tried out Google Play Music service, the audio was stuttering so badly that I couldn't even think of using it. So I dug a little deeper to find a solution.
As I said earlier I'm using Nvidia HDMI audio and ALSA dmix plugin.

My asound.conf file looks like this:
Code:

pcm.dmixer {
  type dmix
  ipc_key 2048
  slave {
    pcm "hw:0,7" # Always use pure hw. dmix will reformat/resample audio.
    period_size 2048 # If you get stuttering/or non-working audio, fiddle around with these
    buffer_size 32768
    rate 48000 # HDMI, I'll assume 48kHz
    format S16_LE # Should be default for pretty much any soundcard.
  }
  bindings {
    0 0
    1 1
  }
}

pcm.!default {
  type plug
  slave.pcm dmixer
}

Of course, this is my config and it likely doesn't work as is to your setup but I bolded the options I changed in order to get it work. Previously they were much smaller.

I hope this helps somebody.


All times are GMT -5. The time now is 11:39 AM.