HDA on Sony Vaio VGN-FE31B

OSS specific BSD discussion (FreeBSD/NetBSD/OpenBSD)

Moderators: hannu, dev, kodachi, cesium

HDA on Sony Vaio VGN-FE31B

Postby MG! » Tue Sep 01, 2009 2:45 pm

Hi forum,

I've installed the _devel_ version of OSS (4.2). As related to my speakers, everything works great.

My problem are the headphones (jack). When I try to run
Code: Select all
osstest 1
-1 because the /dev/dsp1 is a reference to my headphones- the test for the left and right sides works but in stereo there is a whoosh on the link (absolutely bad sound quality). Same result by using ossplay, mpg123 or any other music player. I hope someone can help me.

Code: Select all
# ossinfo -v3
Version info: OSS 4.2 (b rc3/200908301410) (0x00040100) BSD
Platform: FreeBSD/i386 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 08:49:13 UTC 2009     root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC ()

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


Device objects
0: oss_hdaudio0 Intel HD Audio interrupts=126846 (126846)
    HD Audio controller Intel HD Audio
    Vendor ID    0x808627d8
    Subvendor ID 0x104d81ef
     Codec  0: CXD9872RD (0x83847661/0x104d0c00)
     Codec  1: Conexant2bfa (0x14f12bfa)

MIDI devices (/dev/midi*)

Mixer devices
0: High Definition Audio CXD9872RD (Mixer 0 of device object 0)
    Device file /dev/oss/oss_hdaudio0/mix0, Legacy device /dev/mixer0
    Priority: 10
    Caps:
    Device handle: OSS-PCI-mx01
    Device priority: 10


Audio devices
HD Audio play pcm                 /dev/oss/oss_hdaudio0/pcm0  (device index 0)
    Legacy device /dev/dsp0
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 0/HD Audio play pcm
                     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: OSS-PCI-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): 44100 - 192000 (44100,48000,88200,96000,176400,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play pcm                 /dev/oss/oss_hdaudio0/pcm1  (device index 1)
    Legacy device /dev/dsp1
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 1/HD Audio play pcm
           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: OSS-PCI-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): 44100 - 192000 (44100,48000,88200,96000,176400,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play pcm                 /dev/oss/oss_hdaudio0/pcm2  (device index 2)
    Legacy device /dev/dsp2
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 2/HD Audio play pcm
                     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: OSS-PCI-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): 44100 - 192000 (44100,48000,88200,96000,176400,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play modem-out           /dev/oss/oss_hdaudio0/pcm3  (device index 3)
    Legacy device /dev/dsp3
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 3/HD Audio play modem-out
                     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: OSS-PCI-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): 16000 - 48000 (16000,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play spdifout            /dev/oss/oss_hdaudio0/spdout0  (device index 4)
    Legacy device /dev/dsp4
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 4/HD Audio play spdifout
                     Available for use
    Input formats (0x00001410):
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
      AFMT_S32_LE       - 32 bit signed little endian
    Output formats (0x00001410):
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
      AFMT_S32_LE       - 32 bit signed little endian
    Device handle: OSS-PCI-au05
    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 - 176400 (44100,48000,88200,96000,176400)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio rec select               /dev/oss/oss_hdaudio0/pcmin0  (device index 5)
    Legacy device /dev/dsp5
    Caps: TRIGGER MMAP
    Modes: INPUT 
      In engine   1: 5/HD Audio rec select
                     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: OSS-PCI-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): 44100 - 192000 (44100,48000,88200,96000,176400,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio rec modem-out            /dev/oss/oss_hdaudio0/pcmin1  (device index 6)
    Legacy device /dev/dsp6
    Caps: TRIGGER MMAP
    Modes: INPUT 
      In engine   1: 6/HD Audio rec modem-out
                     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: OSS-PCI-au07
    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): 16000 - 48000 (16000,48000)
    HW Type: Not indicated.
    Minimum latency: Not indicated


Nodes
  /dev/dsp -> /dev/oss/oss_hdaudio0/pcm2
  /dev/dsp_in -> /dev/oss/oss_hdaudio0/pcmin0
  /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


Code: Select all
# ossmix
Selected mixer 0/High Definition Audio CXD9872RD
Known controls are:
jack.fp-black.mode <pcm> (currently pcm)
jack.fp-black.pcm [<leftvol>:<rightvol>] (currently 95.1:95.1 dB)
jack.black.pcm [<leftvol>:<rightvol>] (currently 95.1:95.1 dB)
jack.fp-red.mode <pcm> (currently pcm)
jack.int-black.pcm [<leftvol>:<rightvol>] (currently 95.1:95.1 dB)
jack.black.mode <spdifout> (currently spdifout)
record.select.select1 [<leftvol>:<rightvol>] (currently 39.9:39.9 dB)
record.select.select2 <pcm> (currently pcm)
record.select [<leftvol>:<rightvol>] (currently 19.4:19.4 dB)
misc <28> (currently -28.-8dB)


Notice that I've vmix _disabled_ in osscore.conf but the problem is still here when I activate vmix.

Thanks
MG!
 
Posts: 2
Joined: Tue Sep 01, 2009 12:22 pm

Postby cesium » Wed Sep 02, 2009 9:49 pm

I've got an idea, but you'll need to rebuild OSS4.
First, get the OSS4 source (you already have it since you have 4.2-rc3). Then edit kernel/drv/oss_hdaudio/hdaudio_codecids.h in the source tree and add the diff attached below. Afterward, rebuild OSS4 and reload it. ossinfo output should add a "Vaio/" prefix to the codec name and the stereo headphone sound should work.

Code: Select all
diff -r 2c3014adfcc3 kernel/drv/oss_hdaudio/hdaudio_codecids.h
--- a/kernel/drv/oss_hdaudio/hdaudio_codecids.h   Tue Sep 01 20:31:53 2009 +0300
+++ b/kernel/drv/oss_hdaudio/hdaudio_codecids.h   Thu Sep 03 00:44:59 2009 +0300
@@ -1063,10 +1063,11 @@
   /****/

   /*
-   * Sony VAIO SZ2, SZ3, and FE
+   * Sony VAIO SZ2, SZ3, FE and FE31B
    */
   {0x104d0700, "Vaio/CXD9872RD", VF_VAIO_HACK, (char**) &vaio_remap, 0x76540213, hdaudio_vaio_vgn_mixer_init, 0x83847661, 0x104d81e6},
   {0x104d1000, "Vaio/CXD9872RD", VF_VAIO_HACK, (char**) &vaio_remap, 0x76540213, hdaudio_vaio_vgn_mixer_init, 0x83847661, 0x104d81ef},
+  {0x104d0c00, "Vaio/CXD9872RD", VF_VAIO_HACK, (char**) &vaio_remap, 0x76540213, hdaudio_vaio_vgn_mixer_init, 0x83847661, 0x104d81ef},

   /*
    * Sony VAIO AR


Btw, why did you disable vmix? If you're using a different output, you can reassign vmix via vmixctl (You may want to enable "vmix_no_autoattach" option in osscore.conf to clean up the mixer in that case).
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby MG! » Thu Sep 03, 2009 7:49 am

This patch adds primary the first codec attributes to the subdevices array in the hdaudio_codecids.h file...and now it works really good :!:

With that patch I'm able to remove/insert the headphones, and OSS switched between the speakers and headphones. As it is now, i don't need to specify the virtual device file on the command line (-a mpg123; -f ossplay).

To control the volume I simply fire up

ossmix speaker 90

or with the help of ossxmix.

Thanks for your help,
Manu
MG!
 
Posts: 2
Joined: Tue Sep 01, 2009 12:22 pm


Return to BSD

Who is online

Users browsing this forum: Bing [Bot] and 0 guests