Re: Audio probles like, slow response in applications that use audio

2015-03-07 Thread Henrique Lengler
On Fri, Mar 06, 2015 at 09:07:40PM +0100, Alexandre Ratchov wrote:
 Yes we have modifications. Back around 2008, audio used to be very
 unsable on MP systems and sndiod used to run with lower priority.
 So using large buffers (around 500ms) was the only way to get
 stable audio.
 
 Nowadays, this is not necessary, but buffer sizes are still big
 because nobody tryed to reduce them. Maybe it's time now. Properly
 written software could probably work with 50ms buffers.
 
 Still I'm talking about 500ms. Not the 1-2s you mentioned, which I
 need to understand.
 
 Could you do the following: in one window, kill sndiod and start a
 new one as follows:
 
 sudo pkill sndiod
 SNDIO_DEBUG=4 sndiod -ddd 2/tmp/log
 
 in another window:
 
 mplayer /foo/bar.mp3
 
 after few seconds, push the right arrow key to skip forward, wait
 few seconds, press q, kill sndiod and send me the /tmp/log file.
 
 When you hit the right arrow key, mplayer is supposed to take 500ms
 to react, but on your setup it takes 1-2s, right?
 
 The file is huge, so please send it off-list.

I attached the file
-- 
Regards

Henrique Lengler 
snd0 pst=cfg.default: rec=0:1 play=0:1 vol=23170 dup
listen(/tmp/aucat-1000/aucat0|ini): created
sock(sock|ini): created
sock,rmsg,widl: AUTH message
sio_sun_setpar: 0: trying pars = 48000/16/6
sio_sun_setpar: bpf = (4, 4)
sio_sun_setpar: 0: trying round = 600 - (576, 576)
sio_sun_setpar: blocksize ok
sio_sun_setpar: 0: trying pars = 48000/16/6
sio_sun_setpar: bpf = (4, 4)
sio_sun_setpar: 0: trying round = 960 - (960, 960)
sio_sun_setpar: blocksize ok
sock,rmsg,widl: HELLO message
sock,rmsg,widl: hello from mplayer, mode = 1, ver 7
sock,rmsg,widl: using snd0 pst=cfg.default, mode = 1
mplayer0: overwritten slot 0
snd0 pst=cfg: device requested
sio(rsnd/0|ini): created
snd0 pst=ini: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
mplayer0 vol=127,pst=ini,mmc=off,rmsg,widl: SETPAR message
mplayer0 vol=127,pst=ini,mmc=off,rmsg,widl: playback channels 0:1 - 0:1
mplayer0 vol=127,pst=ini,mmc=off,rmsg,widl: 44100Hz sample rate, 882 frame 
blocks
mplayer0 vol=127,pst=ini,mmc=off,rmsg,widl: 11466 frame buffer
mplayer0 vol=127,pst=ini,mmc=off,rmsg,widl: GETPAR message
mplayer0 vol=127,pst=ini,mmc=off,rmsg,widl: GETPAR message
mplayer0 vol=127,pst=ini,mmc=off,rmsg,widl: START message
mplayer0 vol=127,pst=ini,mmc=off: playing s32le - s16le
mplayer0 vol=127,pst=ini,mmc=off: allocated 11466/19404 fr buffers
mplayer0 vol=127,pst=sta,mmc=off: 44100Hz, s32le, play 0:1, 13 blocks of 882 
frames
mplayer0 vol=127,pst=sta,mmc=off,rmsg,widl: building SETVOL message, vol = 127
snd0 pst=ini: device started
snd0 pst=run: started
mplayer0 vol=127,pst=run,mmc=off: attached at -7938, delta = 0
cmap: nch = 2, ostart = 0, onext = 0, istart = 0, inext = 0
dec: s32le, 2 channels
resamp: 882/960
mplayer0 vol=127,pst=run,mmc=off: set weight: 23170/23170
12083: sio_revents: revents = 0x4, took 1537ns
35969: sio_revents: revents = 0x4, took 1257ns
47213: sio_revents: revents = 0x4, took 1257ns
57410: sio_revents: revents = 0x4, took 1257ns
67746: sio_revents: revents = 0x4, took 1258ns
78223: sio_revents: revents = 0x4, took 1187ns
95893: sio_revents: revents = 0x4, took 1257ns
000106788: sio_revents: revents = 0x4, took 1187ns
000117194: sio_revents: revents = 0x4, took 1187ns
0849340: clk+0   +0, wr+8   +0 rd:+0   +0
00020857890: clk+1   +0, wr+9   +0 rd:+0   +0
020856284: sio_revents: revents = 0x1, took 4330ns
020903706: sio_revents: revents = 0x0, took 1327ns
020928570: sio_revents: revents = 0x0, took 1327ns
00040880828: clk+2   +0, wr   +10   +0 rd:+1   +0
040879291: sio_revents: revents = 0x1, took 5238ns
040912396: sio_revents: revents = 0x0, took 1257ns
040932370: sio_revents: revents = 0x0, took 1258ns
00060857879: clk+3   +0, wr   +11   +0 rd:+2   +0
060856343: sio_revents: revents = 0x1, took 5098ns
060889308: sio_revents: revents = 0x0, took 1257ns
060908304: sio_revents: revents = 0x0, took 1258ns
00080882842: clk+4   +0, wr   +12   +0 rd:+3   +0
080881515: sio_revents: revents = 0x1, took 3422ns
080911756: sio_revents: revents = 0x0, took 1257ns
080928937: sio_revents: revents = 0x0, took 1257ns
00100857728: clk+5   +0, wr   +13   +0 rd:+4   +0
100856401: sio_revents: revents = 0x1, took 3492ns
100886852: sio_revents: revents = 0x0, took 1327ns
100904312: sio_revents: revents = 0x0, took 1327ns
00120890024: clk+6   +0, wr   +14   +0 rd:+5   +0
120888697: sio_revents: revents = 0x1, took 3353ns
120918799: sio_revents: revents = 0x0, took 1187ns
120935770: sio_revents: revents = 0x0, took 1257ns
00140857647: clk+7   +0, wr   +15   +0 rd:+6   +0
140856250: sio_revents: revents = 0x1, took 4051ns
140888238: sio_revents: revents = 0x0, took 1187ns
140905838: sio_revents: revents = 0x0, took 1257ns
00160902165: clk+8   +0, wr   +16   +0 rd:+7   +0
160900908: sio_revents: revents = 0x1, took 3353ns
160931219: 

Re: Audio probles like, slow response in applications that use audio

2015-03-06 Thread Henrique Lengler
On Fri, Mar 06, 2015 at 09:06:00AM +0100, Alexandre Ratchov wrote:
  Also please remeber that the audio is synchronized, the lag is when I want 
  to advance the video.
 
 I still don't 100% understand whether you observe an audio
 subsystem bug (500ms latency), or you just dislike the default
 latency.

This can't be a feature (right?), since I already use all these apps in
this same computer under linux, and they ran very fast.

To remeber:
The behaviour that mplayer and cmus, are having, is operate with a
delay. Any change in the audio play, like advance in the audio/video, or stop
playing it, takes a time to happen.

For example when I am in these apps and I click pause buttom, it takes a
time like 1~2 seconds to respond. And If I click more than one time, it 
lags even more.

 If you don't like the 200-400ms latency (too conservative imo), you
 could lower sndiod buffer size, possibly patch mplayer, cmus or
 whatever to use smaller buffers as well, post diffs on ports@ and
 if this hurts no MP kernel users we'll change the defaults. This
 would improve everybody's setup.

I already changed the buffer, and it didn't solved, as you can see here:
http://marc.info/?l=openbsd-miscm=142368103115408w=2
This page have some usefull informations.

About change the application buffers, never tried, but if these apps
worked on Linux, it should work here right, or maybe the OBSD version
have some modification.

 Let me know if you need help for this.
 
 Browsers are a different story. They use a huge amount of code with
 complex interaction that makes simple things complicated to debug.
 I'd suggest to first make work mplayer, cmus  friends.

I totally agree, lets focus on simples tools first.

-- 
Regards

Henrique Lengler 



Re: Audio probles like, slow response in applications that use audio

2015-03-06 Thread Alexandre Ratchov
On Fri, Mar 06, 2015 at 04:24:53PM -0300, Henrique Lengler wrote:
 On Fri, Mar 06, 2015 at 09:06:00AM +0100, Alexandre Ratchov wrote:
   Also please remeber that the audio is synchronized, the lag is when I 
   want 
   to advance the video.
  
  I still don't 100% understand whether you observe an audio
  subsystem bug (500ms latency), or you just dislike the default
  latency.
 
 This can't be a feature (right?), since I already use all these apps in
 this same computer under linux, and they ran very fast.
 
 To remeber:
 The behaviour that mplayer and cmus, are having, is operate with a
 delay. Any change in the audio play, like advance in the audio/video, or stop
 playing it, takes a time to happen.
 
 For example when I am in these apps and I click pause buttom, it takes a
 time like 1~2 seconds to respond. And If I click more than one time, it 
 lags even more.

1-2 seconds is a bug. I couldn't reproduce it, unfortunately. On my
box the default setup (same parameters as yours, same device) the
lang is at most 500ms, as expected. IMO 500ms is too much nowadays,
but before questioning it, we must fix your box to not lag 1-2s,
which I consider a bug.

  If you don't like the 200-400ms latency (too conservative imo), you
  could lower sndiod buffer size, possibly patch mplayer, cmus or
  whatever to use smaller buffers as well, post diffs on ports@ and
  if this hurts no MP kernel users we'll change the defaults. This
  would improve everybody's setup.
 
 I already changed the buffer, and it didn't solved, as you can see here:
 http://marc.info/?l=openbsd-miscm=142368103115408w=2
 This page have some usefull informations.
 
 About change the application buffers, never tried, but if these apps
 worked on Linux, it should work here right, or maybe the OBSD version
 have some modification.

Yes we have modifications. Back around 2008, audio used to be very
unsable on MP systems and sndiod used to run with lower priority.
So using large buffers (around 500ms) was the only way to get
stable audio.

Nowadays, this is not necessary, but buffer sizes are still big
because nobody tryed to reduce them. Maybe it's time now. Properly
written software could probably work with 50ms buffers.

Still I'm talking about 500ms. Not the 1-2s you mentioned, which I
need to understand.

Could you do the following: in one window, kill sndiod and start a
new one as follows:

sudo pkill sndiod
SNDIO_DEBUG=4 sndiod -ddd 2/tmp/log

in another window:

mplayer /foo/bar.mp3

after few seconds, push the right arrow key to skip forward, wait
few seconds, press q, kill sndiod and send me the /tmp/log file.

When you hit the right arrow key, mplayer is supposed to take 500ms
to react, but on your setup it takes 1-2s, right?

The file is huge, so please send it off-list.

Thanks

-- Alexandre



Re: Audio probles like, slow response in applications that use audio

2015-03-06 Thread Alexandre Ratchov
On Thu, Mar 05, 2015 at 02:42:11PM -0300, Henrique Lengler wrote:
 
 On Thu, Mar 05, 2015 at 01:45:57PM +0100, Alexandre Ratchov wrote:
  Let's first fix system-related audio problems (as programs depend
  on it). Once we're sure audio works well, then we can try to debug
  browsers which are known to not work well yet in all cases.
  
  mplayer is known to work; it has a small lag (iirc, less than
  500ms, depends on the setup) which is somewhat acceptable. Could
  you confirm at least this works on -current as expected?
 
 No, still the same thing. mplayer, cmus and html5 video in any browser 
 (firefox, chromium, webkitbased), are with lag in my system.
 Also please remeber that the audio is synchronized, the lag is when I want 
 to advance the video.

I still don't 100% understand whether you observe an audio
subsystem bug (500ms latency), or you just dislike the default
latency.

If you don't like the 200-400ms latency (too conservative imo), you
could lower sndiod buffer size, possibly patch mplayer, cmus or
whatever to use smaller buffers as well, post diffs on ports@ and
if this hurts no MP kernel users we'll change the defaults. This
would improve everybody's setup.

Let me know if you need help for this.

Browsers are a different story. They use a huge amount of code with
complex interaction that makes simple things complicated to debug.
I'd suggest to first make work mplayer, cmus  friends.



Re: Audio probles like, slow response in applications that use audio

2015-03-05 Thread Henrique Lengler
On Thu, Mar 05, 2015 at 03:59:37PM +0100, Dmitrij D. Czarkoff wrote:
Hi, Dimitrij, I am using some software from your port (ratox).

 If the performance issue depends on video resolution, most likely you
 experience problems with hardware graphics acceleration.
To me looks like the audio is causing lag on video, since, the problem
happens with cmus too.

 Do other GStreamer-based programs play the same videos fine?  What about
 non-Gstreamer software, eg. ffplay from ffmpeg?
As I said, ffplay is the only one I found that works well, when using it, I 
see no lag, even with HD videos.

On Thu, Mar 05, 2015 at 01:45:57PM +0100, Alexandre Ratchov wrote:
 Let's first fix system-related audio problems (as programs depend
 on it). Once we're sure audio works well, then we can try to debug
 browsers which are known to not work well yet in all cases.
 
 mplayer is known to work; it has a small lag (iirc, less than
 500ms, depends on the setup) which is somewhat acceptable. Could
 you confirm at least this works on -current as expected?

No, still the same thing. mplayer, cmus and html5 video in any browser 
(firefox, chromium, webkitbased), are with lag in my system.
Also please remeber that the audio is synchronized, the lag is when I want 
to advance the video.

-- 
Regards

Henrique Lengler 



Re: Audio probles like, slow response in applications that use audio

2015-03-05 Thread Alexandre Ratchov
On Wed, Mar 04, 2015 at 06:59:43PM -0300, Henrique Lengler wrote:
 Hi,
 
 Updating the situation, I already used -stable, and I am using now
 -current, and still the problem.
 I tried some browsers like (firefox, midori and chromium), and they get
 really slow when I am watching a html5 video, and it freezes all the
 time if the video is in HD.
 
 Here is almost all the problem
 information:http://marc.info/?l=openbsd-miscm=142385651303855w=2 

Let's first fix system-related audio problems (as programs depend
on it). Once we're sure audio works well, then we can try to debug
browsers which are known to not work well yet in all cases.

mplayer is known to work; it has a small lag (iirc, less than
500ms, depends on the setup) which is somewhat acceptable. Could
you confirm at least this works on -current as expected?



Re: Audio probles like, slow response in applications that use audio

2015-03-05 Thread Dmitrij D. Czarkoff
Henrique Lengler said:
 I tried some browsers like (firefox, midori and chromium), and they get
 really slow when I am watching a html5 video, and it freezes all the
 time if the video is in HD.

If the performance issue depends on video resolution, most likely you
experience problems with hardware graphics acceleration.

Do other GStreamer-based programs play the same videos fine?  What about
non-Gstreamer software, eg. ffplay from ffmpeg?

-- 
Dmitrij D. Czarkoff



Re: Audio probles like, slow response in applications that use audio

2015-03-04 Thread Henrique Lengler
Hi,

Updating the situation, I already used -stable, and I am using now
-current, and still the problem.
I tried some browsers like (firefox, midori and chromium), and they get
really slow when I am watching a html5 video, and it freezes all the
time if the video is in HD.

Here is almost all the problem
information:http://marc.info/?l=openbsd-miscm=142385651303855w=2 

-- 
Regards

Henrique Lengler 



Re: Audio probles like, slow response in applications that use audio and a little noise in the background

2015-02-13 Thread Alexandre Ratchov
On Fri, Feb 13, 2015 at 02:47:51AM -0200, Henrique Lengler wrote:
 Hi, Just an update.
 I continue with the lag. So I decided to try other players, and I discovered 
 that ffplay from ffmpeg don't lag, this is the only one I found that works, 
 with
 both audio and video. But the problem isn't solved yet since I like cmus and 
 mplayer and I wanna use them. This is really strange, why this could happen?

One second lag is cleary a bug. Could you get this file:

http://caoua.org/tmp/beep.wav

and test the lag with this command:

aucat -i beep.wav

The lag is supposed to be of 0.2 seconds. To debug this, you could
kill sndiod, run tmux and start:

sudo sndiod -dd your_options_if_any

Then, when you start a program it displays information about what
programs do, example:

mplayer0: 48000Hz, s32le, play 0:1, 13 blocks of 960 frames
mplayer0: attached at -7680, delta = 0

which allows to calculate the expected lag:

13 * 960 / 48000 = 0.26 seconds of lag

Do you see any warning messages?

[...]

Whenever the device starts, sndiod displays:

snd0: device started

when you observe the lag, does above message appear delayed as
well?

If you let:

aucat -i /dev/zero

running, do cmus and mplayer keep lagging?

-- Alexandre



Re: Audio probles like, slow response in applications that use audio and a little noise in the background

2015-02-13 Thread Henrique Lengler
On Fri, Feb 13, 2015 at 09:59:47AM +0100, Alexandre Ratchov wrote:
 One second lag is cleary a bug. Could you get this file:
 
   http://caoua.org/tmp/beep.wav
 
 and test the lag with this command:
 
   aucat -i beep.wav
 
 The lag is supposed to be of 0.2 seconds. To debug this, you could
 kill sndiod, run tmux and start:
 
   sudo sndiod -dd your_options_if_any
 
 Then, when you start a program it displays information about what
 programs do, example:
 
   mplayer0: 48000Hz, s32le, play 0:1, 13 blocks of 960 frames
   mplayer0: attached at -7680, delta = 0
 
 which allows to calculate the expected lag:
 
   13 * 960 / 48000 = 0.26 seconds of lag

When I do aucat -i beep.wav, this is what I receive:

# sndiod -dd
snd0.default: rec=0:1 play=0:1 vol=23170 dup
snd0: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
aucat0: 48000Hz, s16le, play 0:0, 8 blocks of 960 frames
snd0: device started
aucat0: attached at -8640, delta = 0
snd0: device stopped

8 * 960 / 48000 = 0.16, this mean it have no lag, strange.

 Do you see any warning messages?

No.

 Whenever the device starts, sndiod displays:
 
   snd0: device started
 
 when you observe the lag, does above message appear delayed as
 well?

When I start mplayer, cmus, aucat, the first message appear instatly. But the 
others 
that I received during execution come delayed.

For example in mplayer the audio looks synchronize with the video, the delay 
comes when 
I click, for example, in the arrow to jump on the audio/music.

**This is the mplayer output when I start it:

snd0.default: rec=0:1 play=0:1 vol=23170 dup
snd0: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
mplayer0: 44100Hz, s32le, play 0:1, 13 blocks of 882 frames
snd0: device started
mplayer0: attached at -7938, delta = 0
** And it stay playing, when I click the arrow key, I receive this two messages 
with 
the delay.
mplayer0: 44100Hz, s32le, play 0:1, 13 blocks of 882 frames
mplayer0: attached at -7938, delta = 0
** So I press quit, mplay quit in the same time, but the audio still playing 
for a while.
And I receive this one with the same delay
snd0: device stopped

In ffplay, that don't lag, this is the messages I get:

# sndiod -dd
snd0.default: rec=0:1 play=0:1 vol=23170 dup
snd0: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
snd0: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
ffplay0: 44100Hz, s16le, play 0:1, 2 blocks of 882 frames
snd0: device started
ffplay0: attached at -7938, delta = 0
snd0: device stopped

In ffplay, I don't receive any message if I advance the video, and the message
of device stopped come instatly.

First thing I can see is that:
2 * 882 / 44100 = 0.04 - the value is lower

But looks this isn't the problem, the audio in mplayer is synchronized with the 
video, 
the lag only happens when I advance or quit the app.

 If you let:
 
   aucat -i /dev/zero
 
 running, do cmus and mplayer keep lagging?

Yes, everything continue behaving as before. 

-- 
Regards

Henrique Lengler 



Re: Audio probles like, slow response in applications that use audio and a little noise in the background

2015-02-12 Thread Henrique Lengler
Hi, Just an update.
I continue with the lag. So I decided to try other players, and I discovered 
that ffplay from ffmpeg don't lag, this is the only one I found that works, with
both audio and video. But the problem isn't solved yet since I like cmus and 
mplayer and I wanna use them. This is really strange, why this could happen?

Audio lag in html5, mplayer and cmus, but workin on ffplay?

I need help

