# HOWTO: kicking out Arts in the right way

## Matteo Azzali

I just noticed there's not an howto for KDE + bare alsa configuration, I'm sorry, here we go.

Arts can be a pain and removing it may be a real joy for most KDE users, but if you do in the wrong way 

you'll find yourself without previews in konqueror and without system notification sounds.

Care: you'll need to have a perfect alsa +mixer (hardware or dmix) setup and still there are issues

with skype (<1.3 as 1.3.x supports alsa) and teamspeak (see below) that don't support alsa 

1) If you want to have still the previews in konqueror you'll have to keep arts emerged (even if disabled in kcontrol):

still arts will not eat-up memory or processor time.

To do this ,you can make sure your system has arts flag disabled (-arts)

and you'll add this flag just for some packages in your /etc/portage/package.use:

```

kde-base/kdm arts

kde-base/kdelibs arts

kde-base/mpeglib arts

```

Older versions of kde needed also kde-base/kdemultimedia-arts arts but that's not needed in the latest versions.

2) if you still want to use system notification, you can use an external player , like /usr/bin/play or sox

(part of the sox package), however in this way you can not: 

a-adjust volume or other command line parameters 

b-play two or more system notifications (sounds) simoultaneously 

To fix both of these issues (a and b), I created a script as /usr/local/bin/Ksplay:

```

#!/bin/sh 

sox "$@" -q -t alsa default vol 0.7 & 

```

thyen I did a 

```

chmod a+x /usr/local/bin/Ksplay

```

to make sure it's executable, and I've put /usr/local/bin/Ksplay as external player

in the system notification options (kcontrol).

3) now there are just two apps you may encounter issues with: both skype and teamspeak are still

not using alsa. (even if both seem to work, actually, they seem to get the sound exclusively.... no mixing)

Edit: better wrapper script(should be definitive), thanks to VoVan, renamed the script to avoid collision with bplay

package and removed artsplugin-xine from package.use (thanks to Headrush for pointing out)

Apr-2007 : changed the volume option

----------

## Telemin

Thanks for this.  Arts has always been the bane of my life.  :Very Happy: 

You might wanna considering adding it to the wiki as well.

----------

## Headrush

 *Matteo Azzali wrote:*   

> I just noticed there's not an howto for KDE + bare alsa configuration, I'm sorry, here we go.

 

Actually we had a thread detailing this almost exactly, several KDE versions ago.

It just shows how threads can be lost and that maybe adding this to the Gentoo ALSA wiki might be a good way to keep it current.

(Then again with KDE 4.0 we won't have to worry about arts.   :Cool:  )

A couple pointsYou may want to rename your script as there is a bplay package in portage already.

The current versions of artsplugin-xine doesn't have an arts USE flag. (Its always enabled in the ebuild.)

Why did you enable kdm with arts USE flag?Just curious, is dmix enabled by default in the newer versions of ALSA? If so, shouldn't any of the variants work? (play, aplay, bplay)

Edit: Fixed mistake.

----------

## Temet

I was using "play" before.

Your small script for bplay is so much better.

Thanks a lot!  :Wink: 

----------

## VoVaN

I'm using just a simple file play.sh instead:

```
#!/bin/sh

sox "$@" -v 0.9 -q -t alsa default &

```

The 'play' from sox package is just a shell script/wrapper, so when you're using 'play' in a script you're actually executing shell twice. Secondly, I would suggest using #!/bin/sh instead of bash because it's a lot quicker to execute (I know sh is just a link to bash, but if you do 

```
LD_DEBUG=statistics bash --version
```

 and do the same for sh you'll see a huge difference). Would be nice to use sox directly as an external player for kde, but unfortunatelly it's not possible to set any comman line parameters...

----------

## bdm

Thanks for this! I'll have to try this out once I get a nice and stable machine going.  :Smile: 

For now, I simply disabled all of the sounds KDE was doing. Same thing, right?

----------

## Matteo Azzali

 *Headrush wrote:*   

> 
> 
> Actually we had a thread detailing this almost exactly, several KDE versions ago.
> 
> It just shows how threads can be lost and that maybe adding this to the Gentoo ALSA wiki might be a good way to keep it current.
> ...

 

I'm not experienced about the wiki, if anyone want to insert it thanks to him....

 *Quote:*   

> 
> 
> A couple pointsYou may want to rename your script as there is a bplay package in portage already.
> 
> The current versions of artsplugin-xine doesn't have an arts USE flag. (Its always enabled in the ebuild.)
> ...

 

thank you, removed.

 *Quote:*   

> Why did you enable kdm with arts USE flag?Just curious, is dmix enabled by default in the newer versions of ALSA? If so, shouldn't any of the variants work? (play, aplay, bplay)
> 
> Edit: Fixed mistake.

 

1-kdm without arts flag caused various issues in the past, maybe actually can be removed but I still haven't tested,

also, would png/jpeg avatars work fine without arts flag?

2-system notification invokes the "variants" as commands in a single shell, you should then use "play &" "aplay &", etc.

but the field for the external player doesn't like multiword text (that's why you can't directly invoke the second script line

putting in that field).

----------

## Matteo Azzali

 *bdm wrote:*   

> Thanks for this! I'll have to try this out once I get a nice and stable machine going. 
> 
> For now, I simply disabled all of the sounds KDE was doing. Same thing, right?

 

Yes, the modify here are to get system-sounds and previews in konqueror with the less possible packages emerged

and arts disabled.

----------

## Maedhros

Moved from Multimedia to Documentation, Tips & Tricks as this isn't a support request.   :Smile: 

----------

## Headrush

 *Matteo Azzali wrote:*   

> would png/jpeg avatars work fine without arts flag?

 

Why wouldn't they, what does arts have to do with graphic formats?

 *Matteo Azzali wrote:*   

> 2-system notification invokes the "variants" as commands in a single shell, you should then use "play &" "aplay &", etc.
> 
> but the field for the external player doesn't like multiword text (that's why you can't directly invoke the second script line
> 
> putting in that field).

 

I just meant if dmix was enabled by default, everyone has mixing of multiple sounds so any of the player should work.

(Nothing to do with multiword test.)

----------

## Matteo Azzali

 *Headrush wrote:*   

>  *Matteo Azzali wrote:*   would png/jpeg avatars work fine without arts flag? 
> 
> Why wouldn't they, what does arts have to do with graphic formats?

 

In kde 3.5_beta2, if you completely removed the arts flag you losed completely the preview functionality of konqueror.

I don't know if in 3.5.x the behaviour is still the same, but this was my previous report. As specified

somewhere else, arts (as nmm, or gstreamer) isn't just a sound demon, is/was a multimedia framework. But the sound

demon is the buggy/nasty component that gives/gaved headaches to kde users. (there's no much people complaining about

konqueror previews bugs)

 *Headrush wrote:*   

>  *Matteo Azzali wrote:*   2-system notification invokes the "variants" as commands in a single shell, you should then use "play &" "aplay &", etc.
> 
> but the field for the external player doesn't like multiword text (that's why you can't directly invoke the second script line
> 
> putting in that field). 
> ...

 

open konsole, hit play <filename> with a wav of some seconds and without the "&" char, then try to open another wav from

the same teminal. You can't. The issue is the same, cause the external player mechanism isn't (or wasn't) generating

multiple shells , being just a transposition of the art system notification mechanism (and I would guess that having a demon

you don't need to use the "&" to make it play a sound and have the terminal not busy.....)

----------

## Headrush

 *Matteo Azzali wrote:*   

> In kde 3.5_beta2, if you completely removed the arts flag you losed completely the preview functionality of konqueror.
> 
> I don't know if in 3.5.x the behaviour is still the same, but this was my previous report. As specified
> 
> somewhere else, arts (as nmm, or gstreamer) isn't just a sound demon, is/was a multimedia framework. But the sound
> ...

 

Weird, never heard about that. (Something new to look and check out.)

 *Matteo Azzali wrote:*   

> open konsole, hit play <filename> with a wav of some seconds and without the "&" char, then try to open another wav from
> 
> the same teminal. You can't.

 

It worked.

I understand what you are saying though, the external player option doesn't allow passing the "&" needed to background the first playing sound.

(Which is weird also in that you would expect each to spawn a new shell environment to run in.)

Looking at the play program after evaluating any parameters passed to it, it calls sox with the following command

```
eval sox $gopts $play_opts $arch_defines $device $effects
```

If you modify this to add & like this

```
eval sox $gopts $play_opts $arch_defines $device $effects &
```

it plays multiple sounds from kde notifications fine.

I know that when using sox from the command line it displays output information, so I don't know if this would be worth asking the sox developers to add this or not.

Using a script above would still be useful if you need to modify other options to sox, but if those options aren't needed, this one change should do it.

I'll also be glad when arts is gone.   :Smile: 

----------

## Matteo Azzali

 *Headrush wrote:*   

> 
> 
> It worked.
> 
> 

 

Sorry, in my little english I was meaning "You can't until first sound isn't stopped".

Hopefully nmm will be ready for kde 4 launch, and even if it will not, phonon should let us choose which multimedia system

to use (and I would bet there will be some minimal, fast and light system to use, even if I actually would like to use

bare alsa and a multimedia system only for previewing)

----------

## VsMaX

Lol guys sory but i don't understand you - why you want to delete arts and what to use instead of that? My xmms doesn't work,  JuK plays music , but it cuts himself, and aoss plays music great :/ I dont have emerged arts and dont know - emerge him or not?

----------

## Matteo Azzali

 *VsMaX wrote:*   

> Lol guys sory but i don't understand you - why you want to delete arts and what to use instead of that? My xmms doesn't work,  JuK plays music , but it cuts himself, and aoss plays music great :/ I dont have emerged arts and dont know - emerge him or not?

 

I'm using bare alsa. xmms plays fine, amarok uses xine-engine, skype works with alsa and teamspeak can be wrapped

with aoss. The system notification sounds work fine (and mixed) with the script I provided.

The only reason for which I still have arts support in my kdelibs is that this is/was needed to show previews in konqueror

(100% sure it was needed for mpeg and avi thumbnails), does your system with "-arts" flag generates thumbnails for 

video files in konqueror?

----------

## VsMaX

So can you tell me how to use this script? Im not so good in linux yet  :Razz:  I think my sound it's terrible because i dont have enabled that hardware acceleration in Kde control center but i can't enable it untill i emerge arts. So please say me how to do that.

----------

## Matteo Azzali

 *VsMaX wrote:*   

> So can you tell me how to use this script? Im not so good in linux yet  I think my sound it's terrible because i dont have enabled that hardware acceleration in Kde control center but i can't enable it untill i emerge arts. So please say me how to do that.

 

Please reread first message, this is an howto for kde-users to use bare ALSA (no arts) and still have system-sound and previews,

not what you're looking for, sorry.

----------

## cevi

I didn't neeeded the previed in konqueror, so I decided that I compile everything without the arts useflag, but it seems as if knotify depends on arts in kdelibs, so if you want to use knotify( and you really want to usally ) you have to emerge kdelibs with arts not only when you just want the preview in konqueror

----------

## nabla²

flameeyes has just released kdelibs-3.5.5-r3 which don't need the arts flag at all. Seems to work.   :Very Happy: 

----------

## Matteo Azzali

 *nabla² wrote:*   

> flameeyes has just released kdelibs-3.5.5-r3 which don't need the arts flag at all. Seems to work.  

 

You get thumbnails in konqueror even without arts? I believed we would have to wait kde 4 for this,

but I would be happy to find myself wrong.....   :Rolling Eyes: 

----------

## AssociateX

This used to work for me but not tonight. What do you want to know?

----------

## AssociateX

bumb for another solution.

----------

## Matteo Azzali

1-arts is turned off (check kcontrol)?

2-if so, try so use alsaplayer , it's working?

3-if even to step 2 answer is yeas,then try to run the provided script 

(play.sh or whatever you use) from console with a random sound. Is working?

----------

## AssociateX

kcontrol>Sound & Multimedia>Sound System>"Enable the sound system" is now unchecked. ( I thought it was supposed to be checked) Doesn't matter though, with "Enable the sound system" checked I still don't have "System Notification" sound although the "Test Sound" button plays a sound. 

If I go to kcontrol>Sound & Multimedia>System Notifications>Actions> then press the play button there is no sound there (KDE_Glass_Break.ogg). Although the following does work:

me@athlon ~ $ /usr/local/bin/Ksplay  /usr/kde/3.5/share/sounds/KDE_Glass_Break.ogg <--- this plays a sound of glass breaking.

If I put aplay in "Player Settings"  kcontrol>Sound & Multimedia>System Notifications>Actions> then press the play button it sounds like garbage, like "cat /dev/urandom > /dev/adsp".

Doing the following sounds like garbage, too:

/usr/bin/aplay /usr/kde/3.5/share/sounds/KDE_Glass_Break.ogg

----------

## sonicbhoc

Why does everybody hate arts so much? It's never given me a problem as far as I know.

----------

## Matteo Azzali

 *AssociateX wrote:*   

> kcontrol>Sound & Multimedia>Sound System>"Enable the sound system" is now unchecked. ( I thought it was supposed to be checked) Doesn't matter though, with "Enable the sound system" checked I still don't have "System Notification" sound although the "Test Sound" button plays a sound. 
> 
> If I go to kcontrol>Sound & Multimedia>System Notifications>Actions> then press the play button there is no sound there (KDE_Glass_Break.ogg). Although the following does work:
> 
> me@athlon ~ $ /usr/local/bin/Ksplay  /usr/kde/3.5/share/sounds/KDE_Glass_Break.ogg <--- this plays a sound of glass breaking.
> ...

 

aplay isn't supposed to play ogg files. try to use:

#ogg123 --device=alsa09 filename.ogg

however your alsa is working if Ksplay works,

so please recheck your Kcontrol->Sound and Multimedia->System Notification-> advanced

the field whould contain JUST "/usr/local/bin/Ksplay" (without parenthesys), NOTHING more

(to change volume or other option, manually edit Ksplay file).

----------

## Matteo Azzali

 *sonicbhoc wrote:*   

> Why does everybody hate arts so much? It's never given me a problem as far as I know.

 

eh, uh, ohhhh, well it gaved hundreds of headaches to lots of users, from the infamous 99% cpu use to the issues

for speed, suid, etc.etc.

More than this, arts is gonna being discontuìnued (no arts in kde 4 , but phonon with nmm and other backends).

----------

## AssociateX

kcontrol>Sound & Multimedia>System Notifications>Player Settings>"Open file dialog" icon>click on Kplay script>click "OK">click "Apply" (An option that was greyed out previously for some reason)> click "OK">click "Apply" ... now it's working again for some reason.

The only thing that I have done differently beside what I mentioned about was recompile kde-base/kdelibs-3.5.5-r5 with out arts support. I did that before I did what I mentioned about.

Thank you for your help

----------

## pteppic

I've been slowly phasing out arts usage on my system for about 3 months now, I readiness for kde4, but my wrapper scripts for system sounds used three separate players for each filetype (ogg, mp3 and wav) and I was just trying to workout how to change the volume, when I saw the sox script, and banged my head against the keyboard a few times for being stupid   :Embarassed: 

----------

## Matteo Azzali

 *pteppic wrote:*   

> I've been slowly phasing out arts usage on my system for about 3 months now, I readiness for kde4, but my wrapper scripts for system sounds used three separate players for each filetype (ogg, mp3 and wav) and I was just trying to workout how to change the volume, when I saw the sox script, and banged my head against the keyboard a few times for being stupid  

 

I did the same at my first tries,perfect solution is often different from first solution   :Rolling Eyes: 

(and someone suggested me to use sox too....)

----------

## Matteo Azzali

Care! Latest Sox needs another volume option:

no more

```

#!/bin/sh

sox "$@" -v 0.7 -q -t alsa default &

```

that doesn't works anymore,but

```

#!/bin/sh

sox "$@" -q -t alsa default vol 0.7 &

```

----------

## Hwoarang

Hello 

I just did the above script but there is a series of segmentation fault on dmesg

Have look on some of them

```
...

sox[17553]: segfault at 0000000000000000 rip 00002b48c6370ca0 rsp 00007fffe549b468 error 4

sox[17574]: segfault at 0000000000000000 rip 00002b0fa4f55ca0 rsp 00007fff068b4888 error 4

sox[17576]: segfault at 0000000000000000 rip 00002b7954f3bca0 rsp 00007fff568ce8a8 error 4

sox[17648]: segfault at 0000000000000000 rip 00002b43467f3ca0 rsp 00007fff65017fe8 error 4

sox[18187]: segfault at 0000000000000000 rip 00002ace6800eca0 rsp 00007fff437fd7c8 error 4

sox[18573]: segfault at 0000000000000000 rip 00002b3e99e93ca0 rsp 00007fff11978948 error 4

sox[18575]: segfault at 0000000000000000 rip 00002af9c0a0aca0 rsp 00007fffeadffdd8 error 4

sox[19345]: segfault at 0000000000000000 rip 00002ac91db09ca0 rsp 00007fff8dd02cd8 error 4

sox[19347]: segfault at 0000000000000000 rip 00002b1ffce74ca0 rsp 00007fffae995968 error 4

...
```

----------

