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



Rockbox mail archive

Subject: Re: Anyone up for ALSA?

Re: Anyone up for ALSA?

From: Steve Moskovchenko <stevenm_at_umd.edu>
Date: 2005-07-14

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 Thu Jul 14 01:41:23 2005


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa