Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide
translations



Rockbox mail archive

Subject: Re: Anyone up for ALSA?

Re: Anyone up for ALSA?

From: Steve Moskovchenko <stevenm_at_umd.edu>
Date: Wed, 13 Jul 2005 19:38:06 -0400

As far as I can tell, this actually works on the simulator, the only
issue is that you have to symlink /dev/dsp to /archos/dev/dsp because
the iriver plugins are restructed to having the archos directory as /..
other than that, this way works.. some people need OSS emulation in the
kernel enabled under Alsa for this to work.

If this code is moved into the body of the Simulator and not into the
plugins, then obviously the symlink problem goes away.


On Wed, 2005-07-13 at 23:27 +0100, Dave Hooper wrote:
> One idea - rather than using snd_pcm_open would it be possible to just
> open
> /dev/dsp? (e.g. the same way the irivermidi code works when running
> on
> C - pasted below hopefully)
> Just a thought .. all of that snd_pcm_xxx looks more complex than I
> suspect it needs to be
>
>
> void initSound()
>
> {
>
> //OSS Stuff, set the sampling rate, etc: 48000, Mono, 16bit
>
> fd=open("/dev/dsp", O_WRONLY); // | O_NONBLOCK);
>
> int arg, status;
>
> int bit, samp, ch;
>
>
> arg = 16; // sample size
>
> status = ioctl(fd, SOUND_PCM_WRITE_BITS, &arg);
>
> status = ioctl(fd, SOUND_PCM_READ_BITS, &arg);
>
> bit=arg;
>
>
>
> arg = 1; //Number of channels, 1=mono
>
> status = ioctl(fd, SOUND_PCM_WRITE_CHANNELS, &arg);
>
> status = ioctl(fd, SOUND_PCM_READ_CHANNELS, &arg);
>
> ch=arg;
>
>
> arg = SAMPLE_RATE; //Yeah. sampling rate
>
> status = ioctl(fd, SOUND_PCM_WRITE_RATE, &arg);
>
> status = ioctl(fd, SOUND_PCM_READ_RATE, &arg);
>
> samp=arg;
>
>
> //Print out what we *actually* got.. not that the program
>
> //pays attention to these values anyway
>
> printf("\nDSP Says:\n%dHz %dCh %dbit", samp, ch, bit);
>
> }

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on 2005-07-14

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy