Skip to contentSkip to conversation

How to debug ?

DISCUSSION Giuliano Pochini 2 participants 9 messages Apr 2, 2003 – Apr 3, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines

My driver do not work anymore with xmms (alsa-xmms plugin) and alsaplayer. [...]

I tried to force the alsaplayer plugin to set S16_LE format (data is BE on powerpc) and it do not spit that errors anymore, but it do not play anything and in the logs alsa prints:

ALSA ../alsa-kernel/core/pcm_lib.c:2219: BUG? (substream->ops->copy != ((void *)0) || runtime->dma_area != ((void *)0)) (called from d2040794) last message repeated 11886 times

I don't set .copy callback and ->dma_area should be 0 because the card uses a sg-list. #:(

Bye.

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#1 lore raw

At 02 Apr 2003 00:17:49 +0000,

Quoted 9 lines · Giuliano Pochini
Quoted 4 lines

My driver do not work anymore with xmms (alsa-xmms plugin) and alsaplayer. [...]

I tried to force the alsaplayer plugin to set S16_LE format (data is BE on powerpc) and it do not spit that errors anymore, but it do not play anything and in the logs alsa prints:

Quoted 6 lines

ALSA ../alsa-kernel/core/pcm_lib.c:2219: BUG? (substream->ops->copy != ((void *)0) || runtime->dma_area != ((void *)0)) (called from d2040794) last message repeated 11886 times

I don't set .copy callback and ->dma_area should be 0 because the card uses a sg-list. #:(

no, dma_area should not be zero. you shouldn't change the value, if you use snd_pcm_lib_malloc_pages(). in the case of sg-buffer, dma_area will hold the virtual mapped address, too.

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#2 lore raw
Quoted 6 lines · On 02-Apr-2003 Takashi Iwai wrote:
Quoted 2 lines

I don't set .copy callback and ->dma_area should be 0 because the card uses a sg-list. #:(

no, dma_area should not be zero. you shouldn't change the value, if you use snd_pcm_lib_malloc_pages(). in the case of sg-buffer, dma_area will hold the virtual mapped address, too.

I write in the runtime struct only the private area and hw pointers.

Bye.

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#3 lore raw

At Wed, 02 Apr 2003 12:33:18 +0200 (CEST),

Quoted 11 lines · Giuliano Pochini
Quoted 6 lines · On 02-Apr-2003 Takashi Iwai wrote:
Quoted 2 lines

I don't set .copy callback and ->dma_area should be 0 because the card uses a sg-list. #:(

no, dma_area should not be zero. you shouldn't change the value, if you use snd_pcm_lib_malloc_pages(). in the case of sg-buffer, dma_area will hold the virtual mapped address, too.

I write in the runtime struct only the private area and hw pointers.

sorry, which fields do you mean exactly?
runtime->private_data and runtime->hw ?
then they are ok, of course.

anyway, runtime->dma_area and runtime->dma_bytes MUST be filled manually IFF you don't use snd_pcm_lib_malloc_pages(). (dma_area won't be needed if the mmap is not supported and copy
callback is defined, though.)

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#4 lore raw
Quoted 2 lines · On 02-Apr-2003 Takashi Iwai wrote:

sorry, which fields do you mean exactly?
runtime->private_data and runtime->hw ?

Yes.

Quoted 4 lines

anyway, runtime->dma_area and runtime->dma_bytes MUST be filled manually IFF you don't use snd_pcm_lib_malloc_pages(). (dma_area won't be needed if the mmap is not supported and copy callback is defined, though.)

I use snd_pcm_lib_malloc_pages(), dma is supported and no copy callback is defined.

Bye.

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#5 lore raw

At Wed, 02 Apr 2003 12:55:04 +0200 (CEST),

Quoted 8 lines · Giuliano Pochini
Quoted 2 lines · On 02-Apr-2003 Takashi Iwai wrote:

sorry, which fields do you mean exactly?
runtime->private_data and runtime->hw ?

Yes.

Quoted 7 lines
Quoted 4 lines

anyway, runtime->dma_area and runtime->dma_bytes MUST be filled manually IFF you don't use snd_pcm_lib_malloc_pages(). (dma_area won't be needed if the mmap is not supported and copy callback is defined, though.)

I use snd_pcm_lib_malloc_pages(), dma is supported and no copy callback is defined.

did you call snd_pcm_lib_preallocate_xxx functions after snd_pcm_new() ?

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#6 lore raw
Quoted 10 lines · On 02-Apr-2003 Takashi Iwai wrote:
Quoted 7 lines
Quoted 4 lines

anyway, runtime->dma_area and runtime->dma_bytes MUST be filled manually IFF you don't use snd_pcm_lib_malloc_pages(). (dma_area won't be needed if the mmap is not supported and copy callback is defined, though.)

I use snd_pcm_lib_malloc_pages(), dma is supported and no copy callback is defined.

did you call snd_pcm_lib_preallocate_xxx functions after snd_pcm_new() ?

Yes, otherwise snd_pcm_lib_malloc_pages() fails and hw_params callback exits with an error.

Bye.

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#7 lore raw

At Wed, 02 Apr 2003 17:18:13 +0200 (CEST),

Quoted 8 lines · Giuliano Pochini
Quoted 5 lines · On 02-Apr-2003 Takashi Iwai wrote:
Quoted 5 lines
Quoted 4 lines

anyway, runtime->dma_area and runtime->dma_bytes MUST be filled manually IFF you don't use snd_pcm_lib_malloc_pages(). (dma_area won't be needed if the mmap is not supported and copy callback is defined, though.)

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I use snd_pcm_lib_malloc_pages(), dma is supported and no copy callback is defined.

did you call snd_pcm_lib_preallocate_xxx functions after snd_pcm_new() ?

Yes, otherwise snd_pcm_lib_malloc_pages() fails and hw_params callback exits with an error.

ok, then something overwrites the entry.
how about to check runtime->dma_area at each callback?

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#8 lore raw
Quoted 5 lines · On 02-Apr-2003 Takashi Iwai wrote:
Quoted 2 lines

Yes, otherwise snd_pcm_lib_malloc_pages() fails and hw_params callback exits with an error.

ok, then something overwrites the entry.
how about to check runtime->dma_area at each callback?

Bug found. Alsaplayer calls hw_params two times with different buffer setup (and same audio parameters). I wasn't aware it's legal to do that and I didn't rebuild the sg buffer the second time. Now I clean up an redo everything every time.

Ok, now AP works, but xmms still hangs. It calls pcm_open callback and dies. I'll work on it tonight...

Bye.

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/