[kde-linux] S/PDIF sound
Duncan
1i5t5.duncan at cox.net
Mon Jul 16 10:36:05 UTC 2012
James posted on Sun, 15 Jul 2012 19:33:50 -0400 as excerpted:
> On 07/15/12 19:21, James wrote:
>> On 07/15/12 19:20, James wrote:
>>> I use KDE-4.8.4 with digital sound (S/PDIF).
>>> I upgraded my kernel and kaffeine broke (and I'm sure other apps).
>>> The system sounds work, Amarok works, VLC works.
>>> I think it has something to do with the alsa device order.
>>> My default device was my tvtuner.
>>> Card: Conexant CX23885
>>>
>>> I changed /etc/asound.conf to have ctl.!default {
>>> type hw card 1
>>> }
>>> and now alsaixer defaults to the right card:
>>> Card: HDA ATI SB
>>>
>>>
>>> 1. Kaffeine errors and says it can't open the audio device.
>>>
>>> 2. kmix doesn't work.
>>>
>>> 3. The error dialog of kmix does a system beep which cuts off any
>>> other sound (eg. if I am playing music with Amarok, the audio stops
>>> when the system beeps but Amarok thinks it is still playing.
>>
>> 4. Firefox has no sound, HTML5 or Flash.
>
> The Amarok volume control works.
Interesting. It seems you and I have similar systems. Also hda ati sb,
also S/PDIF-only output.
But I just upgraded my mobo and etc from an 8+ year-old system (tho it
was pretty good in its day, dual socket dual-core opteron 390s) a week or
so ago, and am running 3.5 pre-release kernels (direct from linus/
mainline git, and actually I'm running the kde 4.9 pre-releases as well),
so I don't have a history of previous kernel/alsa behavior on this
hardware to go on.
I also run gentoo, so everything's much more heavily customized than it
would be on most distributions.
But FWIW, here's what I've found, here on the new mobo (Gigabyte
ga-990fxa-ud3 with amd's 990fx chipset, bulldozer fx6100 cpu), plus some
points addressing the specific apps you mention above:
1) Much to my disappointment, the sound card only seems to be able to
play a single stream at a time, at least on the current kernel. That's
probably what you're seeing too. If you try to play a second stream,
it'll either give you permission errors, or cut off whatever was playing
before.
I've no idea if that's how this particular hardware is supposed to work
or not, because as I said I don't have a history with it to go on. But I
do know in general, that a lot of "cheap" modern sound hardware does have
this issue. FWIW, that's what pulse-audio and the various other sound
servers are supposed to help out with. But I've never run pulse-audio
and I really don't want to start running it now. For the moment at
least, I've adjusted my configuration as described below, to work around
the issue.
2) S/PDIF out is line-level, so most of the mixer controls (alsamixer or
kmix) won't do anything at all, as they're for conventional analog out.
This is the way S/PDIF out works in general, and was the case with my
previous system as well, so unlike #1, this isn't specific to this sound
device or kernel, it's just the way S/PDIF works.
There are a few exceptions. The PCM control should work, and will
control the sound level for all pulse-modulated (normal computer) sound.
The S/PDIF toggle should still work -- it's just a toggle but works
rather conveniently as a mute control, if you don't have anything
connected to the analog out anyway.
Line-in and mic-in controls should work if you have the appropriate
equipment hooked up to them, and the capture controls should also work,
altho I've not actually tested any of that here.
But master/front/side/rear/center/lfe won't do anything, since those are
analog output level controls.
3) As a result of #2, I just use the ncurses based alsamixer in a text VT
login or konsole window when needed (the alsa initscript sets volumes
back to what they were on boot, and I simply never change them,
controlling the volume via the amp the S/PDF outputs to, or via
individual application volume controls, instead), and don't even have kmix
installed.
However, if you do choose to keep it installed, you may wish to configure
the PCM as your "master" channel, after which you can simply click on the
kmix tray icon and adjust the volume level, via PCM which as I said does
still work, there. I had it configured that way for awhile, before I
decided I didn't really need it. (Gentoo, being compile-from-source,
definitely motivates one to uninstall anything not actually needed or
used that much, so as to avoid having to rebuild such packages every time
they update! But that's good security practice anyway, since if a
package isn't installed any possible vulnerabilities found in it won't
affect you, so one can view it as simply extra motivation to do what one
SHOULD be doing anyway! =:^)
4) FWIW, I run the qt4-based smplayer and/or vlc, instead of kaffeine,
here. Kaffeine for kde4 took too long to get back to the same level of
control it allowed in kde3, so I was forced to look for other apps to
replace it, and discovered that smplayer had about the same level of
control available anyway. (However, you mentioned a TV tuner card. I
don't have one of those so don't need to worry about that, but I don't
think smplayer has kaffeine's feature level there.) Later I found vlc,
when I decided to switch from phonon-xine, now deprecated by kde anyway,
to phonon-vlc, for the phonon backend, and vlc works quite well too, tho
it doesn't seem as closely integrated with kde as both kaffeine and (with
the kde skinning turned on) smplayer are.
Likewise, the kde4 amarok upgrade wasn't something I liked. They seemed
to kill most of the features I actually used, while continuing to develop
and expand features I did NOT use. The last straw for me was when they
decided to depend on a particular mysql component that was broken (had
never worked right) on amd64/x86_64 at that time, basically flipping the
bird at all their amd64 users. That's long since fixed, but I'm long
since gone, too. It's their app so they can do what they want with it,
but if they don't respect the users more than that, I certainly don't
have to use it. Plus amarok was always rather dependency heavy anyway,
especially for people like me that didn't need or use its fancy music
collection management features. So getting rid of it allowed me to dump
a whole list of pulled in dependencies that only amarok needed. (FWIW, I
switched to mpd, which even combined with the multiple front-ends I have
installed, STILL is far smaller than amarok and its many dependencies!)
So I won't be able to help you directly with kaffeine or amarok, only in
general there.
5) Firefox, being a gtk-based app, uses gstreamer for sound. FWIW, while
I do have firefox and a number of other gtk (v2 not v3 yet) based apps
installed, I don't have nor want either gnome or gstreamer installed, and
I have gentoo's firefox gstreamer USE flag turned off so it doesn't pull
it in. So no sound in firefox, here. And flash is servantware, which I
couldn't legally install if I wanted to since I can't and won't agree to
sign over my rights as demanded by their EULA and thus don't have
permission to install and run the software, so no flash to worry about
either. (I could do lightspark and/or gnash, but in general I've found
them too much trouble to be worth it, and minitube handles youtube so I
don't need flash for that.)
But being gstreamer based, that's another sound stream you need to think
about. As I don't have gstreamer installed I don't know how the phonon-
gstreamer backend works. It's possible that if you set it up right,
gstreamer will merge the phonon and firefox gstreamer streams as a sound
server normally would, thus allowing you to play both at once, but of
course I can't test that or explain what that configuration would be,
without gstreamer installed.
6) Meanwhile, here's what I did with my sound here, as mentioned above:
Since only one audio stream will play at once, I went into kde settings,
hardware, multimedia, phonon, and under notifications, set the discard
all samples (playback) "device" to highest priority. An alternative
would be in kde settings, common appearance and behavior, application and
system notifications, manage notifications, on the player settings tab,
set no audio output.
Either way the effect is the same, sound effects/notifications still
remain set, but they don't actually play, so they won't interrupt the
currently playing stream. Yeah, the sound effects are nice, but not if
it's going to cut off the internet radio or whatever I was listening to.
That should take care of the system beep or other sound effects cutting
off whatever else is playing.
7. Other than that, simply choose what you're going to play, and don't
start anything else that will either interrupt it or not be able to run
anyway. Then when you're done playing the one thing, shut down that app
so it's not trying to play anything and the sound device is free, and the
next app should be able to play.
8. Or go the pulse-audio route. As I said I don't have that installed
either, and don't really want it installed, but it should allow you to
mix sound streams.
9. There's also an alsa tool/driver called dmix, which is supposed to
let you merge multiple streams directly in alsa-dmix.
If I get tired of no sound effects or whatever, and can't otherwise
figure out how to get the hardware to handle multiple audio streams, this
is likely what I'll try. But as I said, I've only had this hardware
about a week, and I never had that problem with my previous hardware (amd
8xxx series chipset with its ac97 alsa codec), so I've never actually
needed dmix before, tho I had read of it. So I'm afraid I won't be of
much help with configuring that, either.
Hope that's somewhat helpful, at least, even if it's not exactly the best
news. But at least you know someone else is having similar issues with
that sound hardware, and how to work around them, turn kde notification
sounds off (set no sound as described above), and play only one sound
stream at a time.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
More information about the kde-linux
mailing list