All of lore.kernel.org
 help / color / mirror / Atom feed
* 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 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-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
* 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: [PATCH] improved snd-aloop quality when using certain samplerates and kernel HZ
@ 2008-02-20 14:19 Ahmet İnan
  2008-02-20 16:08 ` Takashi Iwai
  0 siblings, 1 reply; 11+ messages in thread
From: Ahmet İnan @ 2008-02-20 14:19 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

more cleanups.

removed some unneeded stuff.
patch is relative to current hg-tree.

http://www.mathematik.uni-freiburg.de/IAM/homepages/ainan/alsa-driver-hg-aloop-ainan-patch0.diff

Signed-off-by: Ahmet İnan <ainan <at> mathematik.uni-freiburg.de>

btw, my "nice" idea turned out to be a bitch, again. its really funny how
worse almoust always is better. :(

ahmet

--
admin der abteilung für angewandte mathematik, tel. 0761-203-5626

[-- Attachment #2: alsa-driver-hg-aloop-ainan-patch0.diff --]
[-- Type: text/plain, Size: 1257 bytes --]

diff -r 4ce2c0f9f2ef drivers/aloop-kernel.c
--- a/drivers/aloop-kernel.c	Wed Feb 20 12:46:42 2008 +0100
+++ b/drivers/aloop-kernel.c	Wed Feb 20 15:05:16 2008 +0100
@@ -86,7 +86,6 @@ typedef struct snd_card_loopback_pcm {
 	unsigned int pcm_bps;		/* bytes per second */
 	unsigned int pcm_hz;		/* HZ */
 	unsigned int pcm_irq_pos;	/* IRQ position */
-	unsigned int pcm_buf_pos;	/* position in buffer */
 	unsigned int pcm_period_pos;	/* period aligned pos in buffer */
 	struct snd_pcm_substream *substream;
 	struct snd_card_loopback_cable *cable;
@@ -165,7 +164,6 @@ static int snd_card_loopback_prepare(str
 	dpcm->pcm_size = frames_to_bytes(runtime, runtime->buffer_size);
 	dpcm->pcm_count = frames_to_bytes(runtime, runtime->period_size);
 	dpcm->pcm_irq_pos = 0;
-	dpcm->pcm_buf_pos = 0;
 	dpcm->pcm_period_pos = 0;
 
 	cable->hw.formats = (1ULL << runtime->format);
@@ -216,8 +214,6 @@ static void snd_card_loopback_timer_func
 	spin_lock_irq(&dpcm->lock);
 
 	dpcm->pcm_irq_pos += dpcm->pcm_bps;
-	dpcm->pcm_buf_pos += dpcm->pcm_bps;
-	dpcm->pcm_buf_pos %= dpcm->pcm_size * dpcm->pcm_hz;
 	if (dpcm->pcm_irq_pos >= dpcm->pcm_count * dpcm->pcm_hz) {
 		dpcm->pcm_irq_pos %= dpcm->pcm_count * dpcm->pcm_hz;
 		dpcm->pcm_period_pos += dpcm->pcm_count;

[-- 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

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.