snd_pcm_lib_malloc_pages
I am trying to write to a driver on the Dreamcast (SH4) - as far as I can see there are no ALSA drivers extant for this processor. Does that mean I should assume this function is implemented or unimplemented on SH? On a scan through the code I can see no obvious reason why it wouldn't be working (ie no processor specific code) but there must be some degree of processor/bus specific code.
Adrian
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
At Sun, 20 Nov 2005 23:12:05 +0000,
Quoted 7 lines · Adrian McMenamin
I am trying to write to a driver on the Dreamcast (SH4) - as far as I can see there are no ALSA drivers extant for this processor. Does that mean I should assume this function is implemented or unimplemented on SH? On a scan through the code I can see no obvious reason why it wouldn't be working (ie no processor specific code) but there must be some degree of processor/bus specific code.
You don't have to use snd_pcm_lib_malloc_pages(). This function is provided for the common case together with the buffer pre-allocation via snd_pcm_lib_preallocate_pages*() functions. snd_pcm_lib_malloc_pages() itself doesn't allocate buffers but calls the allocator in memalloc.c. Thus, without pre-allocation, this function doesn't work at all.
What you have to do is just to set up the buffer in hw_params callback and release in hw_free callback. Note that these callbacks may called multiple times per session, so you have to check if the parameters are identical and reset the bufer if changed.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click