Linux Audio the way to go!? - Page 195 - diyAudio
Go Back   Home > Forums > Source & Line > PC Based

PC Based Computer music servers, crossovers, and equalization

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 22nd April 2011, 05:15 AM   #1941
Account disabled at member's request
 
Join Date: Aug 2007
Quote:
Originally Posted by phofman View Post
It all depends on your applications and alsa chain configuration. If your system supports playing multiple streams at the same time, it must resample to common frequency. Therefore, if your system is using pulseaudio (any modern desktop distribution in default configuration) or alsa plugin dmix (the "default" device as defined by alsa packages), it is resampling. If you tell your playback applications to output directly to device "plug:hw:YOURCARDNAME", no resampling occurs for sampling rates supported by your card. But only a single stream can be played (all other concurrent attempts end up with "device busy" error) which is unacceptable for general use desktop.

It is all in your hands
My hands ? oh dear....less coffee.....

So it seems Ubuntu is resampling. Bummer. Well, I only use that PC for music so I'd be happy if all it did was play single stream.

Um, sorry to ask this, but how do I do this for Rhythmbox :

"plug:hw:YOURCARDNAME"

or do I need a different player ?


Sorry for the noob question ! Thanks !

Last edited by KlipschKid; 22nd April 2011 at 05:21 AM.
  Reply With Quote
Old 22nd April 2011, 08:29 AM   #1942
Account disabled at member's request
 
Join Date: Aug 2007
Smile All good !

Quote:
Originally Posted by OllBoll View Post
Yes, as far as I know that is the default.
Yep, I opened up the daemon.conf and 44/16 is what everything is getting resampled to - so no resampling for native 44/16 files. Phew.

Quote:
Originally Posted by OllBoll View Post
The resampling algorithm used isn't astronomically good, but isn't as bad as it was in the beginning of pulseaudio in ubuntu where it was awful.
I copied and edited the daemon.conf file to use the best quality src. The Atom processor is at 35% just playing tunes. Curiously, the board is Intel D945gsejt which is an N270 single core cpu, but Ubuntu system monitor shoes two cores with differing loads. Odd.

I also followed the instructions you posted and on Linux mint and found my buffer size is 262144 and 131072 so I plugged in 2 and 92.879819 milli secs.

It's all good !I'm gonna play with the settings in the daemon.conf file and see how that affects sound quality and processor load but is all working well so no real need, just curious.

Thank you very very much for your help !
  Reply With Quote
Old 22nd April 2011, 11:42 AM   #1943
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by KlipschKid View Post
copied and edited the daemon.conf file to use the best quality src. The Atom processor is at 35% just playing tunes. Curiously, the board is Intel D945gsejt which is an N270 single core cpu, but Ubuntu system monitor shoes two cores with differing loads. Odd.
The single core uses hyperthreading - two processing pipes. Each pipe has a different load.

The best quality src method is pretty demanding, 35% of atom cpu is no surprise.

Quote:
Originally Posted by KlipschKid View Post
I also followed the instructions you posted and on Linux mint and found my buffer size is 262144 and 131072 so I plugged in 2 and 92.879819 milli secs.
Since your playback chain takes so much CPU, I suggest to keep the buffer as large as possible, split to more than 2 fragments, at least 4. This way you minimize the danger of buffer underruns when your system hits load peaks.
  Reply With Quote
Old 22nd April 2011, 01:10 PM   #1944
Account disabled at member's request
 
Join Date: Aug 2007
Hi,

Ah, that makes sense......the bios has these settings but I was a little confused as I thought it didn't have anything like speed step, but it was just my ignorance....again.

Thanks for the tip. ! Is there any way to track possible underruns by using a code in a terminal ? So far, I haven't heard any deficiencies and in fact, it sounds very good indeed.

Totally Chuffed !
  Reply With Quote
Old 22nd April 2011, 01:11 PM   #1945
OllBoll is offline OllBoll  Sweden
diyAudio Member
 
Join Date: Nov 2010
Quote:
Originally Posted by KlipschKid View Post
My hands ? oh dear....less coffee.....

So it seems Ubuntu is resampling. Bummer. Well, I only use that PC for music so I'd be happy if all it did was play single stream.

Um, sorry to ask this, but how do I do this for Rhythmbox :

"plug:hw:YOURCARDNAME"

or do I need a different player ?


Sorry for the noob question ! Thanks !
Of course Ubuntu is resampling, all OSes do that as far as I know, unless they are told not to =)

Pulseaudio which is the default however does not resample if source material sampling rate is the same as the output sampling rate defined in daemon.conf. So if 99.9 % of your library is the same sampling frequency, probably 44100 hz and you set that in daemon.conf it will never resample those files.

If you have a good enough algorithm for resampling its basically whatever though. The problem with resampling is when it's done with crappy quality and not and not resampling itself, as far as I know practically every modern dac uses resampling anyway.

If you absolutely doesn't want to resample in Ubuntu it's possible but not with rhythmbox since it doesn't allow you to control the output. If you want to do that then you are better off with mpd, where you can specify to output directly to the hardware.

Doing this as explained earlier by phofman prevents you from playing multiple sounds at the same time but if it's a primarily music PC then that of course isn't really a problem. I did this myself until pulseaudio became good enough to stop all crackling and such.

Footnote: if your using pulseaudio and want to check if you are resampling you can test this by setting "resample-method = src-sinc-best-quality" and then check for cpu usage when listening, if music is played without pulseaudio eating 20-50 % cpu then no resampling is done =)
  Reply With Quote
Old 22nd April 2011, 01:59 PM   #1946
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by KlipschKid View Post
Is there any way to track possible underruns by using a code in a terminal ?
If your kernel is compiled with option CONFIG_SND_PCM_XRUN_DEBUG, you can monitor xruns in /proc/asound , see XRUN Debug - AlsaProject . However, I doubt distribution kernels have it enabled, at least mine in ubuntu does not.

Quote:
Originally Posted by KlipschKid View Post
So far, I haven't heard any deficiencies and in fact, it sounds very good indeed.
Xruns are loud cracks, often easy to detect audibly.
  Reply With Quote
Old 22nd April 2011, 02:38 PM   #1947
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by OllBoll View Post
If you absolutely doesn't want to resample in Ubuntu it's possible but not with rhythmbox since it doesn't allow you to control the output. If you want to do that then you are better off with mpd, where you can specify to output directly to the hardware.
Rhythmbox uses gstreamer, sink called musicaudiosink. Unfortunately configuration of this sink is not supported in gstreamer-properties (unlike audiosink) , the "multimedia configuration" screen of ubuntu. You can change the musicaudiosink value to alsasink and specify name of the actual alsa device using graphical gconfd-2 or text gconftool-2. For parameters see alsasink .

BUT this is global setting for all gstreamer applications which sucks. I am afraid the gstreamer library cannot be configured by environment variables, thus allowing individual settings for each running application. Perhaps running proper gconftool-2 commands prior to each application would do but it is certainly not documented or recommended. I do not like the gstreamer rigidity.
  Reply With Quote
Old 26th April 2011, 08:31 AM   #1948
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
Hi folks.

Just to let you know.

96k & 44k1 tracks played with Clementine via pulseaudio sink:

Code:
me@pc1:/proc/asound/card0/pcm0p/sub0$ cat hw_params 
access: MMAP_NONINTERLEAVED
format: S32_LE
subformat: STD
channels: 8
rate: 96000 (96000/1)
period_size: 4096
buffer_size: 8192
me@pc1:/proc/asound/card0/pcm0p/sub0$ cat hw_params 
access: MMAP_NONINTERLEAVED
format: S32_LE
subformat: STD
channels: 12
rate: 44100 (44100/1)
period_size: 2048
buffer_size: 4096

Clementine seems to play the native rates.

Issue: I need to manually switch samplerates on the HDSP9632 card itself.
A HDSP driver issue. Under Windows the driver switches automatically samplerates.

Last edited by soundcheck; 26th April 2011 at 08:34 AM.
  Reply With Quote
Old 26th April 2011, 09:14 AM   #1949
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by soundcheck View Post
.....
format: S32_LE
rate: 96000 (96000/1)
....
format: S32_LE
rate: 44100 (44100/1)
[/CODE]
Your card supports 32 bits only, the hw_params does not reveal anything about the playback chain bit width.

Linux/sound/pci/rme9652/hdsp.c - Linux Cross Reference - Free Electrons


What I find interesting it that pulseaudio would switch sample rates when fed various tracks. I always thought pulseaudio would run at fixed configured sample rate. Are you really sure the audio sink was pulseaudio?
  Reply With Quote
Old 26th April 2011, 11:46 AM   #1950
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
Quote:
Originally Posted by phofman View Post
Your card supports 32 bits only, the hw_params does not reveal anything about the playback chain bit width.

Linux/sound/pci/rme9652/hdsp.c - Linux Cross Reference - Free Electrons


What I find interesting it that pulseaudio would switch sample rates when fed various tracks. I always thought pulseaudio would run at fixed configured sample rate. Are you really sure the audio sink was pulseaudio?
You are right.

I had alsasink and plughw:0,0 configured.
Just verified it.

neither pulsaudiosink nor alsasink hw:0,0 wouldn`t work on both rates.
Actually hw:0,0 is not working at all.

I'm more than happy though that at least the alsasink plug setting works.
Strange though that I do not get hw going. Perhaps that's prevented by pulseaudio, which stays in control about everything..
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



New To Site? Need Help?

All times are GMT. The time now is 06:27 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2