Linux Audio the way to go!? - Page 194 - 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 21st April 2011, 07:04 PM   #1931
adelias is offline adelias  Greece
diyAudio Member
 
Join Date: Feb 2005
Location: No Pasaran
While playing a 24bit file, check the format with cat /proc/asound/card0/pcm*p/sub0/hw_params.
  Reply With Quote
Old 21st April 2011, 08:06 PM   #1932
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by satgeek View Post
While playing a 24bit file, check the format with cat /proc/asound/card0/pcm*p/sub0/hw_params.

This depends on formats supported by the card. E.g. Envy24 cards accept only S32_LE, older cards only S16_LE. Yet the player can support 16 - 32 bits.
  Reply With Quote
Old 21st April 2011, 08:37 PM   #1933
mxb is offline mxb  Australia
diyAudio Member
 
Join Date: May 2008
Quote:
Originally Posted by soundcheck View Post
Hmmh. Didn't know that!

How do I check that out?
If your are using ALSA drivers, you can look at:

/proc/asound/card0/pcm0p/sub0/hw_params

While playing an audio file and you can see format, rate and bits. Substitute 'card0' with your soundcard ID.
  Reply With Quote
Old 21st April 2011, 09:43 PM   #1934
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by mxb View Post
/proc/asound/card0/pcm0p/sub0/hw_params
Linux Audio the way to go!?
  Reply With Quote
Old 22nd April 2011, 01:55 AM   #1935
OllBoll is offline OllBoll  Sweden
diyAudio Member
 
Join Date: Nov 2010
Footnote for this, if you aren't routing directly to hardware with alsa but use say pulseaudio, then this isn't useful since pulseaudio always outputs the number of bits specified by the sampling format in daemon.conf.

( /etc/pulse/daemon.conf or in userspace: ~/.pulse/daemon.conf )

So if you use pulseaudio, make sure you enter the right sampling format into that file, and when you're at it you can set sampling rate and upgrade your resampling alogorithm =)

// Olle
  Reply With Quote
Old 22nd April 2011, 02:07 AM   #1936
Account disabled at member's request
 
Join Date: Aug 2007
Quote:
Originally Posted by OllBoll View Post
Footnote for this, if you aren't routing directly to hardware with alsa but use say pulseaudio, then this isn't useful since pulseaudio always outputs the number of bits specified by the sampling format in daemon.conf.

( /etc/pulse/daemon.conf or in userspace: ~/.pulse/daemon.conf )

So if you use pulseaudio, make sure you enter the right sampling format into that file, and when you're at it you can set sampling rate and upgrade your resampling alogorithm =)

// Olle
What's Pulse's default ? 44.1/16 ? I'm just wondering if I need to do anything to tweak my setup ? I have 44.1/16 flac files playing through Rhythmbox in a standard Ubuntu 10.10 desktop installation and using an Envy24 soundcard - an Onkyo se-200pci.

Thanks !
  Reply With Quote
Old 22nd April 2011, 04:22 AM   #1937
OllBoll is offline OllBoll  Sweden
diyAudio Member
 
Join Date: Nov 2010
Quote:
Originally Posted by KlipschKid View Post
What's Pulse's default ? 44.1/16 ? I'm just wondering if I need to do anything to tweak my setup ? I have 44.1/16 flac files playing through Rhythmbox in a standard Ubuntu 10.10 desktop installation and using an Envy24 soundcard - an Onkyo se-200pci.

Thanks !
Yes, as far as I know that is the default.

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.

If you only play 16 bit audio then it's whatever, but since you probably don't it wouldn't hurt to fix the sampling format. Of what I found when searching the Envy24 is a 24-bit sound card, so should be able to receive atleast 24-bit, possibly 32-bit format.

Many 24-bit sound cards cannot receive 24-bit sound with s24le but instead wants 32-bit with s32le but ignore the foremost bits. My card Asus D2X for example does this. But enough of fluff and back to helping you =)

Even if you know this lots probably don't so I'm going to explain this from the beginning:

You create a text file named daemon.conf in ~/.pulse/ (~ is your home folder, so for me ~/ is equal to /home/olle/ )

if the folder .pulse doesn't exist you create it, but it should exist already. It is hidden though (the . in front) so if your using nautilus you can press CTRL+H to make it visible.


Now create the file daemon.conf

You can take the original file from /etc/pulse/daemon.conf and just copy the text and paste, it works so that if a line with say sampling format exists in the local file in your home folder it uses that, and if it isn't there it uses the sampling format in the /etc/pulse/daemon.conf file.

So in your case you can test to enter "default-sample-format = s24le" into the file on a line and that should be it.

( If you say want to change the resampling algorithm you just have to add another line with say "resample-method = src-sinc-medium-quality" )

Now kill pulseaudio with for example "pulseaudio -k" in the terminal for it to restart and test to play some audio. If it doesn't work, you can test to change sampling format to "default-sample-format = s32le" and test again.

When it's playing you can verify the bit depth by using cat /proc/asound/card[X]/pcm[Y]p/sub0/hw_params and check output.

If it plays 24 or 32-bit then it works, yay!

EDIT: since an example says more than many words I've included my daemon.conf as an example. daemon.conf - Pastebin.com

Last edited by OllBoll; 22nd April 2011 at 04:26 AM.
  Reply With Quote
Old 22nd April 2011, 05:33 AM   #1938
Account disabled at member's request
 
Join Date: Aug 2007
Thanks ! I never would have worked that out for myself ! ;-) I'll try this tomorrow.

My experience with Windows makes me think any resampling algorithm is bad news. Is this the same with Ubuntu ? I thought Linux didn't resample ? Does it just change the word length and not the sampling frequency ?

Thanks for the help - very much appreciated !
  Reply With Quote
Old 22nd April 2011, 05:59 AM   #1939
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
OllBoll, I will repeat the third time :-) Because of this:
Quote:
Originally Posted by OllBoll View Post
Many 24-bit sound cards cannot receive 24-bit sound with s24le but instead wants 32-bit with s32le but ignore the foremost bits. My card Asus D2X for example does this.
the following does not work:
Quote:
When it's playing you can verify the bit depth by using cat /proc/asound/card[X]/pcm[Y]p/sub0/hw_params and check output.

If it plays 24 or 32-bit then it works, yay!
You will always see S32le, no matter what the player uses internally. If the last element in user space sends a different format to these cards drivers, they refuse with the "Unsupported format" error. One case is the player consults the driver about supported formats and adjusts accordingly before sending the samples to alsa user-space API (libasound, alsa-lib), just as e.g. mplayer and probably pulseaudio do. For the rest of the players (e.g. sox, aplay) your alsa card definition configured in the player must include the plug plugin (plug:hw:ICE1724).

For these single-format cards it is generally impossible to find out the actual player internal format from the outside, unless the player reports this information or someone consults its source code.
  Reply With Quote
Old 22nd April 2011, 06:07 AM   #1940
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by KlipschKid View Post
I thought Linux didn't resample ? Does it just change the word length and not the sampling frequency ?
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
  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 07:34 AM.


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