WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: M-Audio Transit: UDEV and firmwareload ?  (Read 4159 times)

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
M-Audio Transit: UDEV and firmwareload ?
« on: June 10, 2009, 01:46:40 AM »
Hi folks.

I am trying to get my M-Audio Transit to work under TCL.

The tricky thing is that the card gets its firmware loaded by an application called madfuload every time it is connected.

I have a working setup under Ubuntu.

Following UDEV rule works under Ubuntu:

Code: [Select]
ACTION=="add", SUBSYSTEM=="usb", ENV{PRODUCT}=="763/2806/*", RUN+="/usr/sbin/madfuload -l -3 -f /usr/share/usb/maudio/ma006101.bin -D $env{DEVNAME}"
As you can see the madfuload will download the firmware-file "ma006101.bin" . This must happen before Alsa gets started. Otherwise the driver snd-usb-audio won't be loaded, because the card is not identified as audio device.

What do I have to do to get this working under TCL?    Do I have to make a TCE?  ::)  

I tried blondly to use the binary and firmware I had at hand. I put them in my home directory. Above rule ( with changed path) I added to udev/rules.d, numbering one lower than Alsa.  Somehow this messed up my setup. The windows manager didn't like it and went black, window frames disappeared.


THX for your advise.





« Last Edit: June 10, 2009, 06:05:12 AM by soundcheck »

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #1 on: June 10, 2009, 07:40:52 AM »

OK. I am one step further. The card is singing. :D

For now I managed to get it manually up'n running.

Code: [Select]
./madfuload -l -3 -f ./ma006101.bin
modprobe snd-usb-audio

I didn't even have to restart Alsa.

Now I need to settle the right bootorder, the UDEV rule and the automatic load of snd-usb-audio

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #2 on: June 10, 2009, 08:10:16 AM »

I justed looked up /etc/udev/rules.d

I need some help.

alsa is started at 25....
persistant stuff is started with 60...
drivers even later...

Where should I put my rule from post one assuming that my files are stored under /opt/mad (I made that one persistant) ?

BTW: I found another rules.d under /usr/local/etc with just the alsa rule inside! Why is that?

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #3 on: June 10, 2009, 08:21:29 AM »
The alsa udev rule resides in /usr/local/etc/...   to remain PPI compatible.  It is then symlinked to /etc upon loading the alsa extension where it is used.  When files need to be installed above /usr/local they can reside under /usr/local and then be either copied to the system or symlinked with the extension startup script.  That way PPI mode of operation is supported even when files need to be above /usr/local.

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #4 on: June 10, 2009, 09:06:04 AM »
Hi there.

at Jason: Now I realized the link by myself.  THX for the clarification. I am still on a very steep learning curve.  ;)


However now  I got it  working at boot. :D

The udevrule  I configured as below with path /opt/mad. And this path I added to /opt/.filetool.lst to make it persistant.

Code: [Select]
ACTION=="add", SUBSYSTEM=="usb", ENV{PRODUCT}=="763/2806/*", RUN+="/opt/mad/madfuload -l -3 -f /opt/mad/ma006101.bin -D $env{DEVNAME}"
The rule number I used is 96-madfuload.rules

The snd-usb-audio module gets loaded automatically.

The final exercise is now to make the  alsamixer settings persistant.




« Last Edit: June 10, 2009, 09:37:26 AM by soundcheck »

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #5 on: June 10, 2009, 10:39:27 AM »
Alsamixer settings are made persistant:

Code: [Select]
sudo alsactl store
the settings will be stored in /etc/asound.state

it has to be made sure that asound.state is made persistant.

Note: The 2nd soundcard will be accessed with alsamixer -c1 ( 1 stands for index 1  soundcard type: cat /proc/asound/cards)

Now I need to get the soundcard indexes fixed to avoid random indexing.
I need to figure out the syntax of how to apply parameters to the alsa modules on TCL.

I assume I need to edit /etc/modprobe.conf

I'll try

options snd-hda-intel index=1
options snd-usb-audio index=0 # alsa default


Let see.





 


Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #6 on: June 16, 2009, 05:44:42 AM »
Hi there.

I hope somebody can help.

Two more issues:

1. I don't get the soundcard to work anymore!
 
   It seems that the environment variable for the USB device  "-D $env{DEVNAME}"  in the above UDEV rule is not set. This    prevents my system from loading the firmware to the device.
    BTW: lsusb is showing that the soundcard is available.  What could be the issue.
 
    No idea, how I managed to get it working earlier.

2. The modprobe.conf exercise from last post also didn't work. However first I need to get 1. settled.


THX

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #7 on: June 25, 2009, 07:55:55 AM »

Hmmh. No it is working again.

Now my X seems to be broken "black background" and no windows management possible.

Weired.  ???

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #8 on: June 25, 2009, 09:50:52 AM »

I am back on track. Strange. I had a package missing usb-serial. Now it seems to work.  :P

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #9 on: June 25, 2009, 10:17:25 AM »
One more. My firmware and firmware loader are currently stored under /opt/mad.
That's the place where UDEV looks for them.

NOW: My soundcard firmware should be loaded before Alsa starts.

Will /opt be restored before Alsa is started?

If not, where can I store my binary so that UDEV finds it before Alsa is started?

THX a lot.

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: M-Audio Transit: UDEV and firmwareload ?
« Reply #10 on: July 14, 2009, 04:28:14 AM »
Hi there.

Just to avoid loose ends, I post my final working solution.

I still had problems with above UDEV rule. I finally wrote a small script which is started by UDEV. This works quite well.
(Tested on Tiny Core 2.2rc1)


My final config looks like that:

/etc/udev/rules.d/24-madfuload.rules
Code: [Select]
ACTION=="add", SUBSYSTEM=="usb", ENV{PRODUCT}=="763/2806/*", RUN+="/opt/mad/madfu.sh"


/opt/mad/madfu.sh
Code: [Select]
#!/bin/bash
# This script loads the firmware on M-Audio Transit. The script can be started  by a UDEV rule
# UDEV-RULE: ACTION=="add", SUBSYSTEM=="usb", ENV{PRODUCT}=="763/2806/*", RUN+="/opt/mad/madfu.sh"
# Rev 1
#

MADFUDIR=/opt/mad
BUS=$(lsusb | grep Transit |cut -d " " -f2)
DEVICE=$(lsusb | grep Transit |cut -d " " -f4 | cut -d ":" -f1 )
$MADFUDIR/madfuload -l -3 -f $MADFUDIR/ma006101.bin -D /dev/bus/usb/${BUS}/${DEVICE}

exit 0

Don't forget to make above peristent. ;)


Good luck.