Commit d737c751 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

Documentation,ALSA Core,PCI drivers,MIXART driver,IGNORE
- added snd-mixart driver for Digigram miXart boards.
parent 77a83af6
......@@ -692,6 +692,15 @@ Module parameters
The power-management is supported.
Module snd-mixart
-----------------
Module for Digigram miXart8 soundcards.
Module supports multiple cards.
Note: One miXart8 board will be represented as 4 alsa cards.
See MIXART.txt for details.
Module snd-mpu401
-----------------
......
Alsa driver for Digigram miXart8 and miXart8AES/EBU soundcards
Digigram <alsa@digigram.com>
GENERAL
=======
The miXart8 is a multichannel audio processing and mixing soundcard
that has 4 stereo audio inputs and 4 stereo audio outputs.
The miXart8AES/EBU is the same with a add-on card that offers further
4 digital stereo audio inputs and outputs.
Furthermore the add-on card offers external clock synchronisation
(AES/EBU, Word Clock, Time Code and Video Synchro)
The mainboard has a PowerPC that offers onboard mpeg encoding and
decoding, samplerate conversions and various effects.
The driver don't work properly at all until the certain firmwares
are loaded, i.e. no PCM nor mixer devices will appear.
Use the mixartloader that can be found in the alsa-tools package.
VERSION 0.1.0
=============
One miXart8 board will be represented as 4 alsa cards, each with 1
stereo analog capture 'pcm0c' and 1 stereo analog playback 'pcm0p' device.
With a miXart8AES/EBU there is in addition 1 stereo digital input
'pcm1c' and 1 stereo digital output 'pcm1p' per card.
Formats
-------
U8, S16_LE, S16_BE, S24_3LE, S24_3BE, FLOAT_LE, FLOAT_BE
Sample rates : 8000 - 48000 Hz continously
Playback
--------
For instance the playback devices are configured to have max. 4
substreams performing hardware mixing. This could be changed to a
maximum of 24 substreams if wished.
Mono files will be played on the left and right channel. Each channel
can be muted for each stream to use 8 analog/digital outputs seperately.
Capture
-------
There is one substream per capture device. For instance only stereo
formats are supported.
Mixer
-----
<Master> and <Master Capture> : analog volume control of playback and capture PCM.
<PCM 0-3> and <PCM Capture> : digital volume control of each analog substream.
<AES 0-3> and <AES Capture> : digital volume control of each AES/EBU substream.
<Monitoring> : Loopback from 'pcm0c' to 'pcm0p' with digital volume
and mute control.
Rem : for best audio quality try to keep a 0 attenuation on the PCM
and AES volume controls which is set by 219 in the range from 0 to 255
(about 86% with alsamixer)
NOT YET IMPLEMENTED
===================
- external clock support (AES/EBU, Word Clock, Time Code, Video Sync)
- MPEG audio formats
- mono record
- on-board effects and samplerate conversions
- linked streams
FIRMWARE
========
For loading the firmware automatically after the module is loaded, use
the post-install command. For example, add the following entry to
/etc/modprobe.conf for miXart driver:
install snd-mixart /sbin/modprobe --first-time -i snd-mixart && \
/usr/bin/mixartloader
(for 2.2/2.4 kernels, add "post-install snd-mixart /usr/bin/vxloader" to
/etc/modules.conf, instead.)
The firmware binaries are installed on /usr/share/alsa/firmware
(or /usr/local/share/alsa/firmware, depending to the prefix option of
configure). There will be a miXart.conf file, which define the dsp image
files.
The firmware files are copyright by Digigram SA
COPYRIGHT
=========
Copyright (c) 2003 Digigram SA <alsa@digigram.com>
Distributalbe under GPL.
......@@ -107,5 +107,6 @@ obj-$(CONFIG_SND_VXPOCKET) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-h
obj-$(CONFIG_SND_VXP440) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-hwdep.o
obj-$(CONFIG_SND_VX222) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-hwdep.o
obj-$(CONFIG_SND_BT87X) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
obj-$(CONFIG_SND_MIXART) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-hwdep.o
obj-m := $(sort $(obj-m))
......@@ -55,6 +55,12 @@ config SND_KORG1212
help
Say 'Y' or 'M' to include support for Korg 1212IO.
config SND_MIXART
tristate "Digigram miXart"
depends on SND
help
Say 'Y' or 'M' to include support for Digigram miXart soundcard.
config SND_NM256
tristate "NeoMagic NM256AV/ZX"
depends on SND
......
......@@ -38,4 +38,16 @@ obj-$(CONFIG_SND_RME96) += snd-rme96.o
obj-$(CONFIG_SND_SONICVIBES) += snd-sonicvibes.o
obj-$(CONFIG_SND_VIA82XX) += snd-via82xx.o
obj-$(CONFIG_SND) += ac97/ ali5451/ cs46xx/ emu10k1/ korg1212/ nm256/ rme9652/ trident/ ymfpci/ ice1712/ vx222/
obj-$(CONFIG_SND) += \
ac97/ \
ali5451/ \
cs46xx/ \
emu10k1/ \
ice1712/ \
korg1212/ \
mixart/ \
nm256/ \
rme9652/ \
trident/ \
ymfpci/ \
vx222/
#
# Makefile for ALSA
# Copyright (c) 2001 by Jaroslav Kysela <perex@suse.cz>
#
snd-mixart-objs := mixart.o mixart_core.o mixart_hwdep.o mixart_mixer.o
obj-$(CONFIG_SND_MIXART) += snd-mixart.o
This diff is collapsed.
/*
* Driver for Digigram miXart soundcards
*
* main header file
*
* Copyright (c) 2003 by Digigram <alsa@digigram.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __SOUND_MIXART_H
#define __SOUND_MIXART_H
#include <sound/pcm.h>
#define MIXART_DRIVER_VERSION 0x000100 /* 0.1.0 */
/*
*/
#define mixart_t_magic 0xa17a3e01
#define mixart_mgr_t_magic 0xa17a3e02
typedef struct snd_mixart mixart_t;
typedef struct snd_mixart_mgr mixart_mgr_t;
typedef struct snd_mixart_stream mixart_stream_t;
typedef struct snd_mixart_pipe mixart_pipe_t;
typedef struct mixart_bufferinfo mixart_bufferinfo_t;
typedef struct mixart_flowinfo mixart_flowinfo_t;
typedef struct mixart_uid mixart_uid_t;
struct mixart_uid
{
u32 object_id;
u32 desc;
};
struct mem_area {
unsigned long phys;
unsigned long virt;
struct resource *res;
};
typedef struct mixart_route mixart_route_t;
struct mixart_route {
unsigned char connected;
unsigned char phase_inv;
int volume;
};
/* firmware status codes */
#define MIXART_MOTHERBOARD_XLX_INDEX 0
#define MIXART_MOTHERBOARD_ELF_INDEX 1
#define MIXART_AESEBUBOARD_XLX_INDEX 2
#define MIXART_HARDW_FILES_MAX_INDEX 3 /* xilinx, elf, AESEBU xilinx */
#define MIXART_MAX_CARDS 4
#define MSG_FIFO_SIZE 16
#define MIXART_MAX_PHYS_CONNECTORS (MIXART_MAX_CARDS * 2 * 2) /* 4 * stereo * (analog+digital) */
struct snd_mixart_mgr {
unsigned int num_cards;
mixart_t *chip[MIXART_MAX_CARDS];
struct pci_dev *pci;
int irq;
/* memory-maps */
struct mem_area mem[2];
/* share the name */
char shortname[32]; /* short name of this soundcard */
char longname[80]; /* name of this soundcard */
/* message tasklet */
struct tasklet_struct msg_taskq;
/* one and only blocking message or notification may be pending */
u32 pending_event;
wait_queue_head_t msg_sleep;
/* messages stored for tasklet */
u32 msg_fifo[MSG_FIFO_SIZE];
int msg_fifo_readptr;
int msg_fifo_writeptr;
spinlock_t lock; /* interrupt spinlock */
spinlock_t msg_lock; /* mailbox spinlock */
struct semaphore msg_mutex; /* mutex for blocking_requests */
struct semaphore setup_mutex; /* mutex used in hw_params, open and close */
/* hardware interface */
snd_hwdep_t *hwdep;
unsigned int board_type; /* read from embedded once elf file is loaded, 250 = miXart8, 251 = with AES, 252 = with Cobranet */
mixart_flowinfo_t* flowinfo_array;
dma_addr_t flowinfo_physaddr;
mixart_bufferinfo_t* bufferinfo_array;
dma_addr_t bufferinfo_physaddr;
mixart_uid_t uid_console_manager;
int sample_rate;
int ref_count_rate;
struct semaphore mixer_mutex; /* mutex for mixer */
};
#define MIXART_STREAM_STATUS_FREE 0
#define MIXART_STREAM_STATUS_OPEN 1
#define MIXART_STREAM_STATUS_RUNNING 2
#define MIXART_STREAM_STATUS_DRAINING 3
#define MIXART_STREAM_STATUS_PAUSE 4
#define MIXART_PLAYBACK_STREAMS 4
#define MIXART_CAPTURE_STREAMS 1
#define MIXART_PCM_ANALOG 0
#define MIXART_PCM_DIGITAL 1
#define MIXART_PCM_TOTAL 2
#define MIXART_MAX_STREAM_PER_CARD (MIXART_PCM_TOTAL * (MIXART_PLAYBACK_STREAMS + MIXART_CAPTURE_STREAMS) )
#define MIXART_NOTIFY_CARD_MASK 0xF000
#define MIXART_NOTIFY_CARD_OFFSET 12
#define MIXART_NOTIFY_PCM_MASK 0x0F00
#define MIXART_NOTIFY_PCM_OFFSET 8
#define MIXART_NOTIFY_CAPT_MASK 0x0080
#define MIXART_NOTIFY_SUBS_MASK 0x007F
struct snd_mixart_stream {
snd_pcm_substream_t *substream;
mixart_pipe_t *pipe;
int pcm_number;
int status; /* nothing, running, draining */
u64 abs_period_elapsed; /* last absolute stream position where period_elapsed was called (multiple of runtime->period_size) */
u32 buf_periods; /* periods counter in the buffer (< runtime->periods) */
u32 buf_period_frag; /* defines with buf_period_pos the exact position in the buffer (< runtime->period_size) */
int channels;
};
enum mixart_pipe_status {
PIPE_UNDEFINED,
PIPE_STOPPED,
PIPE_RUNNING,
PIPE_CLOCK_SET
};
struct snd_mixart_pipe {
mixart_uid_t group_uid; /* id of the pipe, as returned by embedded */
int stream_count;
mixart_uid_t uid_left_connector; /* UID's for the audio connectors */
mixart_uid_t uid_right_connector;
enum mixart_pipe_status status;
int references; /* number of subs openned */
int monitoring; /* pipe used for monitoring issue */
};
struct snd_mixart {
snd_card_t *card;
mixart_mgr_t *mgr;
int chip_idx; /* zero based */
snd_hwdep_t *hwdep; /* DSP loader, only for the first card */
snd_pcm_t *pcm; /* PCM analog i/o */
snd_pcm_t *pcm_dig; /* PCM digital i/o */
/* allocate stereo pipe for instance */
mixart_pipe_t pipe_in_ana;
mixart_pipe_t pipe_out_ana;
/* if AES/EBU daughter board is available, additional pipes possible on pcm_dig */
mixart_pipe_t pipe_in_dig;
mixart_pipe_t pipe_out_dig;
mixart_stream_t playback_stream[MIXART_PCM_TOTAL][MIXART_PLAYBACK_STREAMS]; /* 0 = pcm, 1 = pcm_dig */
mixart_stream_t capture_stream[MIXART_PCM_TOTAL]; /* 0 = pcm, 1 = pcm_dig */
/* UID's for the physical io's */
mixart_uid_t uid_out_analog_physio;
mixart_uid_t uid_in_analog_physio;
int analog_playback_active[2]; /* Mixer : Master Playback active (!mute) */
int analog_playback_volume[2]; /* Mixer : Master Playback Volume */
int analog_capture_volume[2]; /* Mixer : Master Capture Volume */
int digital_playback_active[2*MIXART_PLAYBACK_STREAMS][2]; /* Mixer : Digital Playback Active [(analog+AES output)*streams][stereo]*/
int digital_playback_volume[2*MIXART_PLAYBACK_STREAMS][2]; /* Mixer : Digital Playback Volume [(analog+AES output)*streams][stereo]*/
int digital_capture_volume[2][2]; /* Mixer : Digital Capture Volume [analog+AES output][stereo] */
int monitoring_active[2]; /* Mixer : Monitoring Active */
int monitoring_volume[2]; /* Mixer : Monitoring Volume */
};
struct mixart_bufferinfo
{
u32 buffer_address;
u32 reserved[5];
u32 available_length;
u32 buffer_id;
};
struct mixart_flowinfo
{
u32 bufferinfo_array_phy_address;
u32 reserved[11];
u32 bufferinfo_count;
u32 capture;
};
/* exported */
int snd_mixart_create_pcm(mixart_t* chip);
mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capture, int monitoring);
int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monitoring);
#endif /* __SOUND_MIXART_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Driver for Digigram miXart soundcards
*
* definitions and makros for basic card access
*
* Copyright (c) 2003 by Digigram <alsa@digigram.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __SOUND_MIXART_HWDEP_H
#define __SOUND_MIXART_HWDEP_H
#include <sound/hwdep.h>
#define readl_be(x) be32_to_cpu(__raw_readl(x))
#define writel_be(data,addr) __raw_writel(cpu_to_be32(data),addr)
#define readl_le(x) le32_to_cpu(__raw_readl(x))
#define writel_le(data,addr) __raw_writel(cpu_to_le32(data),addr)
#define MIXART_MEM(mgr,x) ((mgr)->mem[0].virt + (x))
#define MIXART_REG(mgr,x) ((mgr)->mem[1].virt + (x))
/* Daughter board Type */
#define DAUGHTER_TYPE_MASK 0x0F
#define DAUGHTER_VER_MASK 0xF0
#define DAUGHTER_TYPEVER_MASK (DAUGHTER_TYPE_MASK|DAUGHTER_VER_MASK)
#define MIXART_DAUGHTER_TYPE_NONE 0x00
#define MIXART_DAUGHTER_TYPE_COBRANET 0x08
#define MIXART_DAUGHTER_TYPE_AES 0x0E
#define MIXART_BA0_SIZE (16 * 1024 * 1024) /* 16M */
#define MIXART_BA1_SIZE (4 * 1024) /* 4k */
/*
* -----------BAR 0 --------------------------------------------------------------------------------------------------------
*/
#define MIXART_PSEUDOREG 0x2000 /* base address for pseudoregister */
#define MIXART_PSEUDOREG_BOARDNUMBER MIXART_PSEUDOREG+0 /* board number */
/* perfmeter (available when elf loaded)*/
#define MIXART_PSEUDOREG_PERF_STREAM_LOAD_OFFSET MIXART_PSEUDOREG+0x70 /* streaming load */
#define MIXART_PSEUDOREG_PERF_SYSTEM_LOAD_OFFSET MIXART_PSEUDOREG+0x78 /* system load (reference)*/
#define MIXART_PSEUDOREG_PERF_MAILBX_LOAD_OFFSET MIXART_PSEUDOREG+0x7C /* mailbox load */
#define MIXART_PSEUDOREG_PERF_INTERR_LOAD_OFFSET MIXART_PSEUDOREG+0x74 /* interrupt handling load */
/* motherboard xilinx loader info */
#define MIXART_PSEUDOREG_MXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x9C /* 0x00600000 */
#define MIXART_PSEUDOREG_MXLX_SIZE_OFFSET MIXART_PSEUDOREG+0xA0 /* xilinx size in bytes */
#define MIXART_PSEUDOREG_MXLX_STATUS_OFFSET MIXART_PSEUDOREG+0xA4 /* status = EMBEBBED_STAT_XXX */
/* elf loader info */
#define MIXART_PSEUDOREG_ELF_STATUS_OFFSET MIXART_PSEUDOREG+0xB0 /* status = EMBEBBED_STAT_XXX */
/*
* after the elf code is loaded, and the flowtable info was passed to it,
* the driver polls on this address, until it shows 1 (presence) or 2 (absence)
* once it is non-zero, the daughter board type may be read
*/
#define MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET MIXART_PSEUDOREG+0x990
/* Global info structure */
#define MIXART_PSEUDOREG_DBRD_TYPE_OFFSET MIXART_PSEUDOREG+0x994 /* Type and version of daughterboard */
/* daughterboard xilinx loader info */
#define MIXART_PSEUDOREG_DXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x998 /* get the address here where to write the file */
#define MIXART_PSEUDOREG_DXLX_SIZE_OFFSET MIXART_PSEUDOREG+0x99C /* xilinx size in bytes */
#define MIXART_PSEUDOREG_DXLX_STATUS_OFFSET MIXART_PSEUDOREG+0x9A0 /* status = EMBEBBED_STAT_XXX */
/* */
#define MIXART_FLOWTABLE_PTR 0x3000 /* pointer to flow table */
/* mailbox addresses */
/* message DRV -> EMB */
#define MSG_INBOUND_POST_HEAD 0x010008 /* DRV posts MF + increment4 */
#define MSG_INBOUND_POST_TAIL 0x01000C /* EMB gets MF + increment4 */
/* message EMB -> DRV */
#define MSG_OUTBOUND_POST_TAIL 0x01001C /* DRV gets MF + increment4 */
#define MSG_OUTBOUND_POST_HEAD 0x010018 /* EMB posts MF + increment4 */
/* Get Free Frames */
#define MSG_INBOUND_FREE_TAIL 0x010004 /* DRV gets MFA + increment4 */
#define MSG_OUTBOUND_FREE_TAIL 0x010014 /* EMB gets MFA + increment4 */
/* Put Free Frames */
#define MSG_OUTBOUND_FREE_HEAD 0x010010 /* DRV puts MFA + increment4 */
#define MSG_INBOUND_FREE_HEAD 0x010000 /* EMB puts MFA + increment4 */
/* firmware addresses of the message fifos */
#define MSG_BOUND_STACK_SIZE 0x004000 /* size of each following stack */
/* posted messages */
#define MSG_OUTBOUND_POST_STACK 0x108000 /* stack of messages to the DRV */
#define MSG_INBOUND_POST_STACK 0x104000 /* stack of messages to the EMB */
/* available empty messages */
#define MSG_OUTBOUND_FREE_STACK 0x10C000 /* stack of free enveloped for EMB */
#define MSG_INBOUND_FREE_STACK 0x100000 /* stack of free enveloped for DRV */
/* defines for mailbox message frames */
#define MSG_FRAME_OFFSET 0x64
#define MSG_FRAME_SIZE 0x6400
#define MSG_FRAME_NUMBER 32
#define MSG_FROM_AGENT_ITMF_OFFSET (MSG_FRAME_OFFSET + (MSG_FRAME_SIZE * MSG_FRAME_NUMBER))
#define MSG_TO_AGENT_ITMF_OFFSET (MSG_FROM_AGENT_ITMF_OFFSET + MSG_FRAME_SIZE)
#define MSG_HOST_RSC_PROTECTION (MSG_TO_AGENT_ITMF_OFFSET + MSG_FRAME_SIZE)
#define MSG_AGENT_RSC_PROTECTION (MSG_HOST_RSC_PROTECTION + 4)
/*
* -----------BAR 1 --------------------------------------------------------------------------------------------------------
*/
/* interrupt addresses and constants */
#define MIXART_PCI_OMIMR_OFFSET 0x34 /* outbound message interrupt mask register */
#define MIXART_PCI_OMISR_OFFSET 0x30 /* outbound message interrupt status register */
#define MIXART_PCI_ODBR_OFFSET 0x60 /* outbound doorbell register */
#define MIXART_BA1_BRUTAL_RESET_OFFSET 0x68 /* write 1 in LSBit to reset board */
#define MIXART_HOST_ALL_INTERRUPT_MASKED 0x02B /* 0000 0010 1011 */
#define MIXART_ALLOW_OUTBOUND_DOORBELL 0x023 /* 0000 0010 0011 */
#define MIXART_OIDI 0x008 /* 0000 0000 1000 */
/* exported */
int snd_mixart_hwdep_new(mixart_mgr_t *mgr);
#endif /* __SOUND_MIXART_HWDEP_H */
This diff is collapsed.
/*
* Driver for Digigram miXart soundcards
*
* include file for mixer
*
* Copyright (c) 2003 by Digigram <alsa@digigram.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __SOUND_MIXART_MIXER_H
#define __SOUND_MIXART_MIXER_H
/* exported */
int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx);
int mixart_update_capture_stream_level(mixart_t* chip, int is_aes);
int snd_mixart_create_mixer(mixart_mgr_t* mgr);
#endif /* __SOUND_MIXART_MIXER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment