Skip to contentSkip to conversation

do apps need to care for xfer_align ???

DISCUSSION Guilhem Tardy 3 participants 4 messages Sep 6, 2002 – Sep 9, 2002 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi all,

While trying to understand snd_pcm_lib_write1(), I found that runtime->xfer_align is set to period_size in pcm_native.c, but wonder if it is just a default?

Paul Davis' example (at http://www.op.net/~pbd/alsa-audio.html#playex) doesn't check for a particular transfer size, and my card supports playout of less than 160 samples (i.e. the period size). Thus, I set to try playing out 512 bytes at a time (i.e. 2048 samples of 2-bit ADPCM), which does NOT come to a multiple of period size. The result is that only 1920 samples are played, and my app thinks an error has occured.

Is it a general requirement for apps to send only audio in multiple of the period size?

Thanks,
Guilhem.

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#2 lore raw

example for how to use hwdep?

Hi,

I have implemented some hwdep support in a driver, and would like to test it from an app. As I couldn't find any example of hwdep use in an app either in the utils or on the mail archive, I figured maybe one of you could help and point me to some example in source code?

Thanks,
Guilhem.

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#3 lore raw
In reply to Guilhem Tardy
Quoted 13 lines · Guilhem Tardy

Hi all,

While trying to understand snd_pcm_lib_write1(), I found that runtime->xfer_align is set to period_size in pcm_native.c, but wonder if it is just a default?

Paul Davis' example (at http://www.op.net/~pbd/alsa-audio.html#playex) doesn't check for a particular transfer size, and my card supports playout of less than 160 samples (i.e. the period size). Thus, I set to try playing out 512 bytes at a time (i.e. 2048 samples of 2-bit ADPCM), which does NOT come to a multiple of period size. The result is that only 1920 samples are played, and my app thinks an error has occured.

Quoted 2 lines

Is it a general requirement for apps to send only audio in multiple of the period size?

Nope, applications might modify xfer_align to satisfy their requirements.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
SuSE Linux http://www.suse.com
ALSA project http://www.alsa-project.org

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#4 lore raw
Quoted 17 lines · Guilhem Tardy
Quoted 5 lines

Hi all,

While trying to understand snd_pcm_lib_write1(), I found that runtime->xfer_align is set to period_size in pcm_native.c, but wonder if it

is

Quoted 3 lines

just a default?

Paul Davis' example (at http://www.op.net/~pbd/alsa-audio.html#playex) doesn

't

Quoted 1 line

check for a particular transfer size, and my card supports playout of less t

han

Quoted 1 line

160 samples (i.e. the period size). Thus, I set to try playing out 512 bytes

at

Quoted 1 line

a time (i.e. 2048 samples of 2-bit ADPCM), which does NOT come to a multiple

of

Quoted 8 lines
Quoted 1 line

period size. The result is that only 1920 samples are played, and my app thi

nks

Quoted 4 lines

an error has occured.

Is it a general requirement for apps to send only audio in multiple of the period size?

Nope, applications might modify xfer_align to satisfy their requirements.

jaroslav, since even i don't understand what xfer_align is for, or even have an answer to the actual question, it might be good for you to expand on this a little.

--p

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390