cannot disable resampling for ICH6 (OSS4)

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Sat Oct 09, 2010 9:45 am

cesium wrote:It isn't an SRC - it doesn't convert sample rate. It has some simple format conversions - it can convert some A-Law or mu-law or some ADPCMs etc. stuff to normal 16bit PCM.


Perhaps, it doesn't convert sample rate (although it should convert sample rate according to "man ossplay").

Code: Select all
$ ossplay C*.wav -vR -s48000 -fS32_LE
Playing WAVE file C-01.wav, 32 bits/stereo/44100 Hz
Time: 00:03.60 of 04:15.23 VU ------     ^C


However, it can convert 16bit → 32bit, and other way round. This is the problem.

The question is: "How does it play fS32_LE format?" Is it converted to 16bit, or else?
For example, I have a wave 32bit and 48kHz, and I am trying to play it with "ossplay *.wav -vR".
How to find out how the file is actually played?

ALSA is said to have a secret file /proc/asound/card0/pcm0p/sub0/hw_params
where you may find all the information you need.
Is it possible to find such information in OSS4?

"ossinfo -a -v9" for ICH6:

Code: Select all
$ ossinfo -a -v9

Audio devices
HD Audio play front               /dev/oss/oss_hdaudio0/pcm0  (device index 0)
    Legacy device /dev/dsp0
    Caps: DUPLEX TRIGGER MMAP
    Modes: IN/OUT
      Out engine  1: 0/HD Audio play front
                     Available for use
      Engine      2: 7/HD Audio play front (vmix)
                     Available for use
      Engine      3: 8/HD Audio play front (vmix)
                     Available for use
      Engine      4: 9/HD Audio play front (vmix)
                     Available for use
      Engine      5: 10/HD Audio play front (vmix)
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au01
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 8
    Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,32000,44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play rear                /dev/oss/oss_hdaudio0/pcm1  (device index 1)
    Legacy device /dev/dsp1
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 1/HD Audio play rear
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au02
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,32000,44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play center/LFE          /dev/oss/oss_hdaudio0/pcm2  (device index 2)
    Legacy device /dev/dsp2
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 2/HD Audio play center/LFE
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au03
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,32000,44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play spdif-out           /dev/oss/oss_hdaudio0/spdout0  (device index 3)
    Legacy device /dev/dsp3
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 3/HD Audio play spdif-out
                     Available for use
    Input formats (0x00000410):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_AC3      - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000410):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_AC3      - AC3 (Dolby Digital) encoded audio
    Device handle: PCI201717c0-0000:00:1b.0-au04
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 44100 - 48000 (44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play modem               /dev/oss/oss_hdaudio0/mdmout0  (device index 4)
    Legacy device /dev/dsp4
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 4/HD Audio play modem
                     Available for use
    Input formats (0x00000010):
      AFMT_S16_LE   - 16 bit signed little endian
    Output formats (0x00000010):
      AFMT_S16_LE   - 16 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au05
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 1 - 1
    Native sample rates (min - max): 8000 - 16000 (8000,9600,16000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio rec rec-srcmic-mix       /dev/oss/oss_hdaudio0/pcmin0  (device index 5)
    Legacy device /dev/dsp5
    Caps: DUPLEX TRIGGER MMAP
    Modes: IN/OUT
      In engine   1: 5/HD Audio rec rec-srcmic-mix
                     Available for use
      Engine      2: 7/HD Audio play front (vmix)
                     Available for use
      Engine      3: 8/HD Audio play front (vmix)
                     Available for use
      Engine      4: 9/HD Audio play front (vmix)
                     Available for use
      Engine      5: 10/HD Audio play front (vmix)
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au06
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,32000,44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio rec modem                /dev/oss/oss_hdaudio0/mdmin0  (device index 6)
    Legacy device /dev/dsp6
    Caps: TRIGGER MMAP
    Modes: INPUT 
      In engine   1: 6/HD Audio rec modem
                     Available for use
    Input formats (0x00000010):
      AFMT_S16_LE   - 16 bit signed little endian
    Output formats (0x00000010):
      AFMT_S16_LE   - 16 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au07
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 1 - 1
    Native sample rates (min - max): 8000 - 16000 (8000,9600,16000)
    HW Type: Not indicated.
    Minimum latency: Not indicated


Nodes
  /dev/dsp -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_in -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_out -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_ac3 -> /dev/oss/oss_hdaudio0/spdout0
  /dev/dsp_mmap -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_multich -> /dev/oss/oss_hdaudio0/pcm0
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby cesium » Sun Oct 10, 2010 6:20 pm

There's no S16 -> S32 conversion in ossplay, nor the reverse. It tries to supply it to the card. It is likely that vmix is doing that conversion. "man ossplay" mentions the vmix conversions. I did send a patch to the ML which added optional SRC conversion (not compiled in by default, can be used to test GRC), not applied yet though. Btw, '-R' doesn't disable the internal ossplay format conversions, since I think 'playing' a file is better than 'not playing'.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Sun Oct 10, 2010 7:42 pm

cesium wrote:There's no S16 -> S32 conversion in ossplay, nor the reverse. It tries to supply it to the card. It is likely that vmix is doing that conversion. "man ossplay" mentions the vmix conversions. I did send a patch to the ML which added optional SRC conversion (not compiled in by default, can be used to test GRC), not applied yet though. Btw, '-R' doesn't disable the internal ossplay format conversions, since I think 'playing' a file is better than 'not playing'.


Yes, an illusion is always better than nothing at all.

You see, I have a standard wave 16bit, 44100Hz, and I play it with this command:

Code: Select all
$ ossplay C*.wav -vR -s48000 -fS32_LE
Playing WAVE file C-01.wav, 32 bits/stereo/44100 Hz
Time: 00:03.60 of 04:15.23 VU ------     ^C


Do you want to say that all these are a mere deception?

It is a practical question.
You see, ossplay is playing something, and Petrov's player seems to be working now:

Code: Select all
$ ./pcm_play C*.wav -s oss -f 48000 -b 32 -e
=================================================================
Module Info:

Short name: WAVE Player
Long name : Player for WAVE PCM file
Copyright : Copyright (c) 2009-10 PetrovSE
Version   : 1.0.3.4
Build     : Oct  9 2010, 19:23:46
=================================================================

Opening file "C-01.wav" ...Ok.
Samples rate    = 44100 Hz
Channels        = 2
Bits per sample = 16 (fixed)

Sample rate converter is activated.

Wave system [oss]: Open Sound System
Wave device []: "/dev/dsp" !

H/W parameters:
Samples rate    = 48000 Hz
Channels        = 2
Bits per sample = 32 (fixed)

[-----#---------------------------------------------] [||]  0:52 (149 ms)


How can I find out what is really going on? How to verify the illusion?
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby cesium » Sun Oct 10, 2010 8:39 pm

Again, ossplay doesn't do S32 <-> S16 conversions (though it would be trivial to program). If the card doesn't support S32 (do 'ossinfo -v3' and supported formats appear in the list), than it's likely vmix is doing the conversion.

Btw, note that the format in which the card is opened may be different from the one players display (dunno about Petrov's, but ossplay is like that - it displays the file's format, not the one it uses to talk to the card) - "ossplay -vvvv" (or something like that) can display the actual format ("Setup device..." message) it uses to talk to the card. That said, because it doesn't do these conversions, it's either vmix or the card supports S32.

P.S. You can also try something like "strace -e trace=ioctl $(player) etc." to see which ioctls are sent to the card, though only a special strace binary will decode the ioctls.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Sun Oct 10, 2010 9:07 pm

cesium wrote:Again, ossplay doesn't do S32 <-> S16 conversions (though it would be trivial to program). If the card doesn't support S32 (do 'ossinfo -v3' and supported formats appear in the list), than it's likely vmix is doing the conversion.

Btw, note that the format in which the card is opened may be different from the one players display (dunno about Petrov's, but ossplay is like that - it displays the file's format, not the one it uses to talk to the card) - "ossplay -vvvv" (or something like that) can display the actual format ("Setup device..." message) it uses to talk to the card. That said, because it doesn't do these conversions, it's either vmix or the card supports S32.

P.S. You can also try something like "strace -e trace=ioctl $(player) etc." to see which ioctls are sent to the card, though only a special strace binary will decode the ioctls.


cesium wrote:Again, ossplay doesn't do S32 <-> S16 conversions


Why does it say it does? And sample rate seems to be converted too.

Code: Select all
$ ossplay C*.wav -R -vvvv -s48000 -fS32_LE
Filelen = 98008532
C-01.wav: Reading chunk fmt , size 16
FMT chunk: len = 16, fmt = 0x1000
C-01.wav: Reading chunk data, size 98008496
DATA chunk. Offs = 44, len = 0
Playing WAVE file C-01.wav, 32 bits/stereo/44100 Hz
Setup device S32_LE/2/48000
Time: 00:06.00 of 04:15.23 VU ------     ^C


cesium wrote:If the card doesn't support S32 (do 'ossinfo -v3' and supported formats appear in the list)


The card does support 32bit:

Code: Select all
$ ossinfo -v3
Version info: OSS 4.2 (b 2003/201007221402) (0x00040100) GPL
Platform: Linux/i686 2.6.35-ARCH #1 SMP PREEMPT Wed Sep 29 07:17:20 UTC 2010 (cargo-cult)

Number of audio devices:   7
Number of audio engines:   11
Number of MIDI devices:      0
Number of mixer devices:   1


Device objects
0: osscore0 OSS core services
1: oss_hdaudio0 Intel HD Audio interrupts=684 (920)
    HD Audio controller Intel HD Audio
    Vendor ID    0x80862668
    Subvendor ID 0x17c02017
     Codec  0: AD1986A (0x11d41986/0x17c02017)
     Codec  1: Motorola3055 (0x10573055)
2: oss_usb0 USB audio core services

MIDI devices (/dev/midi*)

Mixer devices
0: High Definition Audio AD1986A (Mixer 0 of device object 1)
    Device file /dev/oss/oss_hdaudio0/mix0, Legacy device /dev/mixer0
    Priority: 10
    Caps:
    Device handle: PCI201717c0-0000:00:1b.0-mx01
    Device priority: 10


Audio devices
HD Audio play front               /dev/oss/oss_hdaudio0/pcm0  (device index 0)
    Legacy device /dev/dsp0
    Caps: DUPLEX TRIGGER MMAP
    Modes: IN/OUT
      Out engine  1: 0/HD Audio play front
                     Available for use
      Engine      2: 7/HD Audio play front (vmix)
                     Available for use
      Engine      3: 8/HD Audio play front (vmix)
                     Available for use
      Engine      4: 9/HD Audio play front (vmix)
                     Available for use
      Engine      5: 10/HD Audio play front (vmix)
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au01
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 8
    Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,32000,44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play rear                /dev/oss/oss_hdaudio0/pcm1  (device index 1)
    Legacy device /dev/dsp1
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 1/HD Audio play rear
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au02
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,32000,44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play center/LFE          /dev/oss/oss_hdaudio0/pcm2  (device index 2)
    Legacy device /dev/dsp2
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 2/HD Audio play center/LFE
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au03
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,32000,44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play spdif-out           /dev/oss/oss_hdaudio0/spdout0  (device index 3)
    Legacy device /dev/dsp3
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 3/HD Audio play spdif-out
                     Available for use
    Input formats (0x00000410):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_AC3      - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000410):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_AC3      - AC3 (Dolby Digital) encoded audio
    Device handle: PCI201717c0-0000:00:1b.0-au04
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 44100 - 48000 (44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play modem               /dev/oss/oss_hdaudio0/mdmout0  (device index 4)
    Legacy device /dev/dsp4
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 4/HD Audio play modem
                     Available for use
    Input formats (0x00000010):
      AFMT_S16_LE   - 16 bit signed little endian
    Output formats (0x00000010):
      AFMT_S16_LE   - 16 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au05
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 1 - 1
    Native sample rates (min - max): 8000 - 16000 (8000,9600,16000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio rec rec-srcmic-mix       /dev/oss/oss_hdaudio0/pcmin0  (device index 5)
    Legacy device /dev/dsp5
    Caps: DUPLEX TRIGGER MMAP
    Modes: IN/OUT
      In engine   1: 5/HD Audio rec rec-srcmic-mix
                     Available for use
      Engine      2: 7/HD Audio play front (vmix)
                     Available for use
      Engine      3: 8/HD Audio play front (vmix)
                     Available for use
      Engine      4: 9/HD Audio play front (vmix)
                     Available for use
      Engine      5: 10/HD Audio play front (vmix)
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE   - 16 bit signed little endian
      AFMT_S32_LE   - 32 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au06
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 8000 - 48000 (8000,11025,16000,22050,32000,44100,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio rec modem                /dev/oss/oss_hdaudio0/mdmin0  (device index 6)
    Legacy device /dev/dsp6
    Caps: TRIGGER MMAP
    Modes: INPUT 
      In engine   1: 6/HD Audio rec modem
                     Available for use
    Input formats (0x00000010):
      AFMT_S16_LE   - 16 bit signed little endian
    Output formats (0x00000010):
      AFMT_S16_LE   - 16 bit signed little endian
    Device handle: PCI201717c0-0000:00:1b.0-au07
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 1 - 1
    Native sample rates (min - max): 8000 - 16000 (8000,9600,16000)
    HW Type: Not indicated.
    Minimum latency: Not indicated


Nodes
  /dev/dsp -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_in -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_out -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_ac3 -> /dev/oss/oss_hdaudio0/spdout0
  /dev/dsp_mmap -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_multich -> /dev/oss/oss_hdaudio0/pcm0


cesium wrote:it's likely vmix is doing the conversion.


vmix should be disabled by "ossplay -R" and "pcm_play -e"
And pcm_play is saying that vmix is disabled:

Code: Select all
Wave device []: "/dev/dsp" !


"!" means "vmix is disabled".

cesium wrote:P.S. You can also try something like "strace -e trace=ioctl $(player) etc." to see which ioctls are sent to the card, though only a special strace binary will decode the ioctls.


Could you please explain how to do this?

EDIT: It seems that your "special strace binary" does not work

Code: Select all
$ ./strace --help
bash: ./strace: cannot execute binary file

$ ./strace -h
bash: ./strace: cannot execute binary file


man strace
http://linux.die.net/man/1/strace

-h Print the help summary.


Or I am doing something wrong?

Thus, the special tool does not work yet, and other debugging tools are of no use. Right?

Code: Select all
$ yaourt strace
1 extra/strace 4.5.20-1
    A useful diagnositic, instructional, and debugging tool
2 aur/dnstracer 1.9-2 (35)
    Determines where a given DNS server gets its information from, and follows the chain of DNS servers
3 aur/latrace 0.5.9-1 (1)
    latrace allows you to trace library calls and get their statistics in a manner similar to the strace utility (syscall
    tracing)
4 aur/systrace 1.6f-1 (2)
    Systrace enforces system call policies for applications by constraining the application's access to the system.
==> Enter n° (separated by blanks, or a range) of packages to be installed
==> ----------------------------------------------------------------------
==>


Let us summarize the results of our "scientific research":

1. There is ossplay, there is "man ossplay", and there is the source code of ossplay.

2. There might be a contradiction between "man ossplay" and the source code of ossplay.

3. There is Petrov's player, and there is a problem of how to find out if it works as it should, or some other unwanted resamplers are involved.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby cesium » Mon Oct 11, 2010 2:37 pm

The ossinfo output clearly shows vmix is enabled (see "(vmix)" strings). I don't think pcm_play knows anything about vmix, whether it's enabled or not.

Why does it say it does? And sample rate seems to be converted too.

It doesn't. All the strings in your output are "32 bits" and the like. The conversion is done probably by vmix.

Re: strace
Did you set executable bit?
Perhaps this binary would work.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Mon Oct 11, 2010 4:37 pm

cesium wrote:Perhaps this binary would work.


Thanks!!! I will try it as soon as I can.

cesium wrote:Re: strace
Did you set executable bit?


Look here:
Code: Select all
$ ./strace --help
bash: ./strace: cannot execute binary file

$ ./strace -h
bash: ./strace: cannot execute binary file


If the executable bit is not set, it may say something about permissions. Right?

cesium wrote:The ossinfo output clearly shows vmix is enabled (see "(vmix)" strings). I don't think pcm_play knows anything about vmix, whether it's enabled or not.

Why does it say it does? And sample rate seems to be converted too.

It doesn't. All the strings in your output are "32 bits" and the like. The conversion is done probably by vmix.


As it was already clearly said, "pcm_play -e" disables vmix, and "ossplay -R" too. See "man ossplay".
I think that you may try to read the source code of ossplay and then tell us what you think.
Although, of course, the contradiction between "man ossplay" and what ossplay is actually doing might be obvious without studying the source code of ossplay.
Look here:

$ ossplay C*.wav -R -vvvv -s48000 -fS32_LE
Filelen = 98008532
C-01.wav: Reading chunk fmt , size 16
FMT chunk: len = 16, fmt = 0x1000
C-01.wav: Reading chunk data, size 98008496
DATA chunk. Offs = 44, len = 0
Playing WAVE file C-01.wav, 32 bits/stereo/44100 Hz
Setup device S32_LE/2/48000
Time: 00:06.00 of 04:15.23 VU ------ ^C


ossplay says that 16bit were converted to 32bit. And the original wave is of 16bit and 44100 Hz, as I told.
It is not so clear about the conversion 44100Hz → 48000Hz, but this is because the output of ossplay is so obscure.
In any case, it says: "Setup device S32_LE/2/48000".
According to "man ossplay", ossplay should convert 44100Hz → 48000Hz, but it says this:
"Playing WAVE file C-01.wav, 32 bits/stereo/44100 Hz" and then this:
"Setup device S32_LE/2/48000".
Is it obvious now? Or it is still obscure?

Any sensible person, I believe, may say that it is still obscure.
The question is: "Which resampler did the conversion 44100Hz → 48000Hz, the resampler of ossplay, vmix, or an invisible PulseAudio?"

The hypothesis of vmix can be subjected to a "clear-cut empirical test".
As it was already said, the Fast resampler of OSS4 plays "bad clipping" with Risset Bell. Any other resampler of OSS4 or ALSA does not play "bad clipping" with Risset Bell. The internal resamplers of soundcards are playing Risset Bell without clipping. The Fast resampler of OSS4 is unique, in this sense.
Thus, you can easily create Risset Bell (16bit, 44100Hz) with Audacity, save it as wave, and play it with ossplay.
If it was resampled by vmix (which is set to Fast), you should hear "bad clipping".
However, I have not tested Risset Bell with PulseAudio. It may also make "bad clipping" (this was reported for the standard test files).
Since everything is so obscure, one may easily come to believe in the existence of the "invisible PulseAudio".
Last edited by igorzwx on Mon Oct 11, 2010 8:55 pm, edited 2 times in total.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby cesium » Mon Oct 11, 2010 6:41 pm

A. I all but wrote ossplay (so many patches), so I know it very well. Nothing in the output mentions "16 bits". What happens is that when you use -fS32_LE it forces it to consider the input file as 32bit little endian. It doesn't even consider it's originally 16bit - this overrides file format detection. As for rate, you provided '-s48000' so of course it uses 48000 when opening the device (come to think of it, it's not consistent to print the original rate here and not the original format). There's no SRC - the file would just sound a bit funny if you use a different rate than the native one.

B. 'ossplay -R' doesn't turn off vmix permanently, it just means ossplay overrides vmix just this once. I dunno about pcm_play which is not included with OSS, nor mentioned in ossplay manual page.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Mon Oct 11, 2010 7:16 pm

cesium wrote:A. I all but wrote ossplay (so many patches), so I know it very well. Nothing in the output mentions "16 bits". What happens is that when you use -fS32_LE it forces it to consider the input file as 32bit little endian. It doesn't even consider it's originally 16bit - this overrides file format detection. As for rate, you provided '-s48000' so of course it uses 48000 when opening the device (come to think of it, it's not consistent to print the original rate here and not the original format). There's no SRC - the file would just sound a bit funny if you use a different rate than the native one.

B. 'ossplay -R' doesn't turn off vmix permanently, it just means ossplay overrides vmix just this once. I dunno about pcm_play which is not included with OSS, nor mentioned in ossplay manual page.


If I understood you correctly, you are going to say that "man ossplay" is 100% deception, and its output too.

Code: Select all
man ossplay

-R     Disable  redirection  to  virtual  mixer  engines   and   sample
              rate/format  conversions.  Should  not be used unless absolutely
              necessary.


Is it all false, or not?

pcm_play is not included with OSS, and it is not mentioned in ossplay manual page. It is a special Russian player. It has a "magic resampler" inside. You can get it here: viewtopic.php?f=3&t=3543&start=45#p15974
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby cesium » Mon Oct 11, 2010 8:39 pm

It's not "deception". ossplay overrides vmix with '-R' option. There's no SRC in that case. It's not a mixer utility, so of course it doesn't disable vmix permanently, so if you just do 'ossplay $(files)' afterwards without '-R' it would use vmix than. There are some nominal format (not SRC!) conversions which are still done in ossplay with '-R' only when a file won't play at all otherwise (A-law/Mu-law/ADPCMs -> 16bit conversions), and are not done in this particular case.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Mon Oct 11, 2010 8:59 pm

cesium wrote:It's not "deception". ossplay overrides vmix with '-R' option. There's no SRC in that case. It's not a mixer utility, so of course it doesn't disable vmix permanently, so if you just do 'ossplay $(files)' afterwards without '-R' it would use vmix than. There are some nominal format (not SRC!) conversions which are still done in ossplay with '-R' only when a file won't play at all otherwise (A-law/Mu-law/ADPCMs -> 16bit conversions), and are not done in this particular case.


If it is not deception, "vmix" should be somehow disabled during the time interval when an audio file is played with "ossplay -R". Right?

In any case, everything is deceptive, it can be easily misunderstood, it is unreliable (in this sense), and only the "ultimate documentation" (that is, the source code) is of value. Right?

For example:

Code: Select all
$ ossplay -h
            -s<rate>       Change playback rate.

$ man ossplay
            -s<rate>       Select the playback rate for raw PCM audio (eg -s48000).


What does the word "change" mean in this context? Everyone may understand it how he wants, and he may fool himself how he wants. Right?
The English language which is very exact is not exact, in this particular case.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby hiro » Mon Oct 11, 2010 9:31 pm

I don't know about the man page, the docs or the source code, but here's what works for me:
ossmix vmix0-enable OFF; ossmix vmix0-src OFF

And I directly use the spdif output instead of /dev/pcm. I assume my setup is bit-perfect, sounds like it, too.
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby cesium » Mon Oct 11, 2010 9:34 pm

Yea, vmix is disabled during that. Note however that if you set "excl_policy" to something other than the default zero in /usr/lib/oss/conf/osscore.conf, than overriding vmix that way will not work. (see "man osscore" page).
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Mon Oct 11, 2010 9:56 pm

cesium wrote:Yea, vmix is disabled during that. Note however that if you set "excl_policy" to something other than the default zero in /usr/lib/oss/conf/osscore.conf, than overriding vmix that way will not work. (see "man osscore" page).


If "vmix is disabled during that", the only "unwanted resampler" might be the internal resampler inside the soundcard (which does not exist), provided that there is not any "invisible PulseAudio" inside OSS4. Right?
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Tue Oct 12, 2010 8:32 pm

cesium wrote:Perhaps this binary would work.


I have already tried your magic tool on another computer. It works. It printed on terminal certain parameters which you loaded into ioctl.

igorzwx wrote:ALSA is said to have a secret file /proc/asound/card0/pcm0p/sub0/hw_params
where you may find all the information you need.
Is it possible to find such information in OSS4?


Could you please answer this question?
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

PreviousNext

Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest