Author Topic: Sound: SPDIF confusion - some apps analog, some digital.  (Read 1392 times)

Offline CJ

  • Sr. Member
  • ****
  • Posts: 454
Sound: SPDIF confusion - some apps analog, some digital.
« on: March 28, 2012, 04:54:49 PM »
On an existing installation, I decided to give an optical SPDIF cable a go to try to improve the sound (and get proper surround)... and it works... mostly... but...

Having plugged in the cable, I changed the digital 'device' to the top (preferred) position in Phonon (though KDE settings). Testing the sound here gives output.
I then ran alsaconf which confirmed that the digital device is now the preferred, checked the mixer settings (kmix), then rebooted.

I now have 'system' sound though digital (by that, I mean KDE sounds, e.g. start-up melody), but other apps still use analog.

For instance, in SMPLayer I had to manually set Preferences->Output Driver to the second device 'alsa (0.1  - HDA ATI SB)' and change audio channels to '5.1 Surround'.

But Clementine, for example, does not seem to have similar control and continues to output to the analog line.

So... my question here is not how to make the digital sound work, as it works just fine in some contexts - but how do I make it system-wide, and the default choice for all apps?
(One caveat: I would like to retain the analog out possibility for Skype for the headphones, if possible.)

Any suggestions on this, please?

2.6.38.8-pclos3.pae.bfs.
ASUS motherboard (sound card reported as SBx00 Azelia (Intel HDA))  with optical out (tosllink). Receiving is a Philips surround sound system (HTS3377).
Code: [Select]
lspci | grep Audio
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) (rev 40)

Cheers!
CJ


Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10667
  • MLUs Forever!
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #1 on: March 28, 2012, 05:11:14 PM »
There is likely an easier way, but my suggestion for such things is to use Pulse Audio and Pulse Audio Volume Control which allows the user to pick the sound sink on a 'per application' basis, and each app should remember which output it used when last run.

PA also has other very useful functions .......  and there are instructions on this forum about it.

Generally installing task pulse audio and pavucontrol, then enabling it in PCC - Hardware - Sound, and rebooting sets everything needed.

MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline CJ

  • Sr. Member
  • ****
  • Posts: 454
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #2 on: March 29, 2012, 05:27:07 AM »
Just18, thanks for you feedback, much appreciated.
Weren't there stability issues as reason why PCLOS is not born with PA, or do my memory fail me?

I might well end up following your advice, but for starters, I am reluctant to introduce another (for me) unknown into the equation.
As you said, there may (must?) be an easier way. After all, it works - it's just the system being confused about what device to use, apparently.

CJ

Offline CJ

  • Sr. Member
  • ****
  • Posts: 454
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #3 on: March 29, 2012, 07:49:11 AM »
Uhm, I am beginning to suspect that, although sound is - mostly - passing though the SPDIF cable, maybe I am not hearing proper surround 5.1

In SMPlayer, I tried selecting 'AC3/DTS pass-though S/PDIF', which - for some files - resulted in a 'screetching' noise and subsequent MPlayer crash...

I am lost now...

Maybe my question should really be a basic 'How do I set up 5.1 through SPDIF - from scratch'?

MPlayer log:
Code: [Select]
...

ID_VIDEO_CODEC=ffodivx
==========================================================================
Trying to force audio codec driver family hwac3...
Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
hwac3: switched to AC3, 448000 bps, 48000 Hz

AUDIO: 48000 Hz, 2 ch, ac3be, 448.0 kbit/29.17% (ratio: 56000->192000)
ID_AUDIO_BITRATE=448000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [hwac3] afm: hwac3 (AC3 through S/PDIF)
==========================================================================
[AO_ALSA] alsa-lib: conf.c:4514:(parse_args) Unknown parameter AES0
[AO_ALSA] alsa-lib: conf.c:4647:(snd_config_expand) Parse arguments error: No such file or directory
[AO_ALSA] alsa-lib: pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM hw:0,1,AES0=6
[AO_ALSA] Format ac3be is not supported by hardware, trying default.
AO: [alsa] 48000Hz 2ch ac3le (2 bytes per sample)
ID_AUDIO_CODEC=hwac3
[Mixer] No hardware mixing, inserting volume filter.
[format] Sample format big-endian AC3 not yet supported
Starting playback...
[mpeg4 @ 0x8973900]Invalid and inefficient vfw-avi packed B frames detected
Movie-Aspect is 1.83:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.8333
VO: [xv] 704x384 => 704x384 Planar YV12  [zoom]
[ass] PlayResX undefined, setting to 384
« Last Edit: March 29, 2012, 07:57:19 AM by CJ »

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10667
  • MLUs Forever!
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #4 on: March 29, 2012, 08:13:21 AM »
Just18, thanks for you feedback, much appreciated.
Weren't there stability issues as reason why PCLOS is not born with PA, or do my memory fail me?


A few years ago .....  possibly .....  but it may also have been that it was not properly set up.
I dunno ......  all I can say is that I have been using it for 2 + years now without much hassle.

Anyway, everything has some period of instability .....  even most people  :D

I don't know what the situation is with 5.1 sound as I don't use it.  Two speakers is more than sufficient for me  ;D

MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline CJ

  • Sr. Member
  • ****
  • Posts: 454
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #5 on: March 29, 2012, 12:39:27 PM »
I have just noticed that none of the levels in Kmix have any effect, not even the master volume.
Since there is only one tab (HAD_ATI SB), I suspect the issue might be here: the digital part is not seen.
Strange, as it is seen in KDE system settings (Phonon).

Anyone have any ideas to throw at me on this? A config file somewhere, perhaps?

Anyway, everything has some period of instability .....  even most people  :D
Ha, I am angling towards that state myself right now!  ;D

CJ
« Last Edit: March 29, 2012, 12:41:20 PM by CJ »

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10667
  • MLUs Forever!
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #6 on: March 29, 2012, 12:44:27 PM »
Open the mixer - Settings - Configure Kmix  ......  do you have the opportunity to add other slider options to the list?

MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline CJ

  • Sr. Member
  • ****
  • Posts: 454
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #7 on: March 29, 2012, 01:44:42 PM »
Open the mixer - Settings - Configure Kmix  ......  do you have the opportunity to add other slider options to the list?
Only if you mean 'Configure Channels'... and there, I already have all of them showing.

CJ

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10667
  • MLUs Forever!
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #8 on: March 29, 2012, 01:56:35 PM »
Qas mixer in the repo has a lot of info and access to various things that do not appear on other mixers.

I would suggest trying it ...... 
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline CJ

  • Sr. Member
  • ****
  • Posts: 454
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #9 on: March 29, 2012, 02:19:22 PM »
Qas mixer in the repo has a lot of info and access to various things that do not appear on other mixers.

I would suggest trying it ...... 

Already did... but basically nothing different here.

Cheers!

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10667
  • MLUs Forever!
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #10 on: March 29, 2012, 02:22:50 PM »
Qas mixer in the repo has a lot of info and access to various things that do not appear on other mixers.

I would suggest trying it ...... 

Already did... but basically nothing different here.

Cheers!


Oh well ......  that leaves me with the original suggestion of Pulse Audio  :(
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline CJ

  • Sr. Member
  • ****
  • Posts: 454
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #11 on: March 29, 2012, 02:36:58 PM »
Oh well ......  that leaves me with the original suggestion of Pulse Audio  :(
Duly noted.

I managed to get Clementine to play but manually setting the device to 'hw:0,1'...

Isn't there a 'system' config file where this priority can be changed globally, or do I remember wrongly?

CJ

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10667
  • MLUs Forever!
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #12 on: March 29, 2012, 03:12:48 PM »
Oh well ......  that leaves me with the original suggestion of Pulse Audio  :(
Duly noted.

I managed to get Clementine to play but manually setting the device to 'hw:0,1'...

Isn't there a 'system' config file where this priority can be changed globally, or do I remember wrongly?

CJ


I have not done so for about three years .......  but yes there is such a file .....  also you can add one for each user in the user account .........  there should be some threads on such doings in the forum.

I gave up all that manual config stuff when I installed Pulse Audio  ;)
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline CJ

  • Sr. Member
  • ****
  • Posts: 454
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #13 on: March 30, 2012, 07:29:20 AM »
I have just noticed something:
Code: [Select]
aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=SB
    HDA ATI SB, VT1818S Analog
    Default Audio Device
front:CARD=SB,DEV=0
    HDA ATI SB, VT1818S Analog
    Front speakers
surround40:CARD=SB,DEV=0
    HDA ATI SB, VT1818S Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0
    HDA ATI SB, VT1818S Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0
    HDA ATI SB, VT1818S Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0
    HDA ATI SB, VT1818S Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0
    HDA ATI SB, VT1818S Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=SB,DEV=0
    HDA ATI SB, VT1818S Digital
    IEC958 (S/PDIF) Digital Audio Output

Shouldn't all these be using DEV=1, as per:
Code: [Select]
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: VT1818S Analog [VT1818S Analog]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
card 0: SB [HDA ATI SB], device 1: VT1818S Digital [VT1818S Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

I am starting to lose hair over this issue, I tell you!

Cheers!
CJ

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10667
  • MLUs Forever!
Re: Sound: SPDIF confusion - some apps analog, some digital.
« Reply #14 on: March 30, 2012, 07:39:15 AM »
Save your hair by installing Pulse Audio and give it a try .......  you can always uninstall it again if you wish  :D
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT