![]() |
Re: [Announce] USB hostmode beta release
Quote:
Quote:
/Estel |
Re: [Announce] USB hostmode beta release
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...
|
Re: [Announce] USB hostmode beta release
Quote:
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? |
Re: [Announce] USB hostmode beta release
@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... |
Re: [Announce] USB hostmode beta release
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! |
Re: [Announce] USB hostmode beta release
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-audioCode:
cat /proc/asound/cardsCode:
mplayer FILE.mp3 -ao alsa:device=hw=1.0recording with arecord 44.1khz 16-bit stereo wav: Code:
arecord --device=hw:default,DEV=0 -f cd -t wav FILE.wavI 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?:D |
Re: [Announce] USB hostmode beta release
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... Quote:
I hope someone can chime in on how to do this... Many thanks for sharing your results ! |
Re: [Announce] USB hostmode beta release
Quote:
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... |
Re: [Announce] USB hostmode beta release
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 ! |
Re: [Announce] USB hostmode beta release
Quote:
Quote:
|
Re: [Announce] USB hostmode beta release
Quote:
I've found a way to circumvent this somewhere on the net: (needs gainroot package or however it's called) Code:
rootThen look if on restarting pulseaudio/reboot a new sink appears... I have not tried this myself yet, but would be very interested in your findings... A second, a bit more brutal alternative could be just changing the device number in default.pa, and reboot. But you should take the possibility into account that you have to reflash - I cannot afford to try atm :) |
Re: [Announce] USB hostmode beta release
Quote:
Quote:
BTW, do you know what the last (percent) value on the mplayer console status line means ? From the docs it could be the audio CPU usage, but I'm not sure. On my N900 it shows about 20% while playing an MP3 file, and much lower for FLAC (around 3%, never reaching 5). Also, the CPU meter bar (in the Hildon status bar) never moves while decoding Flac, while it sometimes jumps up & down with mp3. EDIT - PS: that workaround for pacmd is not working as-is... I get : "Daemon not responding"... |
Re: [Announce] USB hostmode beta release
Quote:
Quote:
|
Re: [Announce] USB hostmode beta release
It does that even without h-e-n and the DAC plugged in...
|
Re: [Announce] USB hostmode beta release
Quote:
|
Re: [Announce] USB hostmode beta release
Share it somewhere? Document it? It's pity, when such work - even if done just for Your use case - is lost/not used/someone must do same work again.
/Estel |
Re: [Announce] USB hostmode beta release
Quote:
|
Re: [Announce] USB hostmode beta release
kirillkk,
I had never heard of "moc", and it's not easy to Google, but I found this, is that it ? : http://moc.daper.net/about If I understand correctly, as you could not configure pulse to redirect the default audio output to USB, instead you chose to use a music player (moc) that can be (compiled ? configured ?) to use any ALSA output, like Oblomow did with his mplayer example. I too would be interested in the moc binary, if only to experiment further with N900+DAC. I like the idea of a lean, mean console player. I'm still trying to find out if it has a "shuffle all" function and if it can work with an untagged music collection, as this is my main use case... Thanks for contributing ! EDIT: tried it out on Ubuntu, documentation is a bit fluffy, but the app looks good... Works without tags, does shuffle well. Found a post on how to set the ALSA output in the config file... so yes, would be well worth trying out on the N900 ! |
Re: [Announce] USB hostmode beta release
1 Attachment(s)
Quote:
Attached moc is compiled from "vanilla" 2.4.4 source on scratchbox. Enter key didn't work initially, so I added special enter key mapping both to the source and moc keymap configuration (n900_keymap in moc.tar.gz). I don't remember which libraries are needed. I found the following debs in apt archives, they are probably needed by moc plugins. libsamplerate0_0.1.3-1maemo0_armel.deb libvorbis0a_1.2.3.tk1_armel.deb libvorbisenc2_1.2.3.tk1_armel.deb libvorbisfile3_1.2.3.tk1_armel.deb libogg0_1%3a1.1.3-2.tk2_armel.deb libresample1_0.1.3-5_armel.deb libid3tag0_0.15.1b-10maemo1_armel.deb libmad0_0.15.1b-2.1maemo1_armel.deb libflac8_1.2.1-1.1maemo3_armel.deb Installation script follows: ------------------- tar xzf moc.tar.gz cd moc mkdir -p /usr/local/lib/moc/decoder_plugins mv *.so /usr/local/lib/moc/decoder_plugins mv mocp /usr/local/bin ln -s /usr/local/bin/mocp /usr/bin/mocp mkdir /home/user/.moc mv config n900_keymap /home/user/.moc cd .. rmdir moc ------------------- |
Re: [Announce] USB hostmode beta release
Thanks for sharing. OTOH, do we have any clue why redirecting *whole* audio to USB via pulseaudio doesn't work? AFAIK, it's point of pulseaudio as a whole...
/Estel |
Re: [Announce] USB hostmode beta release
Quote:
So I gave up. Also for my application, I don't want system sounds to come through usb device. One more thing. I don't know how pulseaudio would handle removal of usb device. I'm afraid, it won't recover. By the way, do we have pulseaudio source for n900? |
Re: [Announce] USB hostmode beta release
Would you mind sharing your experiments with PulseAudio, in case you still know what you did then? Even if it wasn't successful, it may help.
PS: Thanks a lot for moc! PPS: If I remember correctly, even in /proc/asound/devices the usb device still showed up after removing it... so I guess you're right about pulse audio not likely to recover. |
Re: [Announce] USB hostmode beta release
Thanks kirillkk for the binary & instructions !
I will try this out and see how it goes... |
Re: [Announce] USB hostmode beta release
thanks for the highly intriguing and helpful contributions :-)
Now please consider moving the subthread over to "problems", it seems getting a bit OT here. Thanks jOERG |
Re: [Announce] USB hostmode beta release
Sorry joerg, you already asked once and we didn't comply :-)
Actually I guess this topic doesn't even belong in the "problems" thread either, as the h-e-n part is mostly solved now. We are more into redirecting pulseaudio and/or client software and such... I think I'll create a new topic dedicated to this particular use case (the "what" and "why" rather than "how"), to end the OT here, and maybe find other interested users who are not following this one. I have just one last question about h-e-n, maybe covered elsewhere : I understand h-e-n is a GUI for a bunch of scripts which handle the actual USB host stuff. Are these documented somewhere ? I would like to know if it is possible to automate the select-speed/apply-power/enumerate steps in a script before launching other software... Thanks, fp |
Re: [Announce] USB hostmode beta release
Quote:
for the question about scripting hostmode, yes, blueled's scripts a few pages back are *exactly* about that. Also source of H-E-N GUI is rather trivial to read and understand what's going on. The actual core code are like 20 lines that do the whole 'magic'. /j |
Re: [Announce] USB hostmode beta release
Quote:
But the question was given in this thread so the answer follows. I repeated the experiment with pulseaudio. 1. Code:
pactl load-module module-alsa-sink-old sink_name=sink.hw2 device=hw:1 rate=48000 fragment_size=1920 fragments=4 alt_fragment_size=960 alt_fragments=23. playing music using maemo media player - nothing happens no sound and it doesn't advance 4. pactl move-sink-input 2 2 (returned to normal setting) - playback works 5. connected usb device 6. verified it works in moc 7. pactl move-sink-input 2 7 8. attempt to play music 9. device reboots USB device is m-audio mobile pre. pulse configuration can be verified with pactl list. pactl is in pulseaudio-utils package |
Re: [Announce] USB hostmode beta release
Thanks for sharing, but You could just post this whole reply in new thread, and drop a link here ;) The way it is instead, we will never end off-topic.
|
Re: [Announce] USB hostmode beta release
Yes we will, I'm working on the new topic, and will link here :-)
|
Re: [Announce] USB hostmode beta release
and I will ask mods if they consider this attitude of "I don't care, the thread already *is* OT so I answer OT here" similarly offensive :-(
|
Re: [Announce] USB hostmode beta release
All right, new topic created and fleshed out :
http://talk.maemo.org/showthread.php?t=83270 Everyone interested, please head over there... the fun continues :-) Thanks for your help & patience joerg ! |
Re: [Announce] USB hostmode beta release
I was wondering if anyone was successful in using usb host mode to make the N900 a wireless router using the WIRED profile wonderfully described in http://talk.maemo.org/showpost.php?p...&postcount=127
i tried to do that with qt mobile hot spot and joikuspot and wasn't successful: using joikuspot i cannot see the WIRED profile at all, and with QT Mobile hot spot i do see it, but choosing it makes it still try to use the 3G network. Does anyone know how to make it work? The reason i need that is that i have laptop computer of my company which i am not an administrator on (so i cannot install anything on it including nokia's software), and only has windows terminal capabilities to home/work desktop machines, so i need to set up the n900 as a true router at my hotel to make both of them internet accessible (since at the hotel i only have wired connection from the room) |
Re: [Announce] USB hostmode beta release
Is it possible to connect an NTFS disk on key in read/write mode?
I am only able to connect it as read only - when trying to create folder on it i get: can't create directory 'aaa': Read-only file system i read a little about this issue and checked that i have this installed: kernel-module-ntfs 2.1.29-maemo1 Windows Read/Write NTFS file driver but doesn't help. |
Re: [Announce] USB hostmode beta release
Quote:
Have fun :) |
Re: [Announce] USB hostmode beta release
Quote:
Reading package lists... Done Building dependency tree Reading state information... Done ntfs-3g is already the newest version. so i guess this is probably not the problem... |
Re: [Announce] USB hostmode beta release
Is the module loaded?
What about package kernel-module-ntfs from maemo repos? This one is loaded on boot and helped me. |
Re: [Announce] USB hostmode beta release
Quote:
Code:
mount -o remount,rw /media/<Insert-mount-name-here> |
Re: [Announce] USB hostmode beta release
Quote:
However, i am not able to mount it again in read/write mode - even if i returned the script to its original form and retry your command. I tried also to connect the usb key to my laptop and scan for errors - just to make sure that nothing was wrong because of the dismount, but still after this i cannot connect it again in write mode using hen and getting the "Read-only file system" again when trying to do write operation. i tried manually running the following after the "Enumerate" button press in hen: mkdir -p /media/sda1 modprobe ntfs mount -w -o uid=29999,gid=29999,utf8,dmask=027,fmask=137 /dev/sda1 /media/sda1 mount -o remount,rw /media/sda1 all the commands went with no errors, and /media/sda1 is accesible in read only mode. one more thing i did which i don't know if might affect this is add the -f -l parameters to the umount command in the "mount.sh" script (because for some reason it refused to dismount the first time). |
Re: [Announce] USB hostmode beta release
Found a workaround - i'm mounting the ntfs disk from easy debian - there i have R/W working.
|
Re: [Announce] USB hostmode beta release
please keep discussions about mounting etc out of this thread! See post #9
For the rest of you I created a little scriptie that at least for me does completely 'hidden' (non-interactive) hostmode, I.E. you can start it from shell as root, or via single click on a icon with according .desktop (use sudo there, adjust your sudoers.d/ by adding a file named start-hostmode...) Obviously it's meant to get started _after_ plugging in your memstick/whatever. Be patient, I had to implement a few delays to allow things to settle, so give it a minute. Last thing it does is invoking the original mount script by mohammad, which in turn shows a short notification about "successfull mount" http://maemo.cloud-7.de/maemo5/usr/sbin/start-hostmode (does highspeed "echo hosth >/sys...") To stop hostmode, you kill the script - in shell for example you do Ctrl-C. ATTENTION! This doesn't do proper umount! I eventually might fix this. /j ps: this script is a marginally augmented version of "improved booston script" as shipping with new version of h-e-n mentioned in next post |
| All times are GMT. The time now is 15:34. |
vBulletin® Version 3.8.8