Echoaudio ALSA driver


--> Pagina in italiano



Development status:
To do:
How to compile:

The driver is included in the official ALSA distro starting from alsa-driver-1.0.8rc2. To compile ALSA you have to download all ALSA tarballs from alsa-project.org. OSS Compat Library is required only if you need OSS emulation. If you don't use OSS, remember to pass the --with-oss=no option to configure when you compile alsa-driver. alsa-firmware is required for any Echoaudio card and the kernel must have hotplug support enabled and hotplug scripts must be correctly installed. alsa-tools and alsa-utils are not necessary for correct operation, but they are useful in many ways, expecially alsa-tools that contains echomixer.
To configure and compile alsa-driver type this at the shell prompt (eg. for the Gina24):

./configure --with-cards=gina24[,other cards] [other options]
make
make install

Type: configure --help to get a list of all options.

Supported Echoaudio card names are: darla20, gina20, layla20, darla24, gina24, mia, mona, layla24, echo3g, indigo, indigoio, indigodj.

If you don't have the hotplug scripts you can download them here.

Now you have to compile and install alsa-firmware. Compile it with:

./configure
make

Make sure that /lib/firmware is a symbolic link to /usr/lib/hotplug/firmware or vice-versa:

$ ls -la /lib/firmware
lrwxrwxrwx 1 root root 26 Aug 15 2005 /lib/firmware -> /usr/lib/hotplug/firmware/

If it isn't, do it, otherwise the firmware loader will not be able to find the files.
Finally, do

make install

to install them.
Once the drivers are installed, you can load the module as usual. The hotplug system will upload the proper firmware every time the driver needs it.

modprobe snd-gina24

NB: the firmware files depends on the system. You cannot use files generated on a little-endian machine (eg. intel) on a big-endian one (eg. powerpc) or the opposite.


Echomixer

For infos about Emixer look here.


Notes

First of all you have to load the module. Probably the hotplug system loaded it automatically, but in case it didn't, the module name has the name of the card with a leading "snd-". For example, for the Mia:

modprobe snd-mia

Before playing something set the output volume because it's muted by default. On Echoaudio cards you can also set digital output volume, and it's muted at startup, too. Let's suppose the Echoaudio card is the only installed card or it's the first ALSA card. To play something over the first analog channel type: aplay something.wav
To get a list of all available devices, type: aplay -l
An ALSA device name usually has this form: "hw:card,dev,subdev". "card" is the card index (0 is the first card, 1 is the second card...). "dev" is the PCM device. The driver registers two PCM devices: device 0 provides analog channels and device 1 provides digital channels (if they exist). "subdev" is used to choose the starting channel. If you don't specify one of more parameters, they default to 0, thus the example above is the same as aplay -Dplughw:0,0,0 something.wav
For example, aplay -Dplughw:0,1,2 something.wav
plays something.wav out of the first ALSA card, digital output, starting at channel 2. If the sound is stereo, it comes out of channels 2 and 3. "aplay" is one of the tool shipped with the alsa-utils package.
On cards with the Vmixer the driver initializes the Vmixer as follows, so you don't have to change it in order to play something. You can see and change it with Echomixer. Please note that the line-out volume *is* muted, according to the ALSA specs:


The following tables show the sample formats each card supports. When you use the default PCM device (plughw:), however, ALSA will make the proper data format conversions transparently, so you usually don't have to worry about this.

Supported playback formats:
  Channels
  1 2 4, 6, 8, ...
Darla 20
Gina 20
S32_LE, S32_BE S8, S16_LE, S24_3LE, S32_LE  
Layla 20
Darla 24
S32_LE, S32_BE S8, S16_LE, S24_3LE, S32_LE S16_LE, S24_3LE, S32_LE
Gina 24
Layla 24
Mona
Mia (-midi)
Indigo (-IO, -DJ)
Gina 3G
Layla 3G
S32_LE, S32_BE S8, S16_LE, S24_3LE, S32_LE, S32_BE S16_LE, S24_3LE, S32_LE

Supported capture formats:
  Channels
  1 2 4, 6, 8, ...
