LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   noatun and desktop sounds: big delay between picture and sound? (https://www.linuxquestions.org/questions/linux-desktop-74/noatun-and-desktop-sounds-big-delay-between-picture-and-sound-669690/)

lugoteehalt 09-13-2008 09:22 AM

noatun and desktop sounds: big delay between picture and sound?
 
Played a .ogv film on noatun and there was a big delay (?latency) between the picture and the sound: the sound lagged the picture.

This is using arts on KDE.

The desktop noises, such a breaking glass for an error, also grotesqly lag the appearance of the dialog box.

Is alsa really useable if it has this degree of latency?

Does anyone know a way to reduce the latency, preferably to zero? Great thanks any help.

elprawn 09-14-2008 01:15 AM

Edit Please Delete

i92guboj 09-14-2008 01:29 AM

Disable arts completely, and use an external player for system sounds, like "mpg123" or "play".

Unfortunately, I think that noatun depends on arts, so you will need to change the player of choice, I guess.

lugoteehalt 09-15-2008 05:26 AM

Thanks. I don't know if this is going off topic but with analog television on tvtime or kdetv they give no sound but I get some with: sox -c 1 r 32000 -t alsa hw:1 -c 2 -t alsa hw:0 (where c is the number of channels and r is the rate).

If I try to get stereo with c=2 the sound is very distorted the degree of distortion depending on the rate, -r. Incidentally the rate from the tv card should be 48000 according to ?/proc/sound.

'play' is sox isn't it, so presumably no stereo?? But I'd never heard of mpg123 so will try that with joy in my heart.:)

i92guboj 09-16-2008 02:26 AM

Quote:

Originally Posted by lugoteehalt (Post 3280798)
Thanks. I don't know if this is going off topic but with analog television on tvtime or kdetv they give no sound but I get some with: sox -c 1 r 32000 -t alsa hw:1 -c 2 -t alsa hw:0 (where c is the number of channels and r is the rate).

If I try to get stereo with c=2 the sound is very distorted the degree of distortion depending on the rate, -r. Incidentally the rate from the tv card should be 48000 according to ?/proc/sound.

'play' is sox isn't it, so presumably no stereo?? But I'd never heard of mpg123 so will try that with joy in my heart.:)

play is sox, yes. However I never experienced any problem with it to play stereo files or whatever else. I had some problems with distorted sound on via chipsets, long ago (it might have been fixed at driver level by this time, I don't know).

There are a bazillion sound players for command line, so you shouldn't have a problem to find a replacement if sox doesn't suit you. You can always use plain mplayer, that will play almost anything, however it's a bit of an overkill for just system sounds (though they are usually short enough so it will not live long in your ram).

lugoteehalt 09-17-2008 10:04 AM

Tried using 'play' and this worked:
Code:

$ play -c 2 -r 34000 -t ossdsp /dev/dsp1
(The ossdsp gives play access to /dev/dsp. Have alsa installed, not oss; so this is presumably oss emulation.)
So this is giving stereo presumably.

The problem is the latency is *just* adequate or *just* inadequate, depending on how I'm feeling.

There is also the problem that the latency gets worse with time, so that after a few hours the sound lags the vision by a few seconds. Tried to remedy this with speed 1.01 which possibly makes it play 1% faster but this introduces some distortion.

You couldn't suggest a sox replacement could you? I have little experience with sound problems. Perhaps arts or pulseaudio could be used??

Mysteriously my last post has failed to appear.

i92guboj 09-17-2008 11:41 PM

arts or pulseaudio operate on top of alsa. So, if the problem is in alsa, it will still be there. If the problem is your application (sox), then arts/pulseaudio is not going to help you.

By the way, arts has a very bad record in which regards latency. And it has been completely unsupported since many years ago, completely abandoned. I am not sure it's still working on kde 3.5.10, and it is not shipped in kde 4.x at all. It's not the best moment to start using arts, to tell the truth.

Sox is just a command line player, if you want substitutes for it there are lots of small programs to play many file formats, you can use mplayer as well. It really depends on what do you exactly need. Sox has also some editing capabilities, and that's harder to find on a command line tool.

Code:

$ ls /usr/bin/*play*
/usr/bin/aplay            /usr/bin/lavplay    /usr/bin/playSIP
/usr/bin/aplaymidi        /usr/bin/lqtplay    /usr/bin/playsound
/usr/bin/cdda-player      /usr/bin/mplayer    /usr/bin/playsound_simple
/usr/bin/display          /usr/bin/pitchplay  /usr/bin/play_title
/usr/bin/display-buttons  /usr/bin/play      /usr/bin/scriptreplay
/usr/bin/display-coords  /usr/bin/plaympeg  /usr/bin/sndfile-play
/usr/bin/ffplay          /usr/bin/play-q    /usr/bin/yuvplay


lugoteehalt 09-18-2008 01:12 PM

Using the ossdsp ?'pseudo file type' a la play in
Code:

$ play -c 2 -r 34000 -t ossdsp /dev/dsp1
suggested:
Code:

$ sox -q -V -w -s -c 2 -r 32000 -t ossdsp /dev/dsp1 -c 2 -r 44100 -t alsa hw:0
which works and has acceptable latency.

So problem appears to be solved for Peak card 138508AGPK/DVB-T PCI card. Thanks greatly.:)


All times are GMT -5. The time now is 11:32 PM.