Reply
Thread Tools
Estel's Avatar
Posts: 4,748 | Thanked: 7,748 times | Joined on Mar 2011
#1001
Originally Posted by pigeond View Post
However, before that, you need the alsa midi drivers. I had to compile them myself since they don't come with the n900 kernel packages. I'm using 2.6.28.10-power49 (power kernel).
Could You consider submitting modules in question to kernel-power team? It would be nice to have them included in KP.

Originally Posted by fpp
Would you happen to know what driver(s) would be needed to make the N900 output digital sound through its USB port in host mode, just like a desktop Linux does when connected to an external DAC ?...
USB networking + pulseaudio? Or do You mean some "client mode" DAC, that require certain format sent and is not configurable (so no USB networking for it)?

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following 2 Users Say Thank You to Estel For This Useful Post:
Posts: 1,928 | Thanked: 7,375 times | Joined on May 2010
#1002
For audio output from N900 is NOT host mode needed. Instead g_nokia or g_file_storage, you can load g_audio module. It is USB audio gadget, which do what you want (it acts as usb sound card). You also need to configure pulseaudio for that support and compile kernel with g_audio module...
 

The Following 4 Users Say Thank You to pali For This Useful Post:
Posts: 64 | Thanked: 124 times | Joined on Apr 2011 @ Germany
#1003
Originally Posted by pali View Post
For audio output from N900 is NOT host mode needed. Instead g_nokia or g_file_storage, you can load g_audio module. It is USB audio gadget, which do what you want (it acts as usb sound card). You also need to configure pulseaudio for that support and compile kernel with g_audio module...
While this is amazing on it's own, I think fpps question was related to the use of external usb audio devices with the n900 (e.g. usb speakers). This was discussed before for example in http://talk.maemo.org/showthread.php?t=71980, but AFAIK without reporting success.

I would be very interested in this, too, especially for usb audio recording, as I have a small mixing console which behaves like a standard usb audio device. This, together with audacity from easy debian, could turn the n900 in a nice portable digital harddisk recorder, which would be pretty cool

I have tried in the past a bit with the snd-usb-audio module, but without success. Anyone could give some hints? After modprobe snd-usb-audio, should it appear automatically in alsa or is there more work to do?
 

The Following 3 Users Say Thank You to Oblomow For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 953 times | Joined on Nov 2005
#1004
@Estel : no, not USB networking, rather what you call "client DAC" -- see examples below

@pali : this is astounding. Does it really answer the question in the thread Oblomow pointed to ?
Meaning, sending out digital audio signal through N900's USB port to an external device ? Without USB
host support ?

@Oblomow : yes, that is the idea, although my use case is a little different.
My idea would be to re-purpose my N900 as an "audiophile-grade" portable music player. I would use its internal 32GB (+SD card) for MP3/FLAC storage, its CPU/touchscreen for the UI (probably Rockbox), but not its audio system (internal DAC and amplifier).

The challenge is to get the decoded digital audio stream out through the USB port, and feed that to a portable DAC+amp combo such as one of these :

http://www.fiio.com.cn/product/index...&MenuID=020301
http://www.fiio.com.cn/product/index...&MenuID=020301
http://www.ibasso.com/en/products/show.asp?ID=73
(there are many more :-)

These gizmos behave like external USB sound cards, so I'm pretty sure USB Host is needed. On a PC with Windows or Ubuntu, you just plug them in and the sound comes out...
__________________
maemo blog
 
Posts: 64 | Thanked: 124 times | Joined on Apr 2011 @ Germany
#1005
I was experimenting today a little bit and got one step further...
I was connecting the usb mixer (yamaha mw10c) to the n900 (with kp49), enabled host mode via h-e-n and entered "sudo modprobe snd-usb-audio" in a shell. Afterwards I started Audacity through Easy Debian's LXDE. Then in Edit->Preferences->Devices usb audio devices show up. The good news: recording seems to work, at least sometimes with sluggish performance, but I got something that sounds quite ok after exporting to a wave file and playing in another program. Which leads to the bad news: until now every attempt to play via usb leads to a frozen screen, beeping noise (like some binary garbarge) playing through the usb audio device and after some seconds a reboot. I haven't spent much time with this upto now, so there might just be something wrong with sample rate or format or whatever. Also Audacity is really slow when playing back through the default (n900) device, with lots of hiccups. But I will keep on trying, maybe I'll find some setting that actually works.

BTW, thanks to the authors of kernel-power and h-e-n for their great work!
 

