Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Advice needed for .asoundrc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
psycho
Guru
Guru


Joined: 22 Jun 2007
Posts: 534
Location: New Zealand

PostPosted: Tue May 04, 2021 10:30 pm    Post subject: [SOLVED] Advice needed for .asoundrc Reply with quote

Timidity works for a while as an ALSA server:
Code:
timidity -iA
It will sit there in the background happily playing anything that's sent to one of its open ports (e.g. 128:0) by aplaymidi or whatever...for about five seconds. Then it will either start to produce unpleasant noise, or stop making any sound at all.

Stranger still (given that all other audio software seems to be working perfectly) it completely fails to work as a standalone player: it reports no error but plays no audio (and it's not the instrument patches as they work, both the defaults and alternatives, for a few seconds via the ALSA server). I've tried enabling the old ALSA API in the kernel in case it was doing something in some weird outdated way but this makes no difference.

Anyway, I know my own .asoundrc is at fault, because simply deleting it fixes timidity (though this breaks other more important stuff). The following is my setup for audio out through my speakers and audio in through my webcam microphone:
Code:
pcm.speakers {
    type hw
    card 0
}

ctl.speakers {
    type hw           
    card 0
}

pcm.usb
{
    type hw
    card C920
}

pcm.!default
{
    type asym
    playback.pcm
    {
        type plug
        slave.pcm "dmix"
    }
    capture.pcm
    {
        type plug
        slave.pcm "usb"
    }
}
Can anyone see what I'm doing wrong there, and/or how I could edit things so that timidity works as it does without this setup? The lack of any mention of "speakers" in my !default definition bothered me when I wrote it, but I based it on documented examples and as I say it does work with everything else, from mplayer/vlc/etc. through to browsers/Zoom/Skype and so on...it's only MIDI that isn't working. I'd be very happy if someone could spot an .asoundrc tweak or some other fix that would get this last detail of my audio setup working.

Last edited by psycho on Wed May 05, 2021 7:35 am; edited 1 time in total
Back to top
View user's profile Send private message
steve_v
Guru
Guru


Joined: 20 Jun 2004
Posts: 388
Location: New Zealand

PostPosted: Wed May 05, 2021 5:05 am    Post subject: Reply with quote

TBH I gave up on timidity in daemon mode, it really doesn't seem to like outputting through ALSA plugins of any kind (asym and dmix included). From what I can see it appears to be related to buffer sizes, but given how dead the project is, that's as far as I got.
Fluidsynth is a CPU hog, but it works fine in this scenario. It's also actively maintained, where AFAICT timidity has seen no development since 2004.

Out of interest (I don't have an answer, but I'm curious if it's the same problem I was seeing), does running timidity in daemon mode with verbose output (-iA -vv or the like) start spewing "file descriptor in bad state" after a couple of client connect/disconnects?
_________________
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
Back to top
View user's profile Send private message
psycho
Guru
Guru


Joined: 22 Jun 2007
Posts: 534
Location: New Zealand

PostPosted: Wed May 05, 2021 7:35 am    Post subject: Reply with quote

Thank you: it looks like that was the problem... timidity itself was broken, rather than my alsa configuration... I've seen fluidsynth there as an alternative for years but have ignored it as timidity has done everything I've needed until now... fluidsynth appears to do all the same things with less hassle, and best of all it actually works. Bye bye timidity...I think it's around 20 years I've been using that as my alsa midi server...I've got a few scripts and GUI applications still to tweak so they work with fluidsynth but I can already see that they're all going to work perfectly as it presents exactly the same service on the same port...only now it actually works with my .asoundrc.

Re your -iAvvv question, it didn't report anything useful at all... just played the audio for a few seconds and then played noise or nothing with no error messages to indicate why. Just broken I guess...anyway, even if there are configuration changes to make it work, I'm happy with fluidsynth now so this problem's solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum