Active Topics

 


Reply
Thread Tools
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#61
Maemo is actually pretty much like desktop Linux regarding sound. There are only a few differences:
- PulseAudio runs in system mode
- PulseAudio is somewhat-patched and the protocol is partially incompatible with newer PulseAudio client libraries (was this fixed in SSU?)

You are also overrating the special Nokia codecs effect on battery life -- http://tuomas.kulve.fi/blog/2009/11/...on-ogg-vs-mp3/
 

The Following 3 Users Say Thank You to javispedro For This Useful Post:
Posts: 72 | Thanked: 184 times | Joined on Apr 2011 @ Germany
#62
Originally Posted by fpp View Post
I will try it of course, but what a really strange command line !

Are those separators really exclamation marks ? :-)
Yes They separate the elements in a gstreamer pipeline. Looks strange, you're right.

I also have my doubts about the "audioconvert ! audioresample" parts on there, are they really necessary ?
I don't like the idea of the signal being reprocessed (what for ?), and it could possibly be the cause for the stuttering...
I just copied this from the gstreamer documentation, guess it's necessary if sample format and sample rate of source and sink do not match. But I tried without those two, works also well.

Some additonal observations:
  • Putting the device to offline mode helps
  • One should plug in the headphones, because else a highpass filter is applied to protect the speakers, which degrades sound quality and steals some cpu time
  • Lock the screen
  • it may help (not tested) to give some gstreamer processes higher priority

The first two points reduced the stuttering quite a lot, so probably on an overclocked n900 it will be perfectly fine. But any activity (task switching, using of player interface) leads to drop-outs (at least here). So increasing task priority or some audio buffer size(? but how) could help. Oh, and you'll need to install the gstreamer0.10-alsa package if you didn't already.
 

The Following 2 Users Say Thank You to Oblomow For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#63
Originally Posted by javispedro View Post
Maemo is actually pretty much like desktop Linux regarding sound. There are only a few differences:
- PulseAudio runs in system mode
- PulseAudio is somewhat-patched and the protocol is partially incompatible with newer PulseAudio client libraries (was this fixed in SSU?)

You are also overrating the special Nokia codecs effect on battery life -- http://tuomas.kulve.fi/blog/2009/11/...on-ogg-vs-mp3/
Thanks, it's great to know. So, why usual ways of redirecting pulseaudio output to 2nd card doesn't work here?

/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: 189 | Thanked: 171 times | Joined on Jul 2011
#64
Originally Posted by Estel View Post
Thanks, it's great to know. So, why usual ways of redirecting pulseaudio output to 2nd card doesn't work here?

/Estel
Possibly similar to the reason why a mouse did not work on the n900, the necessary parts for it were not implemented (as the developers did not think it would be necessary on a phone, they forgot people like us )
Probably the pulseaudio source they use (if it is one of the open Maemo components) has to be patched to enable a 'normal' behaviour... I mean, using a mouse is normal in the Linux world and it was not there :P
 

The Following User Says Thank You to pablocrossa For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#65
Originally Posted by Oblomow View Post
Yes They separate the elements in a gstreamer pipeline. Looks strange, you're right.
I just copied this from the gstreamer documentation, guess it's necessary if sample format and sample rate of source and sink do not match. But I tried without those two, works also well.
Okay, I can reproduce both the good & bad news, no problem :-)

I tried the simplified command line directly (no audioconvert/audioresample).

Had media player playing some flacs through the DAC *and* the phone jack at the same time, with a noticeable delay between the two :-)

Stutter is bad, yes, at least if you try to do anything else...

My impression is that most of it is due to screen activity. Any time the display changes the sound is disrupted. Heck, even the media player alone manages to disrupt itself when the blue progress bar updates :-)

OTOH, bringing a very static display to the foreground (like xterm), and letting the screen blank itself, results in al most perfect playback. There is still the occasional hiccup, probably a daemon waking up or flash memory access :-)

So now we have another piece to the puzzle, as you have proved that "standard output" can de redirected to out USB device. It's just that all the pieces don't quite fit together yet :-)
__________________
maemo blog
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#66
MAFW's auto-renices itself to an higher priority, so maybe you could also do that
 

The Following 2 Users Say Thank You to javispedro For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#67
Originally Posted by Estel View Post
Thanks, it's great to know. So, why usual ways of redirecting pulseaudio output to 2nd card doesn't work here?
It did work for me when I tried to do RTP over-the-network redirection (the quality and latency were not good though, the details should be in the two years-old pulseaudio network thread). I do not have USB speakers to test setting up another alsa sink in pulse though, so if the problem is that the kernel crashes (?) no idea.
 

The Following 2 Users Say Thank You to javispedro For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#68
Originally Posted by Estel View Post
smplayer is great mplayer front-end available from repositories. Of course, as it's still mplayer, it doesn't allow to use DSP assist in decoding... Yet, its using GUI and settings, to allow doing every thing that you can do with mplayer via terminal (at least, things that I'm aware of), adding to it every function that You would expect from GUI media player, like manipulating playlists, normalizing volume etc.
Well, either it was acting up on me yesterday, or I was being even more stupid than usual, but I couldn't get it to find my music files on the sdcard :-)

Tonight was a better moon or something, and it's playing right now, and as you said, it works real well...

The UI is a bit crazy, like with all big desktop apps ported to Maemo "as is" :-)

The CPU load looks quite reasonable, and stable enough. No stutter, even when moving around other screens.

All in all, this is the closest thing to a usable solution I've seen so far.

As with MOC, I really wish the N900 rocker keys could be used for something else than volume up/down (that would be controlled by the external DAC/amp anyway). I'd settle for "pause" on one side, and "next" on the other, as I mostly use Shuffle mode anyway...
__________________
maemo blog
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#69
Originally Posted by fpp View Post
So now we have another piece to the puzzle, as you have proved that "standard output" can be redirected to out USB device. It's just that all the pieces don't quite fit together yet :-)
Despite fact that Oblomow's idea/experiment is great "side-channel" attack on our current problem and I'm very thankful for it, it's not exactly like that.

Standard output is unaffected there - it's just that, at some point (close to end) You're "splitting" output to two sources. "cloning" it. Now, this second branch, is directed @ external DAC.

This approach seems to be most resource-intensive, as device is doing the same sound-related work literally twice (well, except actual media decoding). Which, of course doesn't change the fact, that investigating recaller code was a brilliant idea, and I would not think about something like that in thousand years.

Still - correct me if I'm wrong - we can't scavenge knowledge learned here, to achieve our main goal. What about investigating Maemo's pulseaudio code? Maybe it's really some "uncomment" work to allow hassle-free redirecting of output (like disabled mouse)?

/Estel

// Edit

And what about mafw-wrapper? Is it closed source? Maybe we can alter it to pout sound to external DAC instead of pulseaudio?
__________________
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!

Last edited by Estel; 2012-04-04 at 21:10.
 

The Following 2 Users Say Thank You to Estel For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#70
Thanks for correcting my misunderstanding.

I don't think I'd be up to analysing and hacking C or C++ systems code though... just wouldn't know where to start :-)
__________________
maemo blog
 

The Following User Says Thank You to fpp For This Useful Post:
Reply

Tags
h-e-n, usb audio


 
Forum Jump


All times are GMT. The time now is 14:37.