Considering old hardware for an audio player/recorder - Page 3 - 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 10th October 2011, 07:25 AM   #21
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Hi phofman,
my point is, that -b 32 and hw:0,0 are *not* working currently!

My aim with sox is not to do any conversion, just use the 24bit ADC and the 24bbit DAC in a loop (full duplex mode)

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 10th October 2011, 08:48 AM   #22
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Try the recording with

Code:
arecord -v -f S24_3LE -c 2 -D plughw:0 input.wav
The -v (verbose) parameter will tell you the actual hw parameters of your sound card and what transformations the plug plugin has to perform to achieve your required S24_3LE format (i.e. 24 bits in 3 bytes). You can post the command output here.
  Reply With Quote
Old 10th October 2011, 05:39 PM   #23
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
I'm on the road for a few days. I will try when I'm back home.
Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 14th October 2011, 04:16 PM   #24
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
This is the output:
Code:
arecord -v -f S24_3LE -c 2 -D plughw:0 input.wav
Aufnahme: WAVE 'input.wav' : Signed 24 bit Little Endian in 3bytes, Rate: 8000 Hz, stereo
Plug PCM: Rate conversion PCM (44100, sformat=S32_LE)
Converter: linear-interpolation
Protocol version: 10002
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 24
  buffer_size  : 1486
  period_size  : 185
  period_time  : 23219
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 185
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 1486
  silence_threshold: 0
  silence_size : 0
  boundary     : 194772992
Slave: Hardware PCM card 0 'RME Digi96/8 PST' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 23219
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 0
I do not quite understand this output. It looks as if a 24bit 8000Hz stream would be transposed to 24bit and 44.1kHz. If I playback that file (input.wav)
aplay states
Code:
aplay input.wav
Wiedergabe: WAVE 'input.wav' : Signed 24 bit Little Endian in 3bytes, Rate: 8000 Hz, stereo
Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 14th October 2011, 10:38 PM   #25
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Very well, thanks for the outputs.

In the first case you told arecord to capture a 24bit stereo file. You did not specify the samplerate and arecord picked the default - 8000 Hz. The request went through the plug plugin (see the Plug PCM line) which matched your request with the card capabilities, as reported by its driver.

The lowest rate your card supports is 44100. The plug plugin must provide a conversion from this rate to your requested 8000Hz. BTW your default resampling method is rather low quality (linear-interpolation), you may want to play with defaults.pcm.rate_converter , e.g. Advanced Linux Sound System user questions

The card does not support native 24bits. Well, the actual ADC and DAC do, but the card PCI controller works at 32bits, as is the case with many cards. Therefore the plug must convert from 32bits to 24bits, your requested format.

This produced your requested 8/24 file. Your second example plays this file back. Since you did not specify the actual device, the "default" was used. If you invoke aplay with the -v option (verbose), we will be able to see what the alsa-lib stack did with your request, just as we did with arecord -v. Without the verbose log we do not know how your default device is defined, whether it goes through pulseaudio, dmix, plain plughw, etc.
  Reply With Quote
Old 16th October 2011, 11:46 AM   #26
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Okay:

Code:
aplay -v input.wav
Wiedergabe: WAVE 'input.wav' : Signed 32 bit Little Endian, Rate: 8000 Hz, stereo
Plug PCM: Rate conversion PCM (32000, sformat=S32_LE)
Converter: linear-interpolation
Protocol version: 10002
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 32
  buffer_size  : 2048
  period_size  : 256
  period_time  : 32000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 256
  period_event : 0
  start_threshold  : 2048
  stop_threshold   : 2048
  silence_threshold: 0
  silence_size : 0
  boundary     : 268435456
Slave: Hardware PCM card 0 'RME Digi96/8 PST' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 32000
  exact rate   : 32000 (32000/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 32000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 8192
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 0
From this output it seems that 32k is the lowest sample rate my card is capable of.
What I don't get from your explanation above: if my card interface reads 32bits nativly and the ADC/DAC work at 24bit, shouldn't the conversion not be done in hardware without any software drivers involved? (Since RME is proclaiming to even mix channels and so forth in hardware?)

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 16th October 2011, 11:59 AM   #27
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
One issue seems to be:
arecord does not switch the card to other samplerates, rather uses sample rate conversion.

Conversly, mpd switches the card to the desired sample rate.

Look at the output if the card was running with 96k previously:
Code:
arecord -v -f S32_LE -c 2 -r 96000-D hw:0,0 input.wav
Aufnahme: WAVE 'hw:0,0' : Signed 32 bit Little Endian, Rate: 96000 Hz, stereo
Plug PCM: Hardware PCM card 0 'RME Digi96/8 PST' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 96000
  exact rate   : 96000 (96000/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 10666
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 0
And now if the mpd played a 16/44.1 file before:
Code:
# arecord -v -f S32_LE -c 2 -r 96000-D hw:0,0 input.wav
Aufnahme: WAVE 'hw:0,0' : Signed 32 bit Little Endian, Rate: 96000 Hz, stereo
Plug PCM: Rate conversion PCM (44100, sformat=S32_LE)
Converter: linear-interpolation
Protocol version: 10002
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 96000
  exact rate   : 96000 (96000/1)
  msbits       : 32
  buffer_size  : 17832
  period_size  : 2229
  period_time  : 23219
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 2229
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 17832
  silence_threshold: 0
  silence_size : 0
  boundary     : 1168637952
Slave: Hardware PCM card 0 'RME Digi96/8 PST' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 23219
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 0
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 0
Rüdiger

EDIT: and I still don't get why the same card with the same OS does not work with hw:0,0 and sox anymore in another machine!
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog

Last edited by Onvinyl; 16th October 2011 at 12:03 PM.
  Reply With Quote
Old 16th October 2011, 06:20 PM   #28
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by Onvinyl View Post
From this output it seems that 32k is the lowest sample rate my card is capable of.
Yes it is, at least the driver tells the upper levels so: git.alsa-project.org Git - alsa-kmirror.git/blob - pci/rme96.c

Quote:
Originally Posted by Onvinyl View Post
What I don't get from your explanation above: if my card interface reads 32bits nativly and the ADC/DAC work at 24bit, shouldn't the conversion not be done in hardware without any software drivers involved? (Since RME is proclaiming to even mix channels and so forth in hardware?)
The PCI side of the interface runs at 32bits. You requested 24 bits. That is 24bits on the PCI side of the interface, thus the conversion in software. Formats on the soundcard side of the interface are irrelevant to your software. E.g. there could be 32bit DACs with the same effect.
  Reply With Quote
Old 16th October 2011, 06:35 PM   #29
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by Onvinyl View Post
arecord does not switch the card to other samplerates, rather uses sample rate conversion.

Code:
arecord -v -f S32_LE -c 2 -r 96000-D hw:0,0 input.wav
Aufnahme: WAVE 'hw:0,0' : Signed 32 bit Little Endian, Rate: 96000 Hz, stereo
Plug PCM: Hardware PCM card 0 'RME Digi96/8 PST' device 0 subdevice 0
....
Well, you specified hw:0, yet the plug plugin kicked in. Is not that weird? I guess the reason is you did not put a space between your samplerate definition and the -D parameter. I am pretty sure your arecord used the default param as a result, ignoring your incorrect device specification.

And the "stuck" samplerate? Does not this particular soundcard support hardware mixing? If so, my guess is you left MPD running when trying your second arecord test. The card was switched to 44100 by MPD, the card was still open by MPD, as a result it was locked at 44100 and could not switch to 96000, you did not use hw:0 but the default via plug plugin (no space -D again), the plug plugin had to resample to the fixed samplerate of 44100. That is my guess, you can easily verify by making sure the device is not opened by any other process by running

sudo lsof /dev/snd/*

I would guess if you used hw:0 correctly, you would have received "Incorrect parameter" error as the samplerate would have been incompatible.

Quote:
I still don't get why the same card with the same OS does not work with hw:0,0 and sox anymore in another machine!
Any details? It may not be the first sound card (i.e. hw:0) anymore, for example.
  Reply With Quote
Old 16th October 2011, 06:51 PM   #30
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Quote:
Originally Posted by phofman View Post
The card was switched to 44100 by MPD, the card was still open by MPD, as a result it was locked at 44100 and could not switch to 96000
This is not the case, see output with corrected space before -D:

Code:
arecord -v -f S32_LE -c 2 -r 96000 -D hw:0,0 input.wav
Aufnahme: WAVE 'input.wav' : Signed 32 bit Little Endian, Rate: 96000 Hz, stereo
Warnung: Rate ist nicht exakt (angefordert: 96000 Hz, unterstützt: 44100 Hz)
         probieren Sie bitte das plug-Plugin:
Hardware PCM card 0 'RME Digi96/8 PST' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 23219
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 0

Quote:
Any details? It may not be the first sound card (i.e. hw:0) anymore, for example.
hw:0,0 is correct (see above as well). On the previous machine I ran
Code:
sox  -b 32 -t alsa hw:0,0  -r 96000 -t alsa hw:0,0 (+some biquad commands)
and it worked fine (audio capuring, processing and playback at 24/96) Now I get
Code:
sox FAIL formats: can't open input  `hw:0,0': select_format error: Operation not permitted
I have to use the plug plugin and specify -b 24 instead to have it working. But this way there is (I think) unnecessary SRC involved. And the soundquality now is lacking (file playback is fine, though(

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog

Last edited by Onvinyl; 16th October 2011 at 06:55 PM.
  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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone know an audio player that can do this? Johnnz Digital Source 7 8th September 2009 08:13 AM
AV IR over Cat5 (simple audio/video repeater for Sky, Digital Tv and Tape recorder) audiodesign Solid State 0 24th June 2009 02:28 PM
FS: Car audio fusing hardware Rybaudio Swap Meet 0 11th July 2007 09:09 AM
Laser Head Assemblies for Marantz DV7000 (DVD Player) & DR6000 (CD Recorder) crdshark Digital Source 2 20th September 2004 12:40 PM
Looking for a DVD-Audio player wmeckle Digital Source 0 6th May 2003 03:04 PM


New To Site? Need Help?

All times are GMT. The time now is 07:37 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