Darla 20
Gina 20
S8, S16_LE, S24_3LE, S32_LE S8, S16_LE, S24_3LE, S32_LE  
Layla 20
Darla 24
S8, S16_LE, S24_3LE, S32_LE S8, S16_LE, S24_3LE, S32_LE S16_LE, S24_3LE, S32_LE
Gina 24
Layla 24
Mona
Mia (-midi)
Indigo (-IO, -DJ)
Gina 3G
Layla 3G
S8, S16_LE, S24_3LE, S32_LE S8, S16_LE, S24_3LE, S32_LE, S32_BE S16_LE, S24_3LE, S32_LE

All cards support syncronous (ie. sample-accurate) start/stop of a set of substreams. This method can be used on the Gina 20 and the Darla 20 to create multichannels substreams.
The period must be a multiple of 32 frames long and the buffer can have 2 to 220 periods. The buffer can be at most 256KB long (this is a software limit that can be easily changed).
On Echoaudio soundcards the sample rate is a global setting: you cannot choose a sample rate for a channel and a different one for another. It also applies when the cards uses an external clock. For example, if the card is using a 48KHz clock from the ADAT input, you cannot play a 44.1KHz track at correct speed. It will play at 48KHz too. ALSA do not provide a simple user-friendly method to manage it. The driver has a workaround to make things work fine most of the times. The driver prevents an application to set the sample rate if another PCM device is already open. This prevents eg. KDE to screw up your 96KHz recording if it plays a 44KHz "beep". KDE will not be allowed to set 44KHz until the recording application closes its PCM device. The logic that does the work is imperfect and basically broken, but it works fine usually. The right way to manage it is to add a "sample lock" control similar to the one in the windos Echo console, but it requires the user to set it manually and it's not very handy IMO.
You cannot change the digital mode if a PCM device is open bacause it may change the number of channels and the available sample rates.
You can change the clock source in any moment on all cards but the Mona. Echomixer enables the items in the menu only if the card receives a valid clock. The driver do not manage the change between single speed (25-50KHz) and double speed (50-100KHz) external S/PDIF clock automatically. If such a change occurs, you have to switch the clock source to internal and back to S/PDIF manually to make the card sync with the new clock.
The Gina24, Layla24 and Mona cards have the "digital input automute" feature. The driver always enables it and the user cannot deactivate it (do someone need it ?). That feature mutes the input channels when the card doesn't receive a valid signal. All other cards get noise. You have to manually mute the monitor mixer to make them silent.


Troubleshootings



Have fun :)


Download

All driver tarballs are gpg-signed. The signature has the same URL of the file, with a ".sig" appended. My gpg public key is here.

Starting from 1.0.2 the driver sources do not contain the firmware files anymore.
If you haven't already installed them you have to download also ea_fw.patch.bz2 which is a patch against alsa-firmware CVS distro.

The driver has been included in alsa-driver-1.0.8rc2.
The driver can be downloaded from alsa-project.org. The new newest version of the driver is available from the anonymous CVS interface of alsa project.


ea_fw-1.0.2.patch.bz2 (2004/12/25) (ALSA>=1.0.8rc1 and hotplug support are required)
1.0.2 (2004/12/25)

1.0.1ext(2004/12/23) (ALSA>=1.0.7rc2 and hotplug support are required)
1.0.1(2004/12/23) (ALSA>=1.0.7rc2 is required)
1.0.0(2004/12/22) (ALSA>=1.0.7rc2 is required)
0.9.8a(2004/12/13) (ALSA>=1.0.7rc2 is required)
0.9.8(2004/12/11) (ALSA>=1.0.7rc2 is required)
0.9.7beta12(2004/12/08) (ALSA>=1.0.7rc2 is required)
0.9.7beta11(2004/12/05) (ALSA>=1.0.7rc2 is required)
0.9.6b(2004/11/14) (ALSA>=1.0.6rc1 is required)
0.9.5(2004/11/04) (ALSA>=1.0.6rc1 is required)
0.9.4(2004/10/26) (ALSA>=1.0.6rc1 is required)
0.9.3a(2004/10/24) (ALSA>=1.0.6rc1 is required)
0.9.2(2004/10/22) (ALSA>=1.0.6rc1 is required)
0.9.1(2004/10/11) (ALSA>=1.0.6rc1 is required)
0.9.0(2004/10/03) (ALSA>=1.0.6rc1 is required)
0.8.16(2004/07/29) (ALSA>=1.0.6rc1 is required)
0.8.15a(2004/07/19) (ALSA>=1.0.6rc1 is required)
0.8.14(2004/07/07) (ALSA>=1.0.4rc2 is required)
0.8.12(2004/06/06) (ALSA>=1.0.4rc2 is required)
0.8.11a(2004/05/02) (ALSA>=1.0.4rc2 is required)
0.8.10(2004/04/24) (ALSA>=1.0.4rc2 is required)
0.8.9(2004/03/28) (ALSA>=1.0.0rc2 is required)
0.8.8a(2004/03/17) (ALSA>=1.0.0rc2 is required)
0.8.7a(2004/02/09) (ALSA>=1.0.0rc2 is required)
0.8.6 (2004/01/25) (ALSA>=1.0.0rc2 is required)
0.8.5 (2004/01/17) (ALSA>=1.0.0rc2 is required)
0.8.4 (2004/01/13) (ALSA>=1.0.0rc2 is required)
0.8.3 (2004/01/04) (ALSA>=1.0.0rc2 is required)
0.8.2a(2003/12/28) (ALSA>=1.0.0rc2 is required)
0.8.1 (2003/12/23) (ALSA>=1.0.0rc2 is required)
0.8.0e(2003/12/13) (ALSA>=1.0.0rc2 is required)

Hotplug scripts:
hotplug-base-2004_09_23-1.noarch.rpm
hotplug-2004_09_23-1.noarch.rpm

Contact:

Email: pochini@shiny.it


Changelog:

1.0.1- Driver: 1.0.0 has a stupid long standing bug in the input clock code. Fixed. -ext version is the same but it only supports external firmware
1.0.0- Driver: Workaround for an old ALSA bug was removed. Misc cleanup and removal of old debug code and comments was done (no functional changes). Emixer: It displays the card's name in the title of each window.
0.9.8a-Driver: Oops, I forgot to enable support for the monitor mixer in the Indigo IO driver.
0.9.8- Driver: Just a few minor changes. (exp. set_sample_rate() of gina20 and darla20).
0.9.7beta12-Driver: A hard to trigger deadlock bug on cards with the digital mode switch was fixed. Professional-S/PDIF switch on 3G cards didn't work. Minor bugfixes. Emixer: it displays the card name on the window title.
0.9.7beta11-Driver: A minor bug in the MIDI code was fixed. A bug in the # of channels <--> sample format rules was fixed (it made the plughw: device behave badly). A couple of bugs in the card registration procedure were fixed. A small bug in the phantom power was fixed.
0.9.7beta10-Driver: Some more cleanup and minor bugfixes.
0.9.7beta9- Driver: Code cleanup and minor bugfixes.
0.9.7beta8- Driver: Coding style changes (I hope I didn't break anything).
0.9.7beta7- Driver: A (semi-)bug in the MIDI code was fixed.
0.9.7beta6- Driver: MIDI support was added. It doesn't crash and I fixed a bug, but it isn't tested (I haven't the cable).
0.9.7beta5- Driver: Support for IndigoIO, IndigoDJ and phantom power of the Gina3G was added. Minor bug fixes.
0.9.7beta4- Driver: Compile problem with linux 2.4 was (hopefully) fixed.
0.9.7beta3- Driver: All old cards are supported. Support for the Indigo was added. Support for external firmware works again.
0.9.7beta2- Driver: All old cards except the Mia are supported.
0.9.7beta1- Driver: N.B.: this is a preliminary release that may contain new bugs. Please test and report. The driver should behave exactly like 0.9.6a.
This driver is based on the new generic driver by Echoaudio and it uses the new firmware. External firmware and midi are not supported yet. Currently only the following cards are supported: darla20, gina20, gina24, darla24, layla20, gina3g, layla3g.
Other changes: The Mia doesn't support sample rates below 32KHz anymore, but it has a lower latency. The "dither 16 bit digital inputs" switch has been removed. Now 8 and 16 bits analog inputs are always dithered, digital inputs are not. Support for S24_3LE format was added (24 bits in three bytes). There are other changes that I'll add to this list later.

0.9.6b- Driver: A bug in the Layla24 S/PDIF stuff was fixed.
0.9.6a- Driver: Bugfix: levels were at full (+6dB) volume by default.
0.9.6- Driver: The 24.8 fixed point format for mixer gains has been removed. Now the control interface accepts raw values (1 unit = 1dB for all volumes, but line input where one unit is 0.5dB). Some minor coding style changes were done. Echomixer: It was updated to match the changes in the ctl interface. Some bugs in the line-in volume were fixed.

0.9.5- Driver: Some minor changes and bugfix were done. Echomixer: All controls of the main window have been moved to a separate window. Buttons that open the other windows were replaced with toggle buttons. Some minor changes and cleanup ware done.

0.9.4- Driver Two busy loops were been replaced with something more system-friendly (the machine does not freeze anymore while loading the firmware, expecially if something goes wrong). Some more coding style changes were done.

0.9.3a-Driver: Oops, I left external firmware enabled by default.

0.9.3- Driver: A few mistakes introduced in 0.9.2 were fixed.

0.9.2- Driver: A bug about period sizes was fixed. Long standing bugs in the set_digital_mode functions (Gina24, Mona, Layla24) were fixed. Support for external firmware for Mona and Layla24 was added (but not tested). Expecially on the Mona the external fw support is tricky, please test and report bugs. Now also the DSP loader is external (you have to recompile and run echofirmware). An unlikely reace condition was fixed. Some more cleanup was done.

0.9.1- Driver: Support for external firmware was added. It requires properly installed hotplug scripts and Linux 2.6 or a very recent 2.4 kernel with hotplug support enabled.

0.9.0- Driver: Big coding style changes. Since I changed the names of about 80% of the variables and functions, some bugs may have been introduced. Please test and report. Some minor bugs were fixed.

0.8.16- Driver: A lot of changes were done. Some pointless never-changing variables have been replaced with constants. The driver should behave exactly like the previous version, but it's 1KiB smaller. Please test and report. If there are problems they are most certainly wrong number of channels and such. Some minor bugs were fixed.

0.8.15a- Driver: Some (mostly harmless) bugs in midi code were fixed. Code was updated in order to follow the various changes in the memory allocation API of ALSA 1.0.6rc, so this version is not compatible with previous versions of ALSA. A few other minor changes were made.

0.8.14- Driver: No big changes, just some cleanup was done.

0.8.13pre4- Driver: A compile problem was fixed.

0.8.13pre3- Driver: The logic that prevents unwanted sample rate change was improved (alsa-lib/test/latency.c and others work again). Sync-start was tested ok.

0.8.13pre2- Driver: Some uglyness and data duplication was removed.

0.8.13pre1- Driver: Compile problem with linux 2.4 was fixed. Support for syncronous start and stop was added, but not tested. This is expecially useful for Gina20 and Darla20 because they don't support streams with more than two channels. Please test and report.

0.8.12- Driver: Some minor changes only.

0.8.12pre3- Driver: MIDI support was added. A recent bug that triggers when using only two periods was fixed. A bug for the Mia that prevents using subdevices other that the first one was fixed. An app can't change the sample rate anymore if another pcm device is open. Other minor changes. "Trubleshootings" section was added. Echomixer: On some card the gang button didn't appear. The gang button now also affects the nominal level controls. Emixer page was updated.

0.8.11a-Driver: Oops, a wrong check caused false error messages.

0.8.11- Driver: A memory allocation bug was fixed. Other minor changes.

0.8.10- Driver: Misc fixes and another lot of code reorg and cleanup were done (again). The compiled driver is quite smaller than 0.8.9 because most of the unused code is not compiled in anymore. A minor bug on the Mona was fixed. Echomixer: A workaround for a compilation error with gcc 2.x was added.

0.8.10pre3- Driver: Misc fixes and another lot of code reorg and cleanup were done. Echomixer: A bug about computing the monitor gain on the Mia was fixed. A bug on the graphic Vmixer was fixed. Monitor mixer and Vmixer now take into account the Gang button status.

0.8.10pre2- Driver: Detected sample clock sources are exported to userspace. Digital modes list of the Mona was wrong. A compile problem was fixed. Some more code cleanup was done. Echomixer: It now allows the user to select an input clock source only if the card is receiving a valid signal.

0.8.10pre1- Driver: Various changes to follow the new API for memory allocations. This version requires ALSA-1.0.4rc2. Some more code cleanup was done.

0.8.9 - No changes.

0.8.9pre2- Driver: Yet another lot of code reorganization. It does not compile most unused parts of the driver anymore. Support for continuous sample rate of the Layla20 was added. The No-dither switch is now available for all cards with digital i/o.

0.8.9pre1- Driver: By mistake the driver used delays much longer than needed. Now it works reliably with the minimun allowed period size (0.73ms at 44KHz). A silly bug in DspSetFlags() was fixed. It affects S/PDIF prof/cons switch on Mia, Gina20 and Layla20. Gina20/Layla20 input gain was halved. Fixed. A lot of code cleanup and rework were done. I hope I didn't introduce new bugs. :) Please test and report problems.

0.8.8a-Another bug on the vmixer was fixed.

0.8.8- No big changes were done. Just some code cleanup.

0.8.8rc2- Driver: A stupid bug in the pcm_pointer() function was fixed. The minimum period size was raised to 32 samples and can only be a multiple of 32. I did it because sometimes the card does bad things with completely arbitrary period and buffer sizes. The minimun latency at 44KHz is now 0.73ms. Some more code cleanup was made. Echomixer: harmless typo was fixed.

0.8.8rc1- Driver: Full debugging messages are not enable by default anymore. Compile --with-debug=full option to enable them. "Clock source" control name was changed to follow the standard. A bug in the initialization of the Vmixer was fixed. All race condition should be fixed. This releaase may have problems, please test and report... Echomixer: A lot of changes aimed to make the code more readable were made. A bug on the Vmixer was fixed (again...).

0.8.7a-Driver: Support for ALSA-1.0.2 1.0.2c and Linux 2.6 were added. A bug on the vmixer was fixed (in the -a version). Unloading the module now powers down the DSP.

0.8.6- Driver: Some fixes to the Darla20 driver were made. I don't know if it works now.

Echomixer: A lot of changes and fixes were made. Support for the vmixer was added. Maybe there are a lot new bugs^H^H^H^Hnot documented features, too :) Please test and report.

0.8.5- Driver: Misc fixes. Fixed silly typo in the Mona driver that made it fail on successful initialization. Still no luck finding the bug that causes problems on the Darla 20 :( Echomixer: A bug which made Emixer fail on cards without digital mode switch was fixed.

0.8.4- Driver: Misc fixes. Improved error handling: if an error occurs during initialization the driver exits immediately. In the previous version it could hang the machine for several minutes before exitting, thus people though the machine was crashed. Support for Layla20 and Mona was added. A bug in the Layla24 driver was fixed.

0.8.3- Driver: Incorrect misdetection of the digital i/o for the Mia was fixed. Some changes to the control interface were made. A lot of fixes were made. Echomixer: The new version is ready for everyday use. The old verion was renamed echomixer_old.c. Emixer2 looks like the old version, but each section has its own window. I did it because on some cards the window was too large and because usually only a small subset of all controls are used. Emixer2 at exit saves the current window position and most of mixer settings in the file ~/.Emixer_cardname. The most important new feature is the "Line volume" window. It controls the master output volume. This feature is emulated by Emixer2 because the only cards that have that feature in hardware are the Mia and Mia-midi. Support for the Vmixer (Mia and Mia-midi only) is still missing.

0.8.2a-Echomixer: A stupid bug that prevents to set the volume on the Mia was fixed

0.8.2- Driver: Support for Darla20 was added. Minimum period size is now 32 bytes (from 512) that is 181 microseconds latency at cd quality :)

0.8.1- Driver: New version number because I received some successful test reports. Nominal level control names are different, so you have to compile the new Echomixer. Some minor bugs were fixed. Echomixer: the matrix mixer is not a compile-time option anymore and can be enablen from the main windows. The new (alpha) version of Emixer is included in the package. The file is echomixer2.c.

0.8.0e-Driver: Preliminary support for the Mia was added. A problem with the Vmixer was fixer. Preliminary support for the Gina20 was added. Better build process. Preliminary support for the Layla24 was added.