* Problem with aloop
@ 2008-04-30 20:27 Gustavo da Silva Serra
0 siblings, 0 replies; 11+ messages in thread
From: Gustavo da Silva Serra @ 2008-04-30 20:27 UTC (permalink / raw)
To: alsa-devel
Hi,
I am developing an application that captures sound and send it
through a network, just like a sound server. To test it I am using
kaffeine with alsa output plugin. After some time playing continuously,
or if I keep moving the position slider backward and forward, I get
choppy sound. If I close and reopen the capture stream opened by my
sound server, the sound is restored to good quality. Sometimes I have to
reopen many times before I get a good sound. When I use kaffeine oss
output plugin I don't have this issue. I don't have an audio sound card,
so I don't know if this is an aloop issue.
Here are some details:
- RedHat EL 4 kernel 2.6.9.55-ELsmp 64bit
- Alsa 1.0.16
- Xinelib 1.1.12
Please, if more details are needed I will be happy to provide them.
Thanks in advance.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
@ 2008-05-09 12:46 Benjamin van den Hout
2008-05-09 12:56 ` Gustavo da Silva Serra
0 siblings, 1 reply; 11+ messages in thread
From: Benjamin van den Hout @ 2008-05-09 12:46 UTC (permalink / raw)
To: alsa-devel
Gustavo da Silva Serra wrote:
> I am developing an application that captures sound and send it
> through a network, just like a sound server. To test it I am using
> kaffeine with alsa output plugin. After some time playing continuously,
> or if I keep moving the position slider backward and forward, I get
> choppy sound. If I close and reopen the capture stream opened by my
> sound server, the sound is restored to good quality. Sometimes I have to
> reopen many times before I get a good sound. When I use kaffeine oss
> output plugin I don't have this issue. I don't have an audio sound card,
> so I don't know if this is an *aloop* issue.
> Here are some details:
>- RedHat EL 4 kernel 2.6.9.55-ELsmp 64bit
>- Alsa 1.0.16
>- Xinelib 1.1.12
Hi all,
I'm experiencing the same problem as Gustavo. In my case I have a SIP
client calling to another PC and I'm injecting audio with aplay (or
amarok, no difference there) into that SIP call. About 8/10 times
everything goes well, the other two times the audio that comes out at
the other PC sounds really choppy. Both PC's are on the same local
network so that is probably not the problem.
What I found out is that if I patch aloop-kernel.c in the 'static
struct snd_pcm_hardware snd_card_loopback_info' to have ".formats =
(SNDRV_PCM_FMTBIT_S8 )," this problem goes away. But then I'm stuck
with 8 bit audio. It sounds a bit like the aloop device sometimes
doesn't properly synchronise the 16 bit (or 32bit, tried that as well)
samples on both PCM devices and things get mis-aligned. I'm quite new
to ALSA so please don't laugh too hard if I'm missing something here
:)
Any input is greatly appreciated!
Kind regards,
Benjamin van den Hout
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
2008-05-09 12:46 Benjamin van den Hout
@ 2008-05-09 12:56 ` Gustavo da Silva Serra
0 siblings, 0 replies; 11+ messages in thread
From: Gustavo da Silva Serra @ 2008-05-09 12:56 UTC (permalink / raw)
To: alsa-devel
Benjamin van den Hout escreveu:
> Gustavo da Silva Serra wrote:
>
>
>> I am developing an application that captures sound and send it
>> through a network, just like a sound server. To test it I am using
>> kaffeine with alsa output plugin. After some time playing continuously,
>> or if I keep moving the position slider backward and forward, I get
>> choppy sound. If I close and reopen the capture stream opened by my
>> sound server, the sound is restored to good quality. Sometimes I have to
>> reopen many times before I get a good sound. When I use kaffeine oss
>> output plugin I don't have this issue. I don't have an audio sound card,
>> so I don't know if this is an *aloop* issue.
>>
>
>
>> Here are some details:
>> - RedHat EL 4 kernel 2.6.9.55-ELsmp 64bit
>> - Alsa 1.0.16
>> - Xinelib 1.1.12
>>
>
> Hi all,
>
> I'm experiencing the same problem as Gustavo. In my case I have a SIP
> client calling to another PC and I'm injecting audio with aplay (or
> amarok, no difference there) into that SIP call. About 8/10 times
> everything goes well, the other two times the audio that comes out at
> the other PC sounds really choppy. Both PC's are on the same local
> network so that is probably not the problem.
>
> What I found out is that if I patch aloop-kernel.c in the 'static
> struct snd_pcm_hardware snd_card_loopback_info' to have ".formats =
> (SNDRV_PCM_FMTBIT_S8 )," this problem goes away. But then I'm stuck
> with 8 bit audio. It sounds a bit like the aloop device sometimes
> doesn't properly synchronise the 16 bit (or 32bit, tried that as well)
> samples on both PCM devices and things get mis-aligned. I'm quite new
> to ALSA so please don't laugh too hard if I'm missing something here
> :)
>
> Any input is greatly appreciated!
>
> Kind regards,
> Benjamin van den Hout
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
> __________ NOD32 3088 (20080509) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>
Well, I discovered that only xinelib has this problem. Xmms and
alsaplayer, for example, don't have this issue. I am testing VLC and it
seems to work fine. I am not surprised, since the xine source code that
deals with alsa is huge and ugly, it must be very hard to mantain that.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
@ 2008-05-13 7:43 Benjamin van den Hout
2008-05-13 11:51 ` Gustavo da Silva Serra
0 siblings, 1 reply; 11+ messages in thread
From: Benjamin van den Hout @ 2008-05-13 7:43 UTC (permalink / raw)
To: alsa-devel
Gustavo da Silva Serra wrote:
Well, I discovered that only xinelib has this problem. Xmms and
> alsaplayer, for example, don't have this issue. I am testing VLC and it
> seems to work fine. I am not surprised, since the xine source code that
> deals with alsa is huge and ugly, it must be very hard to mantain that.
>
Thanks for your reply! I did some more testing and I can reproduce it as
well with the 8bit mode, it occurrs less frequently. When I switch back to
16 bit it takes only a few tries with aplay to get the hiccups. So it seems
it is a bit more tricky than I initially thought. Xine can be a strange
beast some times, so that's why I used aplay as well. Anybody have some more
ideas how to tackle this problem or point me in the right direction so I can
solve it myself? It seems I am so close to a working solution...
Kind regards,
Benjamin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
2008-05-13 7:43 Problem with aloop Benjamin van den Hout
@ 2008-05-13 11:51 ` Gustavo da Silva Serra
0 siblings, 0 replies; 11+ messages in thread
From: Gustavo da Silva Serra @ 2008-05-13 11:51 UTC (permalink / raw)
To: alsa-devel
I had some problems until I could figure it out how to configure alsa
properly in /etc/asound.conf. Maybe this could be your problem? What is
your alsa version? I heard that aloop didn't work well until 1.0.15, or
such (alsa guys: is this true?).
Benjamin van den Hout escreveu:
> Gustavo da Silva Serra wrote:
>
> Well, I discovered that only xinelib has this problem. Xmms and
>
>> alsaplayer, for example, don't have this issue. I am testing VLC and it
>> seems to work fine. I am not surprised, since the xine source code that
>> deals with alsa is huge and ugly, it must be very hard to mantain that.
>>
>>
>
> Thanks for your reply! I did some more testing and I can reproduce it as
> well with the 8bit mode, it occurrs less frequently. When I switch back to
> 16 bit it takes only a few tries with aplay to get the hiccups. So it seems
> it is a bit more tricky than I initially thought. Xine can be a strange
> beast some times, so that's why I used aplay as well. Anybody have some more
> ideas how to tackle this problem or point me in the right direction so I can
> solve it myself? It seems I am so close to a working solution...
>
> Kind regards,
> Benjamin
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
> __________ NOD32 3095 (20080513) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>
>
>
--
Gustavo da Silva Serra gustavo.serra@tet.com.br
———————————————————————————
Tools & Technologies - T&T Engenheiros Associados Ltda.
Projetos de SW & HW - Desenvolvendo soluções.
Rua Riachuelo, 1098 Conj. 1204
Centro - Porto Alegre - CEP 90010-272
Fone DDR: (51)3220-3290
Fone/Fax: (51)3220-3220 / 3220-3206
http://www.tet.com.br/ tet@tet.com.br
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
@ 2008-05-13 13:27 Benjamin van den Hout
2008-05-13 13:45 ` Gustavo da Silva Serra
2008-05-14 8:35 ` Benjamin van den Hout
0 siblings, 2 replies; 11+ messages in thread
From: Benjamin van den Hout @ 2008-05-13 13:27 UTC (permalink / raw)
To: alsa-devel
Gustavo da Silva Serra wrote:
I had some problems until I could figure it out how to configure alsa
> properly in /etc/asound.conf. Maybe this could be your problem? What is
> your alsa version? I heard that aloop didn't work well until 1.0.15, or
> such (alsa guys: is this true?).
>
My alsa is 1.0.14 but I'm using the 'HG' version of the alsa-drivers and
alsa-kernel packages so that basically gets me the latest-and-greatest
drivers from the source repository if I understand correctly. I saw some
patches coming by in February and they are already in there so I presume I'm
working with the most current source.
I'm intrigued by the asound.conf, is there any specific configuration you
needed to make the aloop device work properly? I'm using the
distro-configured alsa (ubuntu 7.10) and there is no such file somehwere in
/etc. Even on my debian server (running Etch), I can't find it.
Kind regards,
Benjamin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
2008-05-13 13:27 Benjamin van den Hout
@ 2008-05-13 13:45 ` Gustavo da Silva Serra
2008-05-14 8:35 ` Benjamin van den Hout
1 sibling, 0 replies; 11+ messages in thread
From: Gustavo da Silva Serra @ 2008-05-13 13:45 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]
I tryied to use the HG versions, but they didn't work well for me. Maybe
you should give the 1.0.16 a try, just to make sure.
I need an asound.conf since my network application uses a very low
latency, that is not default. I am attaching my asound.conf.
Another possible source of problems are the artsd and esd daemons, are
they running?
Hope that helps.
Benjamin van den Hout escreveu:
> Gustavo da Silva Serra wrote:
>
> I had some problems until I could figure it out how to configure alsa
>
>> properly in /etc/asound.conf. Maybe this could be your problem? What is
>> your alsa version? I heard that aloop didn't work well until 1.0.15, or
>> such (alsa guys: is this true?).
>>
>>
>
> My alsa is 1.0.14 but I'm using the 'HG' version of the alsa-drivers and
> alsa-kernel packages so that basically gets me the latest-and-greatest
> drivers from the source repository if I understand correctly. I saw some
> patches coming by in February and they are already in there so I presume I'm
> working with the most current source.
>
> I'm intrigued by the asound.conf, is there any specific configuration you
> needed to make the aloop device work properly? I'm using the
> distro-configured alsa (ubuntu 7.10) and there is no such file somehwere in
> /etc. Even on my debian server (running Etch), I can't find it.
>
> Kind regards,
> Benjamin
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
> __________ NOD32 3095 (20080513) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>
>
>
--
Gustavo da Silva Serra gustavo.serra@tet.com.br
———————————————————————————
Tools & Technologies - T&T Engenheiros Associados Ltda.
Projetos de SW & HW - Desenvolvendo soluções.
Rua Riachuelo, 1098 Conj. 1204
Centro - Porto Alegre - CEP 90010-272
Fone DDR: (51)3220-3290
Fone/Fax: (51)3220-3220 / 3220-3206
http://www.tet.com.br/ tet@tet.com.br
[-- Attachment #2: asound.conf --]
[-- Type: text/plain, Size: 856 bytes --]
pcm.dmixed {
type dmix
ipc_key 372891
ipc_key_add_uid true
slave {
pcm "hw:0,0,0"
period_time 20000
buffer_time 80000
}
bindings {
0 0
1 1
}
}
pcm.playsoftvol {
type softvol
slave.pcm "dmixed"
control {
name "Master"
card 0
device 0
subdevice 0
}
}
pcm.dsnooped {
type dsnoop
ipc_key 573194
ipc_key_add_uid true
slave {
pcm "hw:0,1,0"
period_time 20000
buffer_time 80000
}
bindings {
0 0
1 1
}
}
pcm.fullduplex {
type asym
playback.pcm "playsoftvol"
capture.pcm "dsnooped"
}
pcm.!default {
type plug
slave.pcm "fullduplex"
}
pcm.dsp0 {
type plug
slave.pcm "fullduplex"
}
ctl.mixer0 {
type hw
card 0
device 0
subdevice 0
}
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
2008-05-13 13:27 Benjamin van den Hout
2008-05-13 13:45 ` Gustavo da Silva Serra
@ 2008-05-14 8:35 ` Benjamin van den Hout
1 sibling, 0 replies; 11+ messages in thread
From: Benjamin van den Hout @ 2008-05-14 8:35 UTC (permalink / raw)
To: alsa-devel
Gustavo da Silva Serra wrote:
*Sorry, I accidentally left the subject to the digest title. Reposting to
get the threading right*
I tryied to use the HG versions, but they didn't work well for me. Maybe
> you should give the 1.0.16 a try, just to make sure.
> I need an asound.conf since my network application uses a very low
> latency, that is not default. I am attaching my asound.conf.
> Another possible source of problems are the artsd and esd daemons, are
> they running?
>
> Hi Gustavo,
I just downloaded the 10.0.16 version and the code for aloop-kernel.c looked
quite different from the one in the HG version. I was under the
understanding that the HG version is a current development snapshot that
eventually gets tagged into an official 1.0.1xx version. That's not the case
then?
Anyway, I will try with the 10.0.16 version, I see some stuff about a
#define called SND_CARD_LOOPBACK_START_SYNC, that sounds promising perhaps.
I've also looked at the config file you attached, the stuff about
period_time and buffer_size also looks quite interesting and is perhaps
something I should play with then :)
I'll let you know how things work out! Thanks for your continued help, it is
greatly appreciated...
UPDATE: I built the 10.0.16 version of snd-aloop and it seems to perform a
bit better out of the box! I will experiment a bit more...
Kind regards,
Benjamin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
2008-03-06 15:51 ` Takashi Iwai
@ 2008-05-31 20:00 ` Ahmet İnan
2008-06-01 16:15 ` Benjamin van den Hout
0 siblings, 1 reply; 11+ messages in thread
From: Ahmet İnan @ 2008-05-31 20:00 UTC (permalink / raw)
To: alsa-devel; +Cc: Gustavo da Silva Serra, Benjamin van den Hout
ive just read about aloop problems by chance, so excuse the late answer,
for ive disabled recieving mails from this list. so also cc me when replying :)
> repeating stuttering
try tickless kernel, as it improves the quality of timer interrupts dramatically.
dont forget to enable high resolution timer support, hpet and so on.
> synchronization issue at the beginning
this is still not resolved and its a pain in the ass to get this done right.
ive implemented 4 different ways to solve it and im still not happy with what ive got.
> kernel crash when closing
do you really have to put at this manny places this del_timer?
try to find the right place and resubmit. :)
ahmet
--
admin der abteilung für angewandte mathematik, tel. 0761-203-5626
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
2008-05-31 20:00 ` Problem with aloop Ahmet İnan
@ 2008-06-01 16:15 ` Benjamin van den Hout
2008-06-02 8:08 ` Ahmet İnan
0 siblings, 1 reply; 11+ messages in thread
From: Benjamin van den Hout @ 2008-06-01 16:15 UTC (permalink / raw)
To: Ahmet İnan; +Cc: alsa-devel, Gustavo da Silva Serra
Hi Ahmet,
ive just read about aloop problems by chance, so excuse the late answer,
> for ive disabled recieving mails from this list. so also cc me when
> replying :)
>
No problem, I'm delighted somebody is answering my e-mails at all :)
> repeating stuttering
> try tickless kernel, as it improves the quality of timer interrupts
> dramatically.
> dont forget to enable high resolution timer support, hpet and so on.
>
OK, excellent tip. Thanks! High resolution timer support is already enabled
and I've got the kernel configured for "realtime" performance (CONFIG_HZ or
whatever it was called set to 1000 etc.). I'll try to see if the tickless
kernel makes any difference.
> > synchronization issue at the beginning
> this is still not resolved and its a pain in the ass to get this done
> right.
> ive implemented 4 different ways to solve it and im still not happy with
> what ive got.
>
The funny thing is, after I reverted to the 10.0.16 release tarball these
stuttering problems went away. So the fixes that were committed in
february/march under the 'fixes realtime behaviour' label actually made
things much worse..
> > kernel crash when closing
> do you really have to put at this manny places this del_timer?
> try to find the right place and resubmit. :)
>
I already presumed it was a bit much, I'll be the last one to deny that! ;-)
But then again, I'm not too familiar with ALSA kernel stuff anyway and the
existing documentation seems a bit sparse. Also, this patch was made as part
of a time-limited project at my company so I sadly couldn't spend more time
on it after I (crudely) fixed the bug. However, I'd love to refine my patch
(in my own spare time). Can you give me any pointers perhaps? They would be
greatly appreciated.
Thanks for taking the time to reply!
Kind regards,
Benjamin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problem with aloop
2008-06-01 16:15 ` Benjamin van den Hout
@ 2008-06-02 8:08 ` Ahmet İnan
0 siblings, 0 replies; 11+ messages in thread
From: Ahmet İnan @ 2008-06-02 8:08 UTC (permalink / raw)
To: Benjamin van den Hout; +Cc: alsa-devel, Gustavo da Silva Serra
> > > synchronization issue at the beginning
> > this is still not resolved and its a pain in the ass to get this done
> The funny thing is, after I reverted to the 10.0.16 release tarball these
> stuttering problems went away. So the fixes that were committed in
> february/march under the 'fixes realtime behaviour' label actually made
> things much worse..
without SND_CARD_LOOPBACK_START_SYNC, its still the same. you should really
get a tickless kernel first. otherwise its just pure luck and frustration.
> > try to find the right place and resubmit. :)
> (in my own spare time). Can you give me any pointers perhaps? They would be
usually snd_card_loopback_playback_trigger gets called with
SNDRV_PCM_TRIGGER_STOP whenever the device is about to be closed.
so the next function would be snd_card_loopback_close. try
snd_card_loopback_timer_stop there and report :D
ahmet
--
admin der abteilung für angewandte mathematik, tel. 0761-203-5626
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-06-02 8:08 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13 7:43 Problem with aloop Benjamin van den Hout
2008-05-13 11:51 ` Gustavo da Silva Serra
-- strict thread matches above, loose matches on Subject: below --
2008-05-13 13:27 Benjamin van den Hout
2008-05-13 13:45 ` Gustavo da Silva Serra
2008-05-14 8:35 ` Benjamin van den Hout
2008-05-09 12:46 Benjamin van den Hout
2008-05-09 12:56 ` Gustavo da Silva Serra
2008-04-30 20:27 Gustavo da Silva Serra
2008-02-20 14:19 [PATCH] improved snd-aloop quality when using certain samplerates and kernel HZ Ahmet İnan
2008-02-20 16:08 ` Takashi Iwai
2008-02-21 0:06 ` Ahmet İnan
2008-02-21 6:54 ` Takashi Iwai
2008-02-22 18:05 ` Ahmet İnan
2008-02-28 11:48 ` Takashi Iwai
2008-03-01 11:55 ` Ahmet İnan
2008-03-01 15:22 ` Takashi Iwai
2008-03-01 23:35 ` Ahmet İnan
2008-03-06 15:51 ` Takashi Iwai
2008-05-31 20:00 ` Problem with aloop Ahmet İnan
2008-06-01 16:15 ` Benjamin van den Hout
2008-06-02 8:08 ` Ahmet İnan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.