On Wed, Feb 11, 2015 at 04:54:54PM -0200, Henrique Lengler wrote:
 First thanks for helping!
 
 On Wed, Feb 11, 2015 at 09:29:04AM +0100, Alexandre Ratchov wrote:
  the noise might be caused by a noisy microphone amp (even if
  there's no microphone plugged). By mutting the microphoe, the noise
  may disappear. Could you post the output of mixerctl -a ?
 
 Thanks, first problem solved, I did $ mixerctl inputs.mic=0,0 and the noise
 stoped.
 
 /* mixerctl -a */
 
 inputs.dac-0:1=108,108
 inputs.dac-2:3=126,126
 inputs.dac-4:5=126,126
 inputs.dac-6:7=108,108
 record.adc-0:1_mute=off
 record.adc-0:1=125,125
 record.adc-2:3_mute=off
 record.adc-2:3=125,125
 inputs.mix_source=mic,mic2,line-in,hp,line
 inputs.mix_mic=120,120
 inputs.mix_mic2=120,120
 inputs.mix_line-in=120,120
 inputs.mix_hp=120,120
 inputs.mix_line=120,120
 inputs.mix2_source=dac-0:1,mix
 inputs.mix3_source=dac-2:3,mix
 inputs.mix4_source=dac-4:5,mix
 inputs.mix5_source=dac-6:7,mix
 outputs.SPDIF_source=dig-dac-0:1
 outputs.line_source=mix2
 outputs.line_mute=off
 outputs.line_dir=output
 outputs.line_boost=off
 outputs.line_eapd=on
 outputs.mic_source=mix3
 outputs.mic_mute=on
 inputs.mic=0,0
 outputs.mic_dir=input-vr80
 outputs.mic2_source=mix8
 outputs.mic2_mute=off
 inputs.mic2=85,85
 outputs.mic2_dir=input-vr80
 outputs.mic2_boost=off
 outputs.line-in_source=mix4
 outputs.line-in_mute=off
 inputs.line-in=85,85
 outputs.line-in_dir=input
 outputs.hp_source=mix5
 outputs.hp_mute=off
 inputs.hp=85,85
 outputs.hp_dir=output
 outputs.hp_boost=off
 outputs.hp_eapd=on
 record.adc-2:3_source=mic,mic2,line-in,hp,line,mix
 record.adc-0:1_source=mic,mic2,line-in,hp,line,mix
 inputs.dac-8:9=126,126
 inputs.mix8_source=dac-8:9,mix
 outputs.line_sense=plugged
 outputs.mic_sense=unplugged
 outputs.mic2_sense=unplugged
 outputs.line-in_sense=unplugged
 outputs.hp_sense=unplugged
 outputs.master=110,110
 outputs.master.mute=off
 outputs.master.slaves=dac-0:1,dac-6:7,line,hp
 record.volume=125,125
 record.volume.mute=off
 record.volume.slaves=adc-0:1,adc-2:3
 outputs.mode=analog
 
   I installed cmus, copied some musics to my disk and started to listen. 
   It plays normally, but when I click the arrows to advance in the music, I 
   noticed it have a delay, and it lags if I click like 3 times to advance.
And if click to close the application, the application close in the same 
   time, 
   but the audio stay playing for a while.
   
   The next thing is mplayer, It lag to advance the video (as cmus), but 
   it don't stay playing when I click close.
  
  How long is the lag?
 
 It's about 1.5 - 2 seconds. This really sucks I need to advance the music and 
 click more than once.
 
  By default the buffer size is large which causes around 0.2 second
  of extra lag but makes audio stable (this is to allow audio to
  kinda work on busy or on MP systems). You could try to use smaller
  buffers, for instance add:
  
  sndiod_flags=-z 480
  
  to /etc/rc.conf.local and restart sndiod with:
  
  /etc/rc.d/sndiod restart
 
 This didn't solved, maybe the audio is a little faster, but continue more 
 than 1 sec of delay.
 
 -- 
 Regards
 
 Henrique Lengler 
 

-- 
Regards

Henrique Lengler 



Re: Audio probles like, slow response in applications that use audio and a little noise in the background

2015-02-11 Thread Henrique Lengler
First thanks for helping!

On Wed, Feb 11, 2015 at 09:29:04AM +0100, Alexandre Ratchov wrote:
 the noise might be caused by a noisy microphone amp (even if
 there's no microphone plugged). By mutting the microphoe, the noise
 may disappear. Could you post the output of mixerctl -a ?

Thanks, first problem solved, I did $ mixerctl inputs.mic=0,0 and the noise
stoped.

/* mixerctl -a */

inputs.dac-0:1=108,108
inputs.dac-2:3=126,126
inputs.dac-4:5=126,126
inputs.dac-6:7=108,108
record.adc-0:1_mute=off
record.adc-0:1=125,125
record.adc-2:3_mute=off
record.adc-2:3=125,125
inputs.mix_source=mic,mic2,line-in,hp,line
inputs.mix_mic=120,120
inputs.mix_mic2=120,120
inputs.mix_line-in=120,120
inputs.mix_hp=120,120
inputs.mix_line=120,120
inputs.mix2_source=dac-0:1,mix
inputs.mix3_source=dac-2:3,mix
inputs.mix4_source=dac-4:5,mix
inputs.mix5_source=dac-6:7,mix
outputs.SPDIF_source=dig-dac-0:1
outputs.line_source=mix2
outputs.line_mute=off
outputs.line_dir=output
outputs.line_boost=off
outputs.line_eapd=on
outputs.mic_source=mix3
outputs.mic_mute=on
inputs.mic=0,0
outputs.mic_dir=input-vr80
outputs.mic2_source=mix8
outputs.mic2_mute=off
inputs.mic2=85,85
outputs.mic2_dir=input-vr80
outputs.mic2_boost=off
outputs.line-in_source=mix4
outputs.line-in_mute=off
inputs.line-in=85,85
outputs.line-in_dir=input
outputs.hp_source=mix5
outputs.hp_mute=off
inputs.hp=85,85
outputs.hp_dir=output
outputs.hp_boost=off
outputs.hp_eapd=on
record.adc-2:3_source=mic,mic2,line-in,hp,line,mix
record.adc-0:1_source=mic,mic2,line-in,hp,line,mix
inputs.dac-8:9=126,126
inputs.mix8_source=dac-8:9,mix
outputs.line_sense=plugged
outputs.mic_sense=unplugged
outputs.mic2_sense=unplugged
outputs.line-in_sense=unplugged
outputs.hp_sense=unplugged
outputs.master=110,110
outputs.master.mute=off
outputs.master.slaves=dac-0:1,dac-6:7,line,hp
record.volume=125,125
record.volume.mute=off
record.volume.slaves=adc-0:1,adc-2:3
outputs.mode=analog

  I installed cmus, copied some musics to my disk and started to listen. 
  It plays normally, but when I click the arrows to advance in the music, I 
  noticed it have a delay, and it lags if I click like 3 times to advance.
   And if click to close the application, the application close in the same 
  time, 
  but the audio stay playing for a while.
  
  The next thing is mplayer, It lag to advance the video (as cmus), but 
  it don't stay playing when I click close.
 
 How long is the lag?

It's about 1.5 - 2 seconds. This really sucks I need to advance the music and 
click more than once.

 By default the buffer size is large which causes around 0.2 second
 of extra lag but makes audio stable (this is to allow audio to
 kinda work on busy or on MP systems). You could try to use smaller
 buffers, for instance add:
 
 sndiod_flags=-z 480
 
 to /etc/rc.conf.local and restart sndiod with:
 
 /etc/rc.d/sndiod restart

This didn't solved, maybe the audio is a little faster, but continue more 
than 1 sec of delay.

-- 
Regards

Henrique Lengler 



Re: Audio probles like, slow response in applications that use audio and a little noise in the background

2015-02-11 Thread Alexandre Ratchov
On Wed, Feb 11, 2015 at 02:27:32AM -0200, Henrique Lengler wrote:
 
 Hi,
 
 I'm new in OpenBSD (I'm loving it), I came from Linux. I installed the 
 last (5.6) version, and I started to use, without doing any change in 
 audio settings.
 
 The first thing I noticed while computing at night, is a little 
 noise in the background, it is very low, but it exist and bothers me, its 
 more like a television sound when it don't have signali, but very low. 
 

the noise might be caused by a noisy microphone amp (even if
there's no microphone plugged). By mutting the microphoe, the noise
may disappear. Could you post the output of mixerctl -a ?

 I checked if the problem wasn't the earphone, but It worked fine 
 plugged in a windows notebook, and I was using it in Linux in this computer 
 around 2 days ago, its also not eletric problem, because it don't sounds like 
 one, my computer never had this and it don't stop if I put my hands on it.
   
 I installed cmus, copied some musics to my disk and started to listen. 
 It plays normally, but when I click the arrows to advance in the music, I 
 noticed it have a delay, and it lags if I click like 3 times to advance.
  And if click to close the application, the application close in the same 
 time, 
 but the audio stay playing for a while.
 
 The next thing is mplayer, It lag to advance the video (as cmus), but 
 it don't stay playing when I click close.

How long is the lag?

By default the buffer size is large which causes around 0.2 second
of extra lag but makes audio stable (this is to allow audio to
kinda work on busy or on MP systems). You could try to use smaller
buffers, for instance add:

sndiod_flags=-z 480

to /etc/rc.conf.local and restart sndiod with:

/etc/rc.d/sndiod restart

but I don't recommend this unless your system stays idle.

 The last similar problem happens when I am playing a html5 video and I pause 
 or it stops to load, the audio gets desynchronized. So I need to click in a 
 part of the timeline to get it working again.
 

probably the player code is wrong, this can't be fixed by tweaking
the config, sorry.

-- Alexandre



Audio probles like, slow response in applications that use audio and a little noise in the background

2015-02-10 Thread Henrique Lengler

Hi,

I'm new in OpenBSD (I'm loving it), I came from Linux. I installed the 
last (5.6) version, and I started to use, without doing any change in 
audio settings.

The first thing I noticed while computing at night, is a little 
noise in the background, it is very low, but it exist and bothers me, its 
more like a television sound when it don't have signali, but very low. 

I checked if the problem wasn't the earphone, but It worked fine 
plugged in a windows notebook, and I was using it in Linux in this computer 
around 2 days ago, its also not eletric problem, because it don't sounds like 
one, my computer never had this and it don't stop if I put my hands on it.
  
I installed cmus, copied some musics to my disk and started to listen. 
It plays normally, but when I click the arrows to advance in the music, I 
noticed it have a delay, and it lags if I click like 3 times to advance.
 And if click to close the application, the application close in the same time, 
but the audio stay playing for a while.

The next thing is mplayer, It lag to advance the video (as cmus), but 
it don't stay playing when I click close.

The last similar problem happens when I am playing a html5 video and I pause 
or it stops to load, the audio gets desynchronized. So I need to click in a 
part of the timeline to get it working again.

All these errors happens on the console too.

My keyboard normal keys have no lag in Xorg (I have lag problems in 
Caps/Num/Scroll 
Lock keys under X, but this is for another post).

** Now the hardware/software info: **
My motherboard is a ASUS Z87-K, the official site 
says it have an Realtek ALC887 8-Channel High 
Definition Audio CODEC *2 audio device.
In Linux, it uses the snd-hda-intel module.

* The pcidump output:
Domain /dev/pci0:
 0:0:0: Intel Core 4G Host
 0:1:0: Intel Core 4G PCIE
 0:2:0: Intel HD Graphics 4600
 0:3:0: Intel Core 4G HD Audio
 0:20:0: Intel 8 Series xHCI
 0:22:0: Intel 8 Series MEI
 0:26:0: Intel 8 Series USB
 0:27:0: Intel 8 Series HD Audio
 0:28:0: Intel 8 Series PCIE
 0:28:2: Intel 8 Series PCIE
 0:28:3: Intel 82801BA Hub-to-PCI
 0:29:0: Intel 8 Series USB
 0:31:0: Intel Z87 LPC
 0:31:2: Intel 8 Series AHCI
 0:31:3: Intel 8 Series SMBus
 3:0:0: Realtek 8168
 4:0:0: ASMedia ASM1083/1085 PCIE-PCI

* The dmesg output will be attached, since I can't copy and paste it here, 
sorry.
and it have all the info of /var/run/dmesg.boot
I think its all, I asked to people and I can't find if this audio device is 
supported 
or not, If you need more information please ask.

Thank you for this wonderfull OS.

-- 
Regards

Henrique Lengler 
OpenBSD 5.6 (GENERIC.MP) #333: Fri Aug  8 00:20:21 MDT 2014
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8439386112 (8048MB)
avail mem = 8205946880 (7825MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xec1f0 (82 entries)
bios0: vendor American Megatrends Inc. version 1401 date 07/29/2014
bios0: ASUS All Series
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT LPIT SSDT SSDT MCFG HPET SSDT SSDT BGRT
acpi0: wakeup devices UAR1(S4) PS2K(S4) PS2M(S4) PXSX(S4) RP01(S4) PXSX(S4) 
RP02(S4) PXSX(S4) RP03(S4) PXSX(S4) RP05(S4) PXSX(S4) RP06(S4) PXSX(S4) 
RP07(S4) PXSX(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz, 3498.48 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz, 3497.98 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz, 3497.98 MHz
cpu2: