View Single Post
Old 07-09-2012, 11:58 AM   #46
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
snd_pcm_hw_params_set_rate_near not supported

THIS PAGE CONTAINS A COUPLE OF WORKING AUDIO DEMOS, TECHNICAL WAVE DETAILS AND FURTHER ALSA INTIALISATION DETAILS.

===============================================
Threads continue:

Code:
/*    CAUSES SEGGIE
 *
if ((err = snd_pcm_hw_params_set_rate_near 
        (capture_handle, hw_params, 48000, 0)) < 0) {
	fprintf (stderr, "cannot set sample rate (%s)\n",
	 snd_strerror (err));
	exit (1);
}


*/
so either approximate yourself or go for the known hw rates [re-Listed here from previous post]

Device: hw (type: HW)
Access types: MMAP_INTERLEAVED RW_INTERLEAVED
Formats: S16_LE S24_LE S20_3LE
Channels: 2
Sample rates: 8000 11025 16000 22050 32000 44100 48000
Interrupt interval: 166-512000 us
Buffer size: 333-2048000 us

Making the right choices should be trivial since we have known hardware
(This assumes that all kindles with sound support will support the same alsa rates,
This is untested on anything but a 3.)

Instead use snd_pcm_hw_params_set_rate

For example

Code:
if ((err = snd_pcm_hw_params_set_rate 
                (capture_handle, hw_params, 48000, 0)) < 0) {
		fprintf (stderr, "cannot set sample rate (%s)\n",
		 snd_strerror (err));
		exit (1);
		}
should be fine

Last edited by twobob; 07-11-2012 at 05:55 PM. Reason: added solution - added page precis
twobob is offline   Reply With Quote