The Following 4 Users Say Thank You to Oblomow For This Useful Post:
Posts: 64 | Thanked: 124 times | Joined on Apr 2011 @ Germany
#1006
Ok, got replay running. Little howto (for kp49):

Packages installed: alsa-utils,mplayer (all on maemo, not Easy Debian). Tested with Yamaha MW10c USB mixer.

first, connect device (standard usb audio device), start h-e-n, enable fullspeed, Vbus boost on, enumerate. Then, start an x-term and load the kernel module (probably not necessary, seems to be loaded by default):

Code:
sudo modprobe snd-usb-audio
check if your new audio device has appeared:

Code:
cat /proc/asound/cards
cat /proc/asound/devices
playing music with mplayer:

Code:
mplayer FILE.mp3 -ao alsa:device=hw=1.0
Plays perfectly, but CPU load is higher (40-50% compared to 15% when playing with mplayer through the internal DAC)

recording with arecord 44.1khz 16-bit stereo wav:

Code:
arecord --device=hw:default,DEV=0 -f cd -t wav FILE.wav
(default is the name on my n900 for the usb device, check /proc/asound/cards if it's the same for you)
I got sometimes some overruns with arecord, maybe one can change the buffer size or something similar. Hope to get a workaround... apart from that it's nearly perfect.

Next step would be to reroute the standard output to the USB if someone's interested - should be possible with pulse-audio somehow, but I have no idea about that

Oh - and anyone's got an idea for a lightweight multi-track recorder?
 

The Following 5 Users Say Thank You to Oblomow For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 953 times | Joined on Nov 2005
#1007
W-O-W !

Oblomow, this is just incredible. I've been asking about this here and there for weeks, and suddenly here you come and it just works ! :-)

Now I'm going to have to reflash my N900 and see if I can reproduce all this with my DAC...

Next step would be to reroute the standard output to the USB if someone's interested - should be possible with pulse-audio somehow
Yes, that would probably be the last missing bit... so that we could use any audio player (like the Maemo Rockbox port) and not only mplayer.

I hope someone can chime in on how to do this...

Many thanks for sharing your results !
__________________
maemo blog
 

The Following User Says Thank You to fpp For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 953 times | Joined on Nov 2005
#1008
Originally Posted by Oblomow View Post
Ok, got replay running. Little howto (for kp49):
Packages installed: alsa-utils,mplayer (all on maemo, not Easy Debian).
I can't seem to find "alsa-utils" in application manager, although it's supposed to be in maemo.org... Is it in some special repo ?...

EDIT : never mind, I tried with apt-get, and it seems I already have the latest version, although it doesn't show up in HAM...
__________________
maemo blog

Last edited by fpp; 03-18-2012 at 11:54 AM.
 
fpp's Avatar
Posts: 2,853 | Thanked: 953 times | Joined on Nov 2005
#1009
All right, status report :

To my great surprise, it worked perfectly at first try :-)
Thanks again Oblomow for the detailed instructions !

After installing kp49 and h-e-n, I connected the N900's usb output to my DAC's input.

After the three-step h-e-n setup the DAC's LED turned to green, and cat /proc/asound/cards showed a detailed description of it.

Then the magic command (mplayer FILE.mp3 -ao alsa:device=hw=1.0) played everything through the DAC, yay ! :-)

So now we have a definite proof of concept that it is doable.

What's left is about usability on a day-to-day, on-the-go basis :

* a script that automates h-e-n speed/VBus/enumerate

* redirection of the standard sound output to USB so that any music player can be used

* buy a new battery, because h-e-n seems to suck down fast, although the DAC has its own power :-)

Getting really close now, thanks to you !
__________________
maemo blog
 

The Following 2 Users Say Thank You to fpp For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 953 times | Joined on Nov 2005
#1010
Originally Posted by fpp View Post
* redirection of the standard sound output to USB so that any music player can be used
From the Pulseaudio website it looks like this should be easily scriptable using the pacmd utility and the CLI syntax, something like :

pacmd set-default-sink X
Unfortunately, pacmd does not seem to be in the Maemo version of pulseaudio, and the examples from the web site don't seem to work. As usual :-)
__________________
maemo blog
 

The Following 2 Users Say Thank You to fpp For This Useful Post:
Reply

Tags
bada rox, detection, h-e-n, hostmode, speed, usb host

Thread Tools

 
Forum Jump


All times are GMT -4. The time now is 03:23 AM.