Author Topic: Scratchy Sound, Pulse Audio & VLC  (Read 2113 times)

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10608
  • MLUs Forever!
Scratchy Sound, Pulse Audio & VLC
« on: June 04, 2012, 04:00:38 AM »
Since moving to   VLC 2.0.1   I have been plagued with scratchy sound at the beginning of most audio files I play with VLC.
I haven't used other players much, so cannot comment on those.

It seems that

Quote
The PulseAudio sound server uses a timer-based audio scheduling instead of the traditional interrupt-driven approach. Timer-based scheduling may expose issues in some ALSA drivers.

I am using  alsa-0.1.25

To 'fix' this problem the timer-based scheduling can be turned off.

I am presently testing this on a user-basis.
To do so I

Copied /etc/pulse/default.pa   to   /home/<user-name>/.pulse/

Then I edited the file in my home directory as follows:

Line 53 reads

Code: [Select]
load-module module-udev-detect
so I changed it to

Code: [Select]
load-module module-udev-detect tsched=0
So far I have not heard the scratchy sound .....  but will report if anything goes amiss.

My reasons for doing it this way is so that I can easily revert the edit as user, or even delete the
/home/<user-name>/.pulse/default.pa
file altogether, without impinging on the PA default settings.

So far so good.
« Last Edit: June 07, 2012, 06:47:14 PM by Just18 »
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Tony

  • Hero Member
  • *****
  • Posts: 1733
  • Reasonable works, ...
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #1 on: June 04, 2012, 11:01:58 AM »
I was reading your other thread about Pulse Audio, thanks for the code and explanation how it works here.

I need to learn some 'Tricks', or good house keeping really.

I use simple systems being kind of new to PCLinuxOS; PA got my interest as you like to talk 'nuts and bolts'. I just use Audacious for Sound, is nice.
Not anything like the complex way you are tying all those processes together with PA; I spent about an hour and a half going through Synaptic this afternoon, and elsewhere; decided I best keep things simple.  :D
*WIKI --PCLinuxOS  is great - remember to Donate ! -- *Software Updates

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10608
  • MLUs Forever!
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #2 on: June 04, 2012, 12:00:36 PM »
Abraxas,
               it is only when something goes wrong or there is something we need and cannot find, that things like the above post come into their own.

Regarding Audacity .....  I consider it a good audio editor, but I have no need to edit audio files very often, so I rarely use it.
For other audio needs I use different applications.

Most of all have fun!  :D

A 'throw-away' install for playing with things is a great way to get the most out of it.
If that can be done using VBox, even better.

regards
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #3 on: June 04, 2012, 03:01:11 PM »

Since moving to   VLC 2.0.1   I have been plagued with scratchy sound at the beginning of most audio files I play with VLC.


Hey, Just18. Using VLC 2.0.1 here, as well as alsa-0.1.25.

alsaconf-1.0.25-1pclos2012
alsa-utils-1.0.25-1pclos2012
libalsa-data-1.0.25-2pclos2012

I've listened to a few songs I have, trying to hear that scratch at the beginning. So far, no luck. However, I should note that I don't use pulseaudio at all. Could that have something to do with it, apart from VLC?
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10608
  • MLUs Forever!
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #4 on: June 04, 2012, 03:17:16 PM »

Since moving to   VLC 2.0.1   I have been plagued with scratchy sound at the beginning of most audio files I play with VLC.


Hey, Just18. Using VLC 2.0.1 here, as well as alsa-0.1.25.

alsaconf-1.0.25-1pclos2012
alsa-utils-1.0.25-1pclos2012
libalsa-data-1.0.25-2pclos2012

I've listened to a few songs I have, trying to hear that scratch at the beginning. So far, no luck. However, I should note that I don't use pulseaudio at all. Could that have something to do with it, apart from VLC?


Yes it is definitely PulseAudio and it seems the problem is exposed by the manner in which VLC 2.0 addresses it. It was not present with VLC 1.13 (?) nor was it present with PA turned off with the present setup.

The 'fix' I posted stops PA from using the timer-based scheduling and all is OK here, - so far anyway.

Since I posted I have not heard any of the scratchy sound, and have been using it extensively.

I should point out this scratchiness was only present at the beginning of a 'play' ....  it disappeared after a few seconds.

Also it is likely to be hardware dependent too.

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Online daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3731
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #5 on: June 04, 2012, 03:22:31 PM »
i set vlc of audio hardware output, this works very well...
No delay, no scratchy, only perfect...  :)

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #6 on: June 04, 2012, 03:22:53 PM »

I should point out this scratchiness was only present at the beginning of a 'play' ....  it disappeared after a few seconds.


I caught that. But I completely missed:


The 'fix' I posted stops PA from using the timer-based scheduling and all is OK here, - so far anyway.


Cue "These Eyes".  ::) ;)
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10608
  • MLUs Forever!
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #7 on: June 04, 2012, 03:37:23 PM »
;)

:D
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6371
  • I'm going South
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #8 on: June 04, 2012, 04:12:53 PM »
Just18, I found you fix or workaround very useful.

I'd tried to get rid of the scratchy sound by changing the sound levels in different programs, always thinking that it would be nice if one didn't have to lower any sound channel so much that one didn't hear what people said -- even at the very beginning of video clips. So far your fix appears to work here.

 
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10608
  • MLUs Forever!
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #9 on: June 04, 2012, 05:06:23 PM »
Just18, I found you fix or workaround very useful.

I'd tried to get rid of the scratchy sound by changing the sound levels in different programs, always thinking that it would be nice if one didn't have to lower any sound channel so much that one didn't hear what people said -- even at the very beginning of video clips. So far your fix appears to work here.

 

Thanks BB ....  glad to know
1) I am not the only one to experience the problem
and
2) that the 'fix' worked for you  ;)

So far so good here too .....  if anything changes please let us know.

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Tony

  • Hero Member
  • *****
  • Posts: 1733
  • Reasonable works, ...
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #10 on: June 04, 2012, 08:22:45 PM »
Posted by:Just18-
Quote
Regarding Audacity .....  I consider it a good audio editor, but I have no need to edit audio files very often, so I rarely use it.
For other audio needs I use different applications.
They do sound very similar.  :D

Posted by: Abraxas-
Quote
I just use Audacious for Sound, is nice.

Great Tip, and positive feedback; VLC 2.0.1 along with PulseAudio are sounding  good it seems.  ;)


*WIKI --PCLinuxOS  is great - remember to Donate ! -- *Software Updates

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10608
  • MLUs Forever!
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #11 on: June 05, 2012, 04:08:55 AM »
i set vlc of audio hardware output, this works very well...
No delay, no scratchy, only perfect...  :)

Thanks for the report.

As mentioned, the problem is likely to be hardware dependent.  ;)
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10608
  • MLUs Forever!
Re: Scratchy Sound, Pulse Audio & VLC
« Reply #12 on: June 07, 2012, 04:09:24 AM »
Posted by:Just18-
Quote
Regarding Audacity .....  I consider it a good audio editor, but I have no need to edit audio files very often, so I rarely use it.
For other audio needs I use different applications.
They do sound very similar.  :D

Posted by: Abraxas-
Quote
I just use Audacious for Sound, is nice.

Great Tip, and positive feedback; VLC 2.0.1 along with PulseAudio are sounding  good it seems.  ;)


Oops  :D   I don't use Audacious either  ;D

Mostly I use VLC these days ......... one app for almost all things media.  ;)

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT