maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   [Announce] USB hostmode beta release (https://talk.maemo.org/showthread.php?t=65232)

Oblomow 2012-03-18 18:48

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by fpp (Post 1181129)
From the Pulseaudio website it looks like this should be easily scriptable using the pacmd utility and the CLI syntax, something like :



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 :-)

Hi, great to hear your DAC works with mplayer, and thanks a lot for your feedback! Pacmd is in the package pulseaudio-utils, however it gives an error message when run from the shell ("No PulseAudio demon running, or not running as session daemon").

I've found a way to circumvent this somewhere on the net:
(needs gainroot package or however it's called)
Code:

root
su pulse
export PULSE_RUNTIME_PATH=/var/run/pulse
pacmd

However there may be no sink for your card. You could try to edit /etc/pulse/default.pa. There's a line starting with "load-module module-alsa-sink-old sink-name=sink.hw0 device=hw:0 ...". Try to copy that and change the sink-name to something else (sink.hw1 already exists, but I guess it's something different) and change the "device=hw:0" to "device=hw:1,0" (or maybe only "device=hw:1"?). I have no real clue how this all works in there.

Then 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 :)

fpp 2012-03-18 20:15

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by Oblomow (Post 1181152)
Hi, great to hear your DAC works with mplayer, and thanks a lot for your feedback!

Well, least I could do, right ? :-)

Quote:

I have not tried this myself yet, but would be very interested in your findings...
Thanks for the tips on pacmd. Of course I'm going to investigate pulseaudio (although you claim to know nothing about it, I know even less :-) and report back on how it goes...

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"...

Oblomow 2012-03-19 11:07

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by fpp (Post 1181176)

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.

Hmm, never paid attention to it. But I guess if it's in the docs it should be right :) But keep in mind that it's probably only the cpu usage from mplayer itself, not from mplayer + host mode driver. I used simply hxtop to get the total cpu usage.

Quote:

Originally Posted by fpp (Post 1181176)
EDIT - PS: that workaround for pacmd is not working as-is... I get : "Daemon not responding"...

Strange... though I've never run pacmd this with the usb dac attached. I'm going to experiment a bit and also to look into this in the evening if I will find the time.

fpp 2012-03-19 20:44

Re: [Announce] USB hostmode beta release
 
It does that even without h-e-n and the DAC plugged in...

kirillkk 2012-03-20 07:15

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by Oblomow (Post 1181152)

However there may be no sink for your card. You could try to edit /etc/pulse/default.pa. There's a line starting with "load-module module-alsa-sink-old sink-name=sink.hw0 device=hw:0 ...". Try to copy that and change the sink-name to something else (sink.hw1 already exists, but I guess it's something different) and change the "device=hw:0" to "device=hw:1,0" (or maybe only "device=hw:1"?). I have no real clue how this all works in there.

After reading pulse documentation I configured the USB device into pulse. Then pulse daemon just crashed when something is played back through. So I gave up on pulse and compliled moc for use with the external device.

Estel 2012-03-20 16:50

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

kirillkk 2012-03-20 19:24

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by Estel (Post 1182024)
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

I can share the moc binary. Is not packaged, but all required libs are already ported to maemo. As for pulse, I didn't succeed anyway.

fpp 2012-03-20 20:01

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 !

kirillkk 2012-03-21 11:09

Re: [Announce] USB hostmode beta release
 
1 Attachment(s)
Quote:

Originally Posted by fpp (Post 1182096)
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.

Right. Moc configuration allows to specify alsa device.

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
-------------------

Estel 2012-03-21 12:44

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


All times are GMT. The time now is 16:31.

vBulletin® Version 3.8.8