Skip to contentSkip to conversation

Request for tests: scatter-gather dma support on via686 and emu10k1

DISCUSSION Takashi Iwai 2 participants 5 messages Jul 19, 2002 – Jul 30, 2002 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

i just added the support of scatter-gather (sg) dma support on some chips. some chips such like via686 and emu10k1 have sg dma function, which enables to use discontiguous pages as buffer. hence we'll have almost no memory allocation problem on these chips.

on via686 and emu10k1, the playback (and capture for via686) buffers are no longer preallocated but allocated always dynamically (preallocation doesn't make sense for sg buffers).

on via686 driver, there is a new constraint. the period byte size must be in power of two, to make sure that the period is aligned to the kernel page size. i don't believe that this matters, though.

there are some other chips with this function, via8233, intel8x0 and trident. they will be supported eventually soon. (the porting must be easy but i have no hardware :)

anyway, if you have an emu10k1 or via686 soundchip, please test the latest cvs version of alsa-kernel/alsa-driver.

thanks,

Takashi

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#3 lore raw
In reply to a message not in the archive
Quoted 37 lines · Takashi Iwai

Hi,

At 20 Jul 2002 14:05:33 +0200,

Quoted 28 lines · Santiago Otero

El vie, 19-07-2002 a las 19:19, Takashi Iwai escribi�:

Quoted 15 lines

Hi,

i just added the support of scatter-gather (sg) dma support on some chips. some chips such like via686 and emu10k1 have sg dma function, which enables to use discontiguous pages as buffer. hence we'll have almost no memory allocation problem on these chips.

on via686 and emu10k1, the playback (and capture for via686) buffers are no longer preallocated but allocated always dynamically (preallocation doesn't make sense for sg buffers).

on via686 driver, there is a new constraint. the period byte size must be in power of two, to make sure that the period is aligned to the kernel page size. i don't believe that this matters, though.

Quoted 9 lines

there are some other chips with this function, via8233, intel8x0 and trident. they will be supported eventually soon. (the porting must be easy but i have no hardware :)

anyway, if you have an emu10k1 or via686 soundchip, please test the latest cvs version of alsa-kernel/alsa-driver.

I've got a via686. I've tested cvs version of alsa-driver and here are my results:

Review

Quoted 2 lines
(quoted diff) +0 -2
-OSS emulation works fine
-xmms, mplayer, xine, ogg123 work fine

ok. thanks for your tests.

Quoted 9 lines
Quoted 2 lines

-all my own applications that before were working now sound bad. I am working on the problem

this might be related with the period size restriction. how did you set the period size?
please check /proc/asound/card0/pcm0p/sub0/hw_params and which condition is used.

I was using default period size. Setting period size to 1024 makes my application work again.

Thanks.

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#4 lore raw

At 22 Jul 2002 18:21:57 +0200,

Quoted 11 lines · Santiago Otero
Quoted 6 lines · Takashi Iwai

this might be related with the period size restriction. how did you set the period size?
please check /proc/asound/card0/pcm0p/sub0/hw_params and which condition is used.

I was using default period size. Setting period size to 1024 makes my application work again.

ok, could you show me the values listed in the proc file above during playback/record?
i guess the buffer size is not aligned to the period size, and the number of period is relatively small.

Takashi

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#5 lore raw
Quoted 6 lines · Takashi Iwai

ok, could you show me the values listed in the proc file above during playback/record?
i guess the buffer size is not aligned to the period size, and the number of period is relatively small.

playing sound:

$cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 16
buffer_size: 16384
tick_time: 10000

recording sound:

$cat /proc/asound/card0/pcm0c/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 16
buffer_size: 16384
tick_time: 10000

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#6 lore raw

At 23 Jul 2002 19:18:53 +0200,

Quoted 12 lines · Santiago Otero

El mar, 23-07-2002 a las 11:21, Takashi Iwai escribi�:

Quoted 6 lines

ok, could you show me the values listed in the proc file above during playback/record?
i guess the buffer size is not aligned to the period size, and the number of period is relatively small.

playing sound:

Quoted 9 lines

$cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 16
buffer_size: 16384
tick_time: 10000

i guess you didn't set up the period size in your application explicitly, right?
that's why it gives so small value.

on the previous driver, there was a constraint about the period and the buffer sizes, and perhaps this increased the minimum period size eventually.
this constraint was disabled for the time being, because this likely conflicts with the new constraint, period size = power of two.

Takashi

-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31