Active Topics

 


Reply
Thread Tools
Posts: 72 | Thanked: 184 times | Joined on Apr 2011 @ Germany
#1011
Originally Posted by fpp View Post
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
 

The Following 3 Users Say Thank You to Oblomow For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#1012
Originally Posted by Oblomow View Post
Hi, great to hear your DAC works with mplayer, and thanks a lot for your feedback!
Well, least I could do, right ? :-)

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"...
__________________
maemo blog

Last edited by fpp; 2012-03-18 at 20:45.
 

The Following 2 Users Say Thank You to fpp For This Useful Post:
Posts: 72 | Thanked: 184 times | Joined on Apr 2011 @ Germany
#1013
Originally Posted by fpp View Post

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.

Originally Posted by fpp View Post
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.
 

The Following User Says Thank You to Oblomow For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#1014
It does that even without h-e-n and the DAC plugged in...
__________________
maemo blog
 
Posts: 18 | Thanked: 38 times | Joined on Jan 2012
#1015
Originally Posted by Oblomow View Post

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.
 

The Following 2 Users Say Thank You to kirillkk For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#1016
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
__________________
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 User Says Thank You to Estel For This Useful Post:
Posts: 18 | Thanked: 38 times | Joined on Jan 2012
#1017
Originally Posted by Estel View Post
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's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#1018
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 !
__________________
maemo blog

Last edited by fpp; 2012-03-20 at 21:31.
 
Posts: 18 | Thanked: 38 times | Joined on Jan 2012
#1019
Originally Posted by fpp View Post
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
-------------------
Attached Files
File Type: gz moc.tar.gz (141.4 KB, 130 views)
 

The Following 4 Users Say Thank You to kirillkk For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#1020
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
__________________
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 User Says Thank You to Estel For This Useful Post:
Reply

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


 
Forum Jump


All times are GMT. The time now is 17:48.