Re: Audio probles like, slow response in applications that use audio and a little noise in the background
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
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
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
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
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
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: