Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 02 Sep 2014, 15:03
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Derivatives
mpdPup - Simplified MPD Music Server/Jukebox - v0.9.3
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 35 of 35 [523 Posts]   Goto page: Previous 1, 2, 3, ..., 33, 34, 35
Author Message
lugili

Joined: 24 Feb 2013
Posts: 15

PostPosted: Mon 09 Dec 2013, 04:50    Post subject:  

It would be sad, if this was a dead pup ... it has a lot going for it. Sad

Dynobot,
what is your suggested alternative for the last 20% of sq on an alix board? Back to voyage mpd where I came from?
Back to top
View user's profile Send private message 
lugili

Joined: 24 Feb 2013
Posts: 15

PostPosted: Mon 09 Dec 2013, 04:50    Post subject:  

It would be sad, if this was a dead pup ... it has a lot going for it. Sad

Dynobot,
what is your suggested alternative for the last 20% of sq on an alix board? Back to voyage mpd where I came from?
Back to top
View user's profile Send private message 
DenisP

Joined: 25 Mar 2013
Posts: 56
Location: Croatia

PostPosted: Thu 12 Dec 2013, 13:55    Post subject:
Subject description: Anyone use E-MU 0404 USB?
 

I got an E-MU 0404 USB "sound card" for testing, which is used as external DAC, and I need to get it working with mpdPup.

It works (kind of) - the problem is that it does NOT swich sample rates automatically: I need to use "alsamixer" and manually set "Clock rate", where e.g. 100% is used for hi-res 24/192 sample rates, and if I turn it off completely, then it's good for playing 16/41... So, for every track that uses different sample rate, I should change clock rate in alsamixer manually Sad

If I use wrong sample rate ("Clock rate") while playing track with a different sample rate (e.g. when I use a 100% setting in alsamixer for a track which has 16/41 rate), I get horribly distorted, tinny sound.

On other newer Linux distros this DAC/sound card seems to be working OK (i.e. sample rate is switched/changed automatically, without the need for "manual" intervention).

Anyone has any idea what could be done to solve this in mpdPup - i.e. to handle the sample rate (clock rate) automatically?
alsamix-emu0404.jpg
 Description   alsamixer E-MU 0404 USB
 Filesize   34.9 KB
 Viewed   1780 Time(s)

alsamix-emu0404.jpg

Back to top
View user's profile Send private message 
wlowes

Joined: 07 Jun 2012
Posts: 48
Location: Toronto, Canada

PostPosted: Fri 13 Dec 2013, 21:44    Post subject: any ideas how to upgrade?  

Looks like Ildose is busy or taking a well deserved break.

Does anyone know how to upgrade MPDPUP to use MPD 18?
Back to top
View user's profile Send private message 
DenisP

Joined: 25 Mar 2013
Posts: 56
Location: Croatia

PostPosted: Tue 17 Dec 2013, 13:36    Post subject:
Subject description: E-MU 0404 USB problem... possible solution?
 

Well, further to my problem with E-MU 0404 USB DAC:
- I tried compiling newer alsa (alsa-driver, alsa-firmware, etc.), but to no avail: the compiled alsa-driver throws errors when used (and I seem to be missing "alsamixer"), so I gave that up Sad

But, since this is Linux we're dealing with, I realized that there's more ways to skin a cat Smile
If I can't make this DAC "behave" properly, I could do a "manual" change of DAC sample rate on every track change - and automate it!

I'm working on a bash script that will take output from
Code:

cat /proc/asound/card1/stream0 | grep Momentary

where the output of the above command looks like this:
Code:

  Momentary freq = 44098 Hz (0x5.8320)

and, taking just the first two digits after the equal sign, see which sample rate the track uses, compare it to currently active DAC sample rate, and change it accordingly if it differs... It should all be done during the first half a second of the new track, so that there's no audible "glitches"...

Easier said than done.... I'm still struggling (never did any bash scripting to speak of), but I'm getting close...

Unless anyone has a better idea?
Back to top
View user's profile Send private message 
willemoes

Joined: 08 Nov 2012
Posts: 13

PostPosted: Tue 17 Dec 2013, 16:36    Post subject: Re: any ideas how to upgrade?  

wlowes wrote:
Looks like Ildose is busy or taking a well deserved break.


- second that.

Hope everything is well, Idolse -

- enjoying the fruit of your work almost daily
Back to top
View user's profile Send private message 
DenisP

Joined: 25 Mar 2013
Posts: 56
Location: Croatia

PostPosted: Wed 18 Dec 2013, 06:49    Post subject: Re: any ideas how to upgrade?  

willemoes wrote:


- second that.

Hope everything is well, Idolse -

- enjoying the fruit of your work almost daily


We haven't heard from Idolse in a while, I sure do hope he's OK..

Likewise, I am enjoying his work on mpdPup on a daily basis Smile

And, Idolse, please contact me at
denple AT gmail.com

- I promised you a hardware donation, which is still waiting for you Smile
Back to top
View user's profile Send private message 
DenisP

Joined: 25 Mar 2013
Posts: 56
Location: Croatia

PostPosted: Wed 18 Dec 2013, 12:33    Post subject:
Subject description: E-MU 0404 USB solved...
 

And, BTW, I solved my problems with E-MU 0404 USB and mpdPup - by using a bash script which I cobbled together somehow. Now the E-MU 0404 USB works on all sample rates.

If anyone's interested, I can post the script here, primitive as it is Smile
Back to top
View user's profile Send private message 
Smithy


Joined: 12 Dec 2011
Posts: 422

PostPosted: Sat 21 Dec 2013, 07:28    Post subject:  

Yes if you can post it Denis P that would be good to have a look at the Emu chip.

If you could get that analogue input pin going even better, Smile I don't think the Alsa people have quite finished the job on the Emu chip, but it is pretty good when used with Jack and audio programs. Up to 192khz available (if anyone can spot the difference between 88.2khz+192khz).
Back to top
View user's profile Send private message 
DenisP

Joined: 25 Mar 2013
Posts: 56
Location: Croatia

PostPosted: Sun 22 Dec 2013, 04:43    Post subject:  

Smithy wrote:
Yes if you can post it Denis P that would be good to have a look at the Emu chip.


Well, here's the script. Perhaps I should not post such ugly hacks, but, hey - it works Smile

Unfortunately, I had to return the E-MU 0404 device - I just had to make it work for someone else. Hopefully, the owner will be satisfied...

Anyway, here's the script:
Code:

#!/bin/bash

# if this is the first run, EMU-rate does not exist,create it
if [ ! -f /dev/shm/EMU-rate ]; then    # file does not exist
    echo "00" > /dev/shm/EMU-rate
fi


while : ; do
   mpc idle
   # stuff below executes when mpc is not idle

   sleep 0.4 # wait for actual track to start playing (fist 0,4 sec., to determine the sample rate)
   old_rate=$(cat /dev/shm/EMU-rate)
   # echo "old rate:$old_rate"
   sRateStr=$(cat /proc/asound/card1/stream0 | grep Momentary)
   # echo "full line: " $sRateStr
   cur_rate=${sRateStr:21:2} # here we get just the first two digits (44, 48, 96, etc.)
   # echo "cur rate:$cur_rate"
   # if $cur_rate is empty, next iteration ("continue")
   if [ -z "$cur_rate" ] # string is empty
   then
     # echo "No song playing"
     continue  # $cur_rate is null/empty, nothing to do, wait for next iteration
   fi

   # echo "Track sample rate: $cur_rate"
   if [ "$old_rate" = "$cur_rate" ]
   then
     # echo "The rates are the same"
     continue # rates are the same, nothing to do, wait for next iteration
   fi

   # here we actually compare rates and take appropriate action (change EMU clock rate using "amixer")
   # E-MU 0404 is visible as "card 1" on my system, i.e. it needs switch "-c1" for manipulation

   case $cur_rate in
   44)
   amixer -c1 set 'Clock rate Selector' 0
   echo "$cur_rate" > /dev/shm/EMU-rate
   continue
   ;;
   48)
   amixer -c1 set 'Clock rate Selector' 1
   echo "$cur_rate" > /dev/shm/EMU-rate
   continue
   ;;
   88)
   amixer -c1 set 'Clock rate Selector' 2
   echo "$cur_rate" > /dev/shm/EMU-rate
   continue
   ;;
   96)
   amixer -c1 set 'Clock rate Selector' 3
   echo "$cur_rate" > /dev/shm/EMU-rate
   continue
   ;;
   17)
   amixer -c1 set 'Clock rate Selector' 4
   echo "$cur_rate" > /dev/shm/EMU-rate
   continue
   ;;
   19)
   amixer -c1 set 'Clock rate Selector' 5
   echo "$cur_rate" > /dev/shm/EMU-rate
   continue
   ;;
   esac    

   echo "$cur_rate" > /dev/shm/EMU-rate

done


I've left the comments there, in hope it will be easier to understand... I hacked it together from several other scripts I found online: I never did any bash scripting before (except twiddling other people's scripts a bit...), so be lenient Smile
Back to top
View user's profile Send private message 
Smithy


Joined: 12 Dec 2011
Posts: 422

PostPosted: Sun 22 Dec 2013, 11:06    Post subject:  

Looks alright to me Denis P, especially as it did the job!
Just wondering,
did you think that it was possible to add 16khz and 22khz or does the first zero switch mean that the lowest it would go was 44.1 khz?
I know it may be difficult to answer because you have returned the emu.
Back to top
View user's profile Send private message 
DenisP

Joined: 25 Mar 2013
Posts: 56
Location: Croatia

PostPosted: Sun 22 Dec 2013, 18:02    Post subject:  

Smithy wrote:
Looks alright to me Denis P, especially as it did the job!
Just wondering,
did you think that it was possible to add 16khz and 22khz or does the first zero switch mean that the lowest it would go was 44.1 khz?


The reason is simple: "00" (two zeros) are intentionally WRONG - so that any sample rate that the E-MU "wakes up" with when it's turned on will show that the sample rates (of the currently playing song and the one written as "previous" in the E-MU sample rate file under /dev/shm) are always different, and the rest of the script (automatic adjustment) is always invoked... I think I had some problems without that solution...

So, it's just something I thought would take care of the situation when "/dev/shm/EMU-rate" file does not yet exist (when the computer is turned on), and the first song is e.g. in 24/192 (I think that the E-MU "wakes up" with sample rate 16/48 by default....).

As for other sample rates, the guy using it does not have any tracks with sample rates below 16/41, and in general does not listen to MP3 tracks (and those are usually in 320Kbps) - so there was no need to add any other sample rates.

The E-MU supports the following rates (with corresponding settings in alsamixer "Clock rate Selector"):

Code:
Clock rate      Sample rate    "/dev/shm/EMU-rate"
  setting                          shorthand code
    0               44100                44
    1               48000                48
    2               88200                88
    3               96000                96
    4              176400                17
    5              192000                19
Back to top
View user's profile Send private message 
Dynobot

Joined: 05 Dec 2012
Posts: 44

PostPosted: Tue 24 Dec 2013, 23:50    Post subject:  

.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 35 of 35 [523 Posts]   Goto page: Previous 1, 2, 3, ..., 33, 34, 35
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Derivatives
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0999s ][ Queries: 13 (0.0148s) ][ GZIP on ]