From: Adrian McMenamin <adrian@mcmen.demon.co.uk>
To: ALSA development <alsa-devel@alsa-project.org>
Subject: Problems with a PCM driver
Date: Sat, 30 Aug 2003 19:56:52 +0100 [thread overview]
Message-ID: <200308301956.52235.adrian@mcmen.demon.co.uk> (raw)
I am writing a PCM driver for the AICA device on the Sega Dreamcast for a
2.6.0-testX kernel.
The driver is far from complete, but I am having various problems when I test
bits of it...
A simple write of a file gives me this...
/dev/snd # cat /test.txt > pcmC0D0p
ALSA sound/sh/aica.c:165: In snd_aica_playback_open
ALSA sound/sh/aica.c:80: Disabling AICA device
ALSA sound/sh/aica.c:66: Enabling AICA device
cat: write: File descriptor in bad state
The three snd_printk messages are just what I would expect but I am not sure
why I get the message about the file descriptor.
Here is the open function...
static int snd_aica_playback_open(snd_pcm_substream_t *subs)
{
snd_printk("In snd_aica_playback_open \n");
snd_aica_pcm_t *aica_chip = snd_pcm_substream_chip(subs);
snd_pcm_runtime_t *runtime = subs->runtime;
runtime->hw = snd_aica_playback_hw;
/*setup the aica spu*/
spu_disable();
spu_memset(0, 0, 0x31000);
spu_memload(0, bin_arm7, sizeof(bin_arm7));
spu_enable();
return 0;
}
The device doesn't support dma (or rather nobody has yet successful reversed
the DMA mechanism) and so I am using the methods that worked when I wrote the
OSS driver for the 2.4 kernels.
snd_aica_playback_hw is...
static snd_pcm_hardware_t snd_aica_playback_hw = {
.info = SNDRV_PCM_INFO_INTERLEAVED|SNDRV_PCM_INFO_NONINTERLEAVED,
.formats = SNDRV_PCM_FORMAT_S8 | SNDRV_PCM_FORMAT_U8 |
SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_IMA_ADPCM,
.rates = SNDRV_PCM_RATE_8000_44100,
.rate_min = 8000,
.rate_max = 44100,
.channels_min = 1,
.channels_max = 2,
.buffer_bytes_max = 32768,
.period_bytes_min = 8192,
.period_bytes_max = 32768,
.periods_min = 1,
.periods_max = 4
};
Anybody able to give me a few pointers as to what is going wrong?
Thanks
Adrian
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
next reply other threads:[~2003-08-30 18:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-30 18:56 Adrian McMenamin [this message]
2003-08-30 19:14 ` Problems with a PCM driver James Courtier-Dutton
2003-08-30 19:22 ` Adrian McMenamin
2003-08-30 19:45 ` James Courtier-Dutton
2003-08-30 19:51 ` Adrian McMenamin
2003-08-31 7:04 ` Jaroslav Kysela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200308301956.52235.adrian@mcmen.demon.co.uk \
--to=adrian@mcmen.demon.co.uk \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.