Rockbox Technical Forums

Support and General Use => Recording => Topic started by: hellokytty on February 07, 2006, 07:59:49 AM

Title: Recording via optical-in
Post by: hellokytty on February 07, 2006, 07:59:49 AM
Hi,

I just wondered if the recording section on H 1** players is finished or if someone intends to add recording via optical-in.

I someone does it would be great knowing it's in progress. Otherwise I would like to say thank you all for the great recording features (e.g. the peakmeter) you gave to us.

Title: Re: Recording via optical-in
Post by: Mmmm on February 07, 2006, 08:34:03 AM
The recording screen is nowhere near finished...Have a look HERE (http://forums.rockbox.org/index.php?topic=2513.0) for a load of, as yet, uncommitted upgrades...

I don't know about the optical in though...I'm sure it will eventually get done although I personally cant think of any point in it...
Surely if you already have a digital source, you are better off re-encoding it using a computer instead of doing it real-time through the optical in? Or maybe there is something else you could use it for that I haven't thought of...?? :-)

Title: Re: Recording via optical-in
Post by: AGI on February 07, 2006, 08:57:28 AM
Many tapers use external mic preamps/AD converters (for sound quality reasons, phantom power etc.) and feed a digital signal to the recorder.

I for one have a digimod Edirol UA5 that I'm currently using with a Nomad JB3 (which has a digital optical in).

I'd like better to use it with my Rockbox H120 ;-)
Title: Re: Recording via optical-in
Post by: Mmmm on February 07, 2006, 09:22:43 AM
Many tapers use external mic preamps/AD converters (for sound quality reasons, phantom power etc.) and feed a digital signal to the recorder.

I for one have a digimod Edirol UA5 that I'm currently using with a Nomad JB3 (which has a digital optical in).

I'd like better to use it with my Rockbox H120 ;-)

Ahh I see.... so basically if you want to use an external a/d converter..
You learn something new every day! :-D
Title: Re: Recording via optical-in
Post by: mborus on February 07, 2006, 06:25:06 PM
Quote
I don't know about the optical in though...I'm sure it will eventually get done although I personally cant think of any point in it...
Surely if you already have a digital source, you are better off re-encoding it using a computer instead of doing it real-time through the optical in? Or maybe there is something else you could use it for that I haven't thought of...?? :-)

Actually that's the one item missing from Rockbox to make me happy (OK - happier :) ).

I have a lot of digital sources (Satellite, hifi-system) in rooms without computers.
Also I'd like to be able to hook up my portable CD player with optical digital out to
copy CDs "in the field".
The Iriver records in WAV, so you can get the best quality possible. With this feature,
the Iriver plays in the same league as professional portable recorders.

The encoding - if necessary - will be done on a PC later, you're right about
that. That doesn't make a digital in pointless.
Title: Re: Recording via optical-in
Post by: sullen on February 07, 2006, 08:02:21 PM
Yeah, if optical worked correctly, the Iriver would be the smallest optical digital recorder out there AFAIK.  Just like the above mentioned, I use a JB3 with an AD20 in front of it to record digital.  Analog ADC chips can be noisy, I have never used the JB3s ADC chip so I am not sure just how "bad" it is. 
Title: Re: Recording via optical-in
Post by: whatboutbob on February 07, 2006, 11:17:36 PM
Yup...I'm eagerly waiting to bring my AD20 out of the cupboard too. :)

Digital recording is the only doable 'big' feature that's missing from rb, from my perspective. (I'm not counting wma playback & mp3 encoding as doable)
Title: Re: Recording via optical-in
Post by: Boswell on February 15, 2006, 06:12:37 PM
The reason I bought an iRiver H140 was to record .wav files via optical input. I use a digital mixer as part of my PA rig at live gigs, and have to keep an accurate copy of what goes through the main stereo speakers. Because of the dropped samples in the iRiver firmware (even in the latest release), I still can't use the H140, and instead have to rely on a trusty old Denon minidisc deck. However, minidiscs are a lossy medium.

I've given up hope of iRiver fixing the missing samples bug, and so am waiting patiently for RockBox to add optical input to their otherwise excellent code.
Title: Re: Recording via optical-in
Post by: gcogger on February 15, 2006, 06:44:51 PM
The reason I bought an iRiver H140 was to record .wav files via optical input. I use a digital mixer as part of my PA rig at live gigs, and have to keep an accurate copy of what goes through the main stereo speakers. Because of the dropped samples in the iRiver firmware (even in the latest release), I still can't use the H140, and instead have to rely on a trusty old Denon minidisc deck. However, minidiscs are a lossy medium.

I've given up hope of iRiver fixing the missing samples bug, and so am waiting patiently for RockBox to add optical input to their otherwise excellent code.

You could perhaps get a Hi-MD recorder - optical in and lossless recording ability.  You only get something like 90 mins to a disk, but that may be enough?
Title: Re: Recording via optical-in
Post by: IpaqMan on February 15, 2006, 11:21:24 PM
I've given up hope of iRiver fixing the missing samples bug, and so am waiting patiently for RockBox to add optical input to their otherwise excellent code.
As far as I know and have tested, the missing samples problem was resolved in firmware 1.66.  I have tried tests that produced the clicks in previous versions and did not get the clicks in 1.66.
Title: Re: Recording via optical-in
Post by: whatboutbob on February 16, 2006, 02:44:34 AM
Boswell: I believe there was a "fix" that worked with at least one of the iriver f/w versions. You just had to keep the joystick held in a direction whilst recording.  You *could* do this by jamming something beside it if you really want bit-perfect optical recordings until the rockbox guys get on the case anyways.  There was more info about all this over @ misticriver.
Title: Re: Recording via optical-in
Post by: vinylivo on February 16, 2006, 01:29:36 PM
Yes the joystick jamming 'fix' works fine on the iriver firmware. I made alot of tests and the most recent version that recorded glitchfree with this trick was V1.63US, the recent ones introduced some new strange glitch behaviour.
Title: Re: Recording via optical-in
Post by: Boswell on February 16, 2006, 05:35:45 PM
As far as I know and have tested, the missing samples problem was resolved in firmware 1.66. I have tried tests that produced the clicks in previous versions and did not get the clicks in 1.66.

No, sorry, 1.66 still drops samples. I posted some waveforms of it doing so in topic 2260 on 1st Jan 06.


I believe there was a "fix" that worked with at least one of the iriver f/w versions. You just had to keep the joystick held in a direction whilst recording.

Sorry again, joystick jamming appeared to make no difference, at least with firmwares 1.63E and 1.66E.

You could perhaps get a Hi-MD recorder - optical in and lossless recording ability. You only get something like 90 mins to a disk, but that may be enough?

I have considered Hi-MD, but there is no easy way of treating the recorder as a hard disk for retrieval of recordings. The software for uploading tracks is a pain to use for material recorded live.
Title: Re: Recording via optical-in
Post by: whatboutbob on February 17, 2006, 02:48:12 AM
*scratches head* I'm 99% sure it was 1.63E I tested w/ a sine wave and there were no dropped samples w/ the jammed joystick.
Title: Re: Recording via optical-in
Post by: jaybeee on February 17, 2006, 06:09:21 PM
It's perfectly possible to capture digital transport streams from digital sources like DAB/satellite etc in their transmitted format, i.e. mp2.  Thus attaining a perfect copy of the audio sent.

Is this a technical possibility via the optical line-in (from an optical line-out on a device that recieves said digital transport stream/signal) with the H1xx series? 
I suspect not, but then I'm unsure as to what is actually required to enable this kind of functionality, hence my question.

Thanks
Title: Re: Recording via optical-in
Post by: vinylivo on February 17, 2006, 08:06:02 PM
It's perfectly possible to capture digital transport streams from digital sources like DAB/satellite etc in their transmitted format, i.e. mp2.  Thus attaining a perfect copy of the audio sent.

By the way the mad decoder used in rockbox plays MPEG1 or 2 layer 1 or 2 (e.g. mp2) without problems. So you could even rip the audio stream from a video DVD or a VCD and play it on the iriver. AC3 a.k.a a52 or dolby digital plays too. :-)
Title: Re: Recording via optical-in
Post by: mborus on February 18, 2006, 03:53:59 AM
Quote
By the way the mad decoder used in rockbox plays MPEG1 or 2 layer 1 or 2 (e.g. mp2) without problems. So you could even rip the audio stream from a video DVD or a VCD and play it on the iriver. AC3 a.k.a a52 or dolby digital plays too. :-)

True. On the other hand if the DVD is copy protected than ripping the audio is illegal
in my country (Germany). Recording the audio off the digital out is still legal...

Same goes for copying copy protected CDs. Unless the CD player sends a no-copy signal via digital out (which almost never happens) this is the best legal method to copy a protected CD.
Title: Re: Recording via optical-in
Post by: jaybeee on February 18, 2006, 05:02:26 AM
It's perfectly possible to capture digital transport streams from digital sources like DAB/satellite etc in their transmitted format, i.e. mp2.  Thus attaining a perfect copy of the audio sent.

By the way the mad decoder used in rockbox plays MPEG1 or 2 layer 1 or 2 (e.g. mp2) without problems. So you could even rip the audio stream from a video DVD or a VCD and play it on the iriver. AC3 a.k.a a52 or dolby digital plays too. :-)
Yep I know all that.  I play mp2s that have been capped from radio broadcasts.

I'm just wondering if that functionality is possible with the H1xx series.  Anyone?
Title: Re: Recording via optical-in
Post by: jaybeee on February 23, 2006, 03:27:45 AM
^^ is this a stupid question or is it that no-one knows?
Title: Re: Recording via optical-in
Post by: hellokytty on February 23, 2006, 07:17:20 AM
I'm using my iriver H 120 to record digital radio from my skysat satellite receiver via optical in. I works fine as long as I choose "Dolby Digital" as output. The player doesn't seem to record AC3 - I can just hear cracking.
My DVD Player seems to be copy protected - I get cracking too even if sound output is set to "dolby digital".

So it works - with some limitations.
Title: Re: Recording via optical-in
Post by: jaybeee on February 23, 2006, 07:24:38 AM
I'm using my iriver H 120 to record digital radio from my skysat satellite receiver via optical in. I works fine as long as I choose "Dolby Digital" as output. The player doesn't seem to record AC3 - I can just hear cracking.
My DVD Player seems to be copy protected - I get cracking too even if sound output is set to "dolby digital".

So it works - with some limitations.
So what format is the audio saved in on the iRiver?
Title: Re: Recording via optical-in
Post by: Mmmm on February 23, 2006, 10:05:26 AM
At the moment with rockbox you can only record via line in (analogue) so you will lose some quality. Also only wav files are supported 44100khz 16bit so if your source is any higher you will obviously lose more quality!

This will not always be the case though. Optical in will definitely be supported and I think up to 24 bit capture is technically possible (...or was it 20bit...can't remember!) in certain situations. Not sure about 48000khz though!

EDIT: Just found this using the newly up and running forum search:
Quote from: LinusN
Quote from: whatboutbob
Apologies for my ignorance (and possibly dumbarse question), but is it technically possible to record 24 bit/96 kHz to the iriver (and therfore within rockbox's realm)?
No, 20bits/44.1kHz is the best the hardware can do.
Title: Re: Recording via optical-in
Post by: hellokytty on February 23, 2006, 03:05:50 PM
Hi, sorry - when I said that I recorded via optival in I didn't mention that in the moment I'm using the original firmware. So of course the files can be saved as WAV or mp3. I prefer WAV.

Great to hear that recording via optical in will be added in rockbox !!!
Title: Re: Recording via optical-in
Post by: Davide-NYC on March 30, 2006, 12:35:46 AM
When Optical Recording becomes a reality I may just have to purchase an extra H140 as backup!!!
 ;D
Title: Re: Recording via optical-in
Post by: radiated on April 08, 2006, 08:26:39 AM
Hello all, and thanks a lot to you that have made the rockbox.org firmware. The fix of the recording glitch was a milestone, and I would really really really want you to implement spdif recording. If done proplerly (24 bit recording is perhaps possible?) the iRiver could be the perfect location proffessional stereo recorder if paired up with a decent A-D-converter.
The unit would also bee  very useful for digital backup when recording on location/in studio, and should become any musicians or recording engineers best friend.

Best regards from Trondheim, Norway
Title: Re: Recording via optical-in
Post by: allthatlies on April 10, 2006, 01:56:17 AM
i very much agree with everything in this thread. i currently run Schoeps MK4 > nbox+ (custom made pre & a/d) > h120 in the field and would love to be able to have the iriver accept the digital signal as opposed to going digital > analog > digital within the iriver.
Title: Re: Recording via optical-in
Post by: hellokytty on April 14, 2006, 02:20:04 AM
Hi,

did you notice that the rockbox manual for H 120 devices reads:

3.9.2

"Source: Choose the source of the recording. This can be SPDIF (digital), microphone or line in. For recording from the radio see page 20" ?

I hope they mentioned it to let us know that optical recording will be implemented soon.

Title: Re: Recording via optical-in
Post by: mborus on April 14, 2006, 07:27:32 AM
Quote
did you notice that the rockbox manual for H 120 devices reads:
3.9.2
"Source: Choose the source of the recording. This can be SPDIF (digital), microphone or line in. For recording from the radio see page 20" ?
I hope they mentioned it to let us know that optical recording will be implemented soon.

The manual covers Archos and Iriver.

If you look at the ToDo list (http://www.rockbox.org/twiki/bin/view/Main/ReleaseTodo (http://www.rockbox.org/twiki/bin/view/Main/ReleaseTodo)) digital inputs for the Iriver H1x0 series are not on this list for the current feature freeze or the next Rockbox release in November 2006.

I have some hopes that it is hidden in the term "everything that worked in Rockbox 2.5", but it can also mean that digital recording for Irivers will not be implemented in 2006. With the focus shifting away from the H1x0 series towards the other targets without digital inputs (Ipod, H3x0 series) it's possible that there's just not enough interest in digital in recording after all.

We'll just have to wait and see...
Title: Re: Recording via optical-in
Post by: manno on April 15, 2006, 01:26:42 PM
I just wanted to chime in on this also. I bought the h120 just for the future possibility of optical-in recording and really hope it comes to life. I too, am a high quality recording freak and this would be the perfect solution!
Title: Re: Recording via optical-in
Post by: westkc3 on April 16, 2006, 08:48:43 AM
...encountered another reason to desire optical recording last night...I am in the middle of converting from MiniDisc to a H120.  This requires moving over 260 discs converted to wave in real time.  In attempting to burn a cd from some previously digitally recorded mini discs, SCMS kicked in.  So now I just go from the optical out on my JE-520 to the H120 which I currently have booteded to the original firmware to allow optical in recording. 


The recording screen is nowhere near finished...Have a look


HERE (http://forums.rockbox.org/index.php?topic=2513.0) for a load of, as yet, uncommitted upgrades...

I don't know about the optical in though...I'm sure it will eventually get done although I personally cant think of any point in it...
Surely if you already have a digital source, you are better off re-encoding it using a computer instead of doing it real-time through the optical in? Or maybe there is something else you could use it for that I haven't thought of...?? :-)


Title: Re: Recording via optical-in
Post by: dwonk on April 18, 2006, 06:38:46 AM
I am not gonna let this thread die.....

This feature would make the iriver H1XX a truly all-in-one solution for many serious musicians and field recordists.  There are quite a few that are watching RB develop on the sidelines who would use this feature.  I really cannot stress enough how important it would be to have this implemented.  16bit/44.1 would be the minimum needed but it would be a real professional tool if it could do 24bit at 44.1/48/96Khz.  The only option now for alot of folks is the Microtrack by M-Audio...a nice CF based SPDIF recording device, but far from perfect.  It seems like everything is there in the H1XX to do this except the code. 

We would all be extremely grateful if this feature were to come true in future versions of RB.  In fact, there are a few willing field recordists with rockboxed H120s ready to test if there is any need for beta testers.
Title: Re: Recording via optical-in
Post by: petur on April 18, 2006, 09:31:45 AM
well, some good news: preglow mentioned on thr irc that he's going to have a look at it and try to get it running for release 3.0...
Title: Re: Recording via optical-in
Post by: tab on April 18, 2006, 10:22:15 AM
Thats really good news. Even if it's not in the 3.0 release, it's good to know that someone actually looks at it. After all, this is the feature of the H1xx that most other players don't have.
Title: Re: Recording via optical-in
Post by: whatboutbob on April 18, 2006, 07:41:53 PM
well, some good news: preglow mentioned on thr irc that he's going to have a look at it and try to get it running for release 3.0...

...and it sounds like he's making really good progress:

19.06.58 #       <preglow> i just recorded with spdif

If this gets committed soon it'll make my month...how lame am I? :-)

Title: Re: Recording via optical-in
Post by: Davide-NYC on April 19, 2006, 07:22:09 AM
This is truly great news!

I'm trying to curb my enthusiasm in case it doesn't end up happening.

But I can't help myself...  This is great news!  :o
Title: Re: Recording via optical-in
Post by: Arj on April 19, 2006, 11:19:24 AM
I agree -- this is awesome!  I've been hoping this would be implemented for some time now.  Thanks, Preglow, for looking into this!
Title: Re: Recording via optical-in
Post by: hellokytty on April 19, 2006, 01:34:09 PM
Hi,

from the IRC

"19.10.07 #       <preglow> spdif recording seems to be a breeze"

just to keep you informed.
 
Has he been serious ?

Would be great though ! ;D



Title: Re: Recording via optical-in
Post by: manno on April 19, 2006, 08:02:30 PM
I am not gonna let this thread die.....

16bit/44.1 would be the minimum needed but it would be a real professional tool if it could do 24bit at 44.1/48/96Khz....

In fact, there are a few willing field recordists with rockboxed H120s ready to test if there is any need for beta testers.

I believe that it was mentioned that the hardware would only do 20bit at 48khz max on the optical in. Even at at that, it's better that the ever popular JB3 could do.

I'm ready and very willing to do some beta testing also! Let's make this happen! WooHoo!
Title: Re: Recording via optical-in
Post by: mborus on April 20, 2006, 03:13:08 PM
Quote
I'm ready and very willing to do some beta testing also! Let's make this happen! WooHoo!

Same here. As soon as any daily build has digital in I'll start recording
and will then check the first recordings in Audacity to make sure no samples got lost...
Title: Re: Recording via optical-in
Post by: hellokitty on April 21, 2006, 10:42:04 AM
Hi,

from the IRC:

12.18.40 #<preglow> spdif monitoring works
12.35.05 #<preglow> recorded audio is just fine, monitored audio is not 


Title: Re: Recording via optical-in
Post by: hellokitty on April 22, 2006, 07:22:23 PM
Hi,

from the IRC:

01.10.19 # anyone here keen to test spdif recording?

I'd like to help if I can. I own a TOSLINK cable and a Laptop with SPDIF out.

If there's a plugin or so let me know !
Title: Re: Recording via optical-in
Post by: manno on April 23, 2006, 01:54:10 AM
Hi,

from the IRC:

01.10.19 # anyone here keen to test spdif recording?


I have everything to test it also. Just let me know what I need to do. This is great!
Title: Re: Recording via optical-in
Post by: Llorean on April 23, 2006, 01:57:15 AM
Well your best bet for testing it is to be in the IRC channel while Preglow's awake and around working on it.
Title: Re: Recording via optical-in
Post by: whatboutbob on April 23, 2006, 02:52:04 AM
You can find his patch here:

http://www.pvv.org/~thomj/rockbox/spdif_recording.patch

However I didn't have any luck with it...
Title: Re: Recording via optical-in
Post by: hellokitty on April 23, 2006, 04:28:43 AM
Hi,

everything I see is kind of a text file (never installed a plugin). What do I have to do to make it run on the H120 ?
What is it supposed to do ?
How can I commit to the IRC ?
Title: Re: Recording via optical-in
Post by: mborus on April 23, 2006, 05:44:25 AM
Quote
Hi,

everything I see is kind of a text file (never installed a plugin). What do I have to do to make it run on the H120 ?
What is it supposed to do ?

You are supposed to compile your own rockbox version with this,
or you have to wait if someone compiles one for you.

I tried compiling it following the instructions(*) on the rockbox homepage.

"Digital" appears as a selection for recording source.
When I connect a 44.1 kHz or 48 kHz source, nothing happens.
I can't hear it and when I start a recording anyway, the Iriver tries
to start a recording and freezes.

At least this got me motivated to set up a building environment :)

----
(*Note: If you never tried this, they are quite good. The only guesswork
I had to do was where to put the files - Patch goes into the rockbox root
directory to work, rockbox source tar file goes into c:\cygwin\home\<USERNAME>)


Title: Re: Recording via optical-in
Post by: hellokitty on April 23, 2006, 08:16:16 AM
Thanks,

but all I can see is

http://www.pvv.org/~thomj/rockbox/spdif_recording.patch

Is this the patch itself or just an instruction ?

Title: Re: Recording via optical-in
Post by: Llorean on April 23, 2006, 08:17:56 AM
It's a patch. You apply it to the source code, and then compile.
Title: Re: Recording via optical-in
Post by: mborus on April 23, 2006, 08:37:35 AM
Quote
Thanks,

but all I can see is

http://www.pvv.org/~thomj/rockbox/spdif_recording.patch

Is this the patch itself or just an instruction ?

It's the patch.

See http://www.rockbox.org/twiki/bin/view/Main/DocsIndex (http://www.rockbox.org/twiki/bin/view/Main/DocsIndex)

And read the section "For Developers"

Here you need to read:
# First-time guide to Rockbox development.
# Detailed instructions on compiling.
# The simplified guide to compiling.
# How to work with patches.

This is a bit scary, but you can get it to work.
Or just wait a few days...

Title: Re: Recording via optical-in
Post by: sullen on April 23, 2006, 01:10:30 PM
I did my first ever patch/compile today just so I could check out the Optical Recording.  I am having the same issue as the above poster.  I turn on my Optical source before turning on the iRiver, go to record, select Digital, and the go to the recording screen.  I get no levels at all.  I hit record and the timer starts but still no levels.  I can hit stop and it stops, but freezes after that.  I patched with today's (4/23) source.
Title: Re: Recording via optical-in
Post by: preglow on April 23, 2006, 07:48:08 PM
There's a new patch at the same URL now. I also just noticed that SPDIF output needs to be on in the playback menu for recording to work. This patch works 100% for me, so I hope for a bigger success rate this time... Feedback is welcome.
Title: Re: Recording via optical-in
Post by: whatboutbob on April 23, 2006, 08:23:58 PM
Woohoo!  Its very early days but I've recorded two files and they played back fine.

I used a precompiled version which wouldn't intially work for me until I reset .cfg.  Like preglow mentioned you also have to enable optical output (general -> Playback -> Optical Output). Happy testing!
Title: Re: Recording via optical-in
Post by: dwonk on April 23, 2006, 08:40:33 PM
preglow, thanks so much for the patch!

Anybody point out where to grab the compiled version with preglow's SPDIF patch?

By, reset .cfg, you mean restore the user configurations to default in general setings menu?
Title: Re: Recording via optical-in
Post by: whatboutbob on April 23, 2006, 09:03:20 PM
I hope preglow doesn't mind me sharing this...but its in the IRC logs anyways...:

http://www.pvv.org/~thomj/rockbox/rockbox.iriver

reset .cfg: Manage Settings > Reset Settings.
Title: Re: Recording via optical-in
Post by: sullen on April 23, 2006, 09:50:06 PM
Wow, I have learned a lot today!  Did my first patch today and boy was it a good one.  Everything works as described at this point.  I like how you see the size of the file as it is recorded.  It took a bit to actually write the file after I pushed stop.  I only recorded one file just under 3 minutes at 44.1k so far.  Will it be easy to incorporate the other recording functionings to coincide with the Optical recording?  I know nothing about programming but may look at it some for kicks.  Thank you for the patch!  I am sure now that the initial hurdle has been passed, a lot of people will put some attention to the tweaks. 
Title: Re: Recording via optical-in
Post by: LinusN on April 24, 2006, 02:17:45 AM
Will it be easy to incorporate the other recording functionings to coincide with the Optical recording?
What functions? All the functionality for the analog recording should work for digital as well, except for the gain settings of course.
Title: Re: Recording via optical-in
Post by: mborus on April 24, 2006, 02:21:42 AM
Quote
There's a new patch at the same URL now. I also just noticed that SPDIF output needs to be on in the playback menu for recording to work. This patch works 100% for me, so I hope for a bigger success rate this time... Feedback is welcome.

Just one question, as I'm new to patching.
Do I need to undo the other patch first or will the new patch
fix this automatically?
Title: Re: Recording via optical-in
Post by: petur on April 24, 2006, 04:13:48 AM
undo the old patch or start from a clean cvs download
Title: Re: Recording via optical-in
Post by: dwonk on April 24, 2006, 09:18:16 AM
I used that patched and compiled .iriver document I got off of preglow's site and couldn't get past 28MB (feeding it with a SPDIF signal from a modSBM).  I think that the RAM buffer is having trouble flushing and as a result the player locks up.  FWIW, I have had the same issue with analog recording in the past.  Maybe the first signs of HD failure?  I know I got some bad sectors on the drive.
Title: Re: Recording via optical-in
Post by: mborus on April 24, 2006, 10:01:16 AM

Here's a short test during lunch break.

Recording from CD (running) worked.
Recording from CD (not running yet to catch beginning) freezes Iriver.
Recording from satellite (48 kHz) worked, but resulted in a 44.1 kHz file

The best thing. Recording the same 10 minute segment twice resulted
in bit identical files.

Here are the two recordings:

(http://img47.imageshack.us/img47/4529/o16ao.jpg)

This is the difference (I inverted file 2 and added both) :
(http://img97.imageshack.us/img97/5215/o26be.jpg)

During the length of the shorter the result is zero. So no difference.

Perfect.

The only bad news is that first of the two trial recordings failed after
14 minutes. Here the peak meter showed nothing and the file size was
not increasing any longer.
Title: Re: Recording via optical-in
Post by: whatboutbob on April 24, 2006, 11:15:54 PM
Precompiled build with optical recording patch:

http://s41.yousendit.com/d.aspx?id=0XCI8CJMJU58F0EGPLQZ01OCE4

Please be aware that you may need to reset settings and enable optical out to get 'digital' recording working.

There's a reason the patch hasn't been commited yet...its still buggy.  Have a toothpick handy while testing because if you attempt to record while there's no signal (or if it loses signal mid-way thru) the recording will hang. You'll need to reset the unit.

Good luck, and report back your results.
Title: Re: Recording via optical-in
Post by: dwonk on April 25, 2006, 12:31:29 AM
This is what I found regarding the SPDIF being properly recognized/captured:

You need to be feeding it a signal from your AD when you choose the source (digital) and then go to the recording screen.  If you don't, there will be no signal.  Also as whataboutbob has pointed out, the optical out needs to be turned on.

I was able to grab 3 minutes but the file header was all messed up.  there was a 29MB file but I couldn't open it.

Another thing, if the next improvements are to be made, the recording setting should be saved somehow.  Also, if the optical out has to be turned on everytime, it will be an extra step to engage the recording.  Maybe implement the optical out being on when the in is selected for the source.
Title: Re: Recording via optical-in
Post by: dgodwin on April 25, 2006, 06:24:38 AM
I used the precompiled build from whataboutbob.  I was able to transfer a 1.5hr DAT tape to the iRiver with no apparent problems.  Again, the only overall issue I encountered was needing to have the dat player going when I went into the recording screen. 
Title: Re: Recording via optical-in
Post by: hellokitty on April 25, 2006, 12:44:58 PM
Great !

Were you able to listen to the generated file ?
What settings did you use (khz,...) ?
Is there a recording limit ?
Where can I get whataboutbob's precompiled build ?
Title: Re: Recording via optical-in
Post by: MU4L on April 25, 2006, 02:35:12 PM
Top o' the page  ;), Kitty ...
Title: Re: Recording via optical-in
Post by: dgodwin on April 25, 2006, 04:46:37 PM
DAT was originally recorded at 44.1k  Played on a Fostex D5.  Rockbox directions were followed after installing the build:
reset cfg
optical output = on
recording source = digital
frequency = 44.1

Started the DAT

went to recording screen, and hit record.  Levels were bouncing, and everything appears fine.  I had to stop the DAT, and do a switch (the encore of the show was on another DAT) so I left the iRiver recording, to see what would happen.  It kept recording, and when I got the DAT going again, it didn't show any problems. 

I transfered the recorded audio onto my computer, and opened it in adobe audition, and it played fine, and looks normal. 
Title: Re: Recording via optical-in
Post by: dwonk on April 25, 2006, 09:59:21 PM
Switched to the 4-24-2006 - 1600 build.

I am still getting issues having my H120 flushing the buffer to the HD.  The HD red light is on and the peak signal dies when this happens, then it locks up.  I tried this tim feeding a signal from my CD player.
Title: Re: Recording via optical-in
Post by: manno on April 25, 2006, 10:07:43 PM
Ok, so I was able to test it out.... So far it seemed to work OK. I did a couple of short test files, one about 70mb in length and one about 40mb in length. They both came out ok EXCEPT that I fed it a 24-bit/48khz signal and it downsampled it to 44.1khz and trucated it to 16-bit. But it did flush the buffer to the HD ok. What's the possibility of keeping the sample rates (not to exceed 48khz) and doing at least 20-bit at the hardware max?

It's looking good here!

BTW, on my end when it flushes, the HD led stays on and it appears to lock but after a few seconds, it then picks up again.
Title: Re: Recording via optical-in
Post by: dgodwin on April 25, 2006, 10:55:38 PM
Ok, so I was able to test it out.... So far it seemed to work OK. I did a couple of short test files, one about 70mb in length and one about 40mb in length. They both came out ok EXCEPT that I fed it a 24-bit/48khz signal and it downsampled it to 44.1khz and trucated it to 16-bit. But it did flush the buffer to the HD ok. What's the possibility of keeping the sample rates (not to exceed 48khz) and doing at least 20-bit at the hardware max?

It's looking good here!

BTW, on my end when it flushes, the HD led stays on and it appears to lock but after a few seconds, it then picks up again.

This pretty much describes my experience, but I've only tried 44.1k, so I can't confirm the downsampling.  I'm betting most would prefer no resampling regardless of bit rate (at least 48k or less) 
Title: Re: Recording via optical-in
Post by: manno on April 25, 2006, 11:51:59 PM
Another test..... recorded about 53min of 24/48 stream. It still captured at 16/44.1 but after transferring the file and upsampling it to 48khz, the file was perfect (or at least no errors that I can see or hear). One cool thing though, even though it was downsampling to the HD, I was using headphones to monitor the stream and it was perfect!
Title: Re: Recording via optical-in
Post by: LinusN on April 26, 2006, 02:16:13 AM
They both came out ok EXCEPT that I fed it a 24-bit/48khz signal and it downsampled it to 44.1khz and trucated it to 16-bit.
Using more than 16 bits will put a substantial strain on the CPU, since we can't use DMA in that case.

Rockbox does not downsample to 44.1kHz when recording. However, it always downsamples to 44.1kHz when playing back the file.
Title: Re: Recording via optical-in
Post by: mborus on April 26, 2006, 02:24:43 AM
Also did some more tests yesterday.

I recorded one hour from a CD twice and compared the result.
As with the shorted test both files were identical. So not a single
glitch.

The only "problem" I had was starting the recording and the CD
at the same time, without missing the beginning.

BTW, the optical output is not working during the recording.
Title: Re: Recording via optical-in
Post by: manno on April 26, 2006, 11:36:41 AM
They both came out ok EXCEPT that I fed it a 24-bit/48khz signal and it downsampled it to 44.1khz and trucated it to 16-bit.
Using more than 16 bits will put a substantial strain on the CPU, since we can't use DMA in that case.

Rockbox does not downsample to 44.1kHz when recording. However, it always downsamples to 44.1kHz when playing back the file.


I fed it a 48khz signal and the resulting file was at 44.1khz. I'll double check my settings again....

Isn't writing out 20 bits of data more of an I/O strain than a CPU strain? Is there a possibility of maybe testing it out?

UPDATE- I checked all my setting and made sure that it was being sent a 48khz signal and it is but still downsampling to 44.1khz no matter what I do. Isn't it hardcoded into the patch to only do 44.1 at this time?
Title: Re: Recording via optical-in
Post by: pabouk on April 26, 2006, 12:24:20 PM
I checked all my setting and made sure that it was being sent a 48khz signal and it is but still downsampling to 44.1khz no matter what I do. Isn't it hardcoded into the patch to only do 44.1 at this time?
Is not the resulting wav in fact 48 kHz PCM data with just a 44.1 header? Is not the recored wav time length about 9% bigger and does not the sound have a lower pitch?
Title: Re: Recording via optical-in
Post by: mborus on April 26, 2006, 12:45:24 PM
Quote
Is not the resulting wav in fact 48 kHz PCM data with just a 44.1 header? Is not the recored wav time length about 9% bigger and does not the sound have a lower pitch?

That's what I got when I tried 48 kHz.

I opened the file in Audacity and selected the correct sample rate (48 kHz) and
afterwards it played OK.
Title: Re: Recording via optical-in
Post by: manno on April 26, 2006, 12:51:00 PM
I checked all my setting and made sure that it was being sent a 48khz signal and it is but still downsampling to 44.1khz no matter what I do. Isn't it hardcoded into the patch to only do 44.1 at this time?
Is not the resulting wav in fact 48 kHz PCM data with just a 44.1 header?
Is not the recored wav time length about 9% bigger and does not the sound have a lower pitch?


I'm not sure but I do know that the picth is lower hence incorrect sampling information. What is the easiest way to edit the header only without resampling? I use Audition.

Update- I used "Adjust sample rate" in audition and set it to 48khz. It looked like it only changed the header instead of resampling. The resulting file is now at 48khz and it sounds perfect.
Title: Re: Recording via optical-in
Post by: preglow on April 26, 2006, 08:16:14 PM
The SPDIF recording patch never downsamples the data it gets. However, it's very possible that an incorrect WAV header gets written. This can be fixed losslessly. The sample rate that gets written to the WAV is the sample rate the signal has got at the moment you press the record key. There  are probably some bugs as well. I'll fix when I have time and am somewhat less tired of working on it.
Title: Re: Recording via optical-in
Post by: manno on April 26, 2006, 11:30:55 PM
The SPDIF recording patch never downsamples the data it gets. However, it's very possible that an incorrect WAV header gets written. This can be fixed losslessly. The sample rate that gets written to the WAV is the sample rate the signal has got at the moment you press the record key. There  are probably some bugs as well. I'll fix when I have time and am somewhat less tired of working on it.

Thanks for all the hard work and effort that you have put into this!
Title: Re: Recording via optical-in
Post by: groovetube66 on April 28, 2006, 04:10:25 PM
What type of cable do I need to send an digital signal into the iRiver?  It looks like a standard 3.5mm but that can't be right, is it?  My digital source is a toslink out.  So is there a toslink to 3.5mm cable.  Is that 3.5mm spdif?
Title: Re: Recording via optical-in
Post by: pilot000 on April 28, 2006, 04:19:42 PM
Picture is here:

http://www.funk-tonstudiotechnik.de/Lichtleiter-Toslink-Klinke-5.jpg

search for "toslink 3,5"
Title: Re: Recording via optical-in
Post by: groovetube66 on April 28, 2006, 04:22:07 PM
Thank you!
Title: Re: Recording via optical-in
Post by: whatboutbob on April 28, 2006, 07:39:07 PM
I ran optical in the wild for the first time on Thursday night (Rodrigo y Gabriela for the Irish among us). It all went without a hitch.
Title: Re: Recording via optical-in
Post by: hellokitty on April 30, 2006, 02:44:11 PM
Hi,

now it's me who is not gonna let this thread die !

From the IRC:

02.13.21 #       <preglow> this reminds me i need to finish spdif recording before i just abandon it

<whatboutbob> preglow: have you had another crack at optical, or have you given up in exasperation?

  <preglow> whatboutbob: haven't had time



Title: Re: Recording via optical-in
Post by: dwonk on May 02, 2006, 12:29:32 AM
Can we all chip in and get preglow a fruit basket?  He has come this far, let's help him finish it!
Title: Re: Recording via optical-in
Post by: whatboutbob on May 02, 2006, 12:44:01 AM
If it were me I'd prefer a carton of beer. ;-)

I've already committed to making another rockbox donation once optical recording is done. *fingers crossed*

He was having another go at it yesterday:

15.22.26 #       * preglow has a final (he hopes) stab at spdif recording

...but no update thereafter, so don't get your hopes up.
Title: Re: Recording via optical-in
Post by: MoAv on May 02, 2006, 04:19:22 AM
What's wrong with the patch ? the recording works perfect for me .
Title: Re: Recording via optical-in
Post by: whatboutbob on May 02, 2006, 05:35:36 AM
moav: Recordings sporadically fail in a way that's difficult to reproduce reliably. Also if the signal fails the recording hangs rather than ending gracefully, forcing a reset.
Title: Re: Recording via optical-in
Post by: ItsJustMe on May 02, 2006, 11:24:41 AM
Hello all!  :D

I'm new to this forum. I just bought an iHP-140 on Ebay (I should have done this years ago, but no money :'() and wanted to let you know that I will donate 25€ the day optical-in recording works flawlessly. And I hope I will not be the only one.

So please keep up the good work! (I already registered at Paypal  ;))
Title: Re: Recording via optical-in
Post by: dunno on May 02, 2006, 12:27:06 PM
and wanted to let you know that I will donate 25€ the day optical-in recording works flawlessly. And I hope I will not be the only one.

So please keep up the good work! (I already registered at Paypal  ;))

Conratulations on your new player, and may you have many mp3 hours with it. I love my two h140's.

I just think that your statement above is a bit tactless and undiplomatic, you're implying that the teams effort to date isn't worth anything, and you only find optical recording to be of value. Lots of man hours hae gone into rockbox which is comprised of lots of line of code, It isn't just optical recording which has value.
Title: Re: Recording via optical-in
Post by: Davide-NYC on May 02, 2006, 05:38:58 PM
Not to pile on the crap, but I agree with Dunno.
I just held an auction for a bunch of iHP-140 parts, donated $200 to ROCKbox and "suggested" that they get the optical done.

It was not ransom, it was just a suggestion. See? Open source, voluntary, all that hippie jazz. Dig?
Title: Re: Recording via optical-in
Post by: sullen on May 02, 2006, 07:38:47 PM
Why don't you donate for the sheer fact that Rockbox kicks ass and they took the time to port it to the iRiver to start with?  To me, that is enough reason in itself.
Title: Re: Recording via optical-in
Post by: dwonk on May 07, 2006, 08:07:23 PM
back to the top  ;)

Thom (preglow) threw something up just a little while ago on rockbox's feature request BB:

http://www.rockbox.org/tracker/task/3041#comment7848

Comment by Thom Johansen (preglow) - Sunday, 07 May 2006, 10:54PM

SPDIF recording is being developed (slowly) by me right now. A rudimentary patch is available, but there are some bugs I need to get rid of. As for formats, you'll currently have to be content with 96/16. 20 bits is the maximum possible on H1x0, so you'll pretty much have to forget anything greater. Even 20 bits isn't currently possible, since we'd need to create an interrupt based driver for the PCM playback code. Don't expect too much in the department of multichannel either. Any help on the coding would be appreciated.
Title: Re: Recording via optical-in
Post by: mborus on May 08, 2006, 03:44:05 PM
Quote
SPDIF recording is being developed (slowly) by me right now. A rudimentary patch is available, but there are some bugs I need to get rid of.

For those of you that have not started testing:

Once you got the first digital recording running, it's bug-free until you shut down the unit.

I've recorded over 20GB worth of WAV files digitally testing this patch so far and all recordings are OK. (I'm using an external A-D converter and am recording a batch of 60 US radio shows on vinyl, if you are wondering)

So as long as you remember to:
- turn on digital optical OUT and
- to feed the digital in a signal before selecting digital input
you are safe...

Title: Re: Recording via optical-in
Post by: sullen on May 08, 2006, 05:43:49 PM
Since you seem to have done the most recording with the optical patch, I have a question but you may not be able to answer it.  Is having the optical out, required to record at this point, draining the battery more?  I don't know the interworkings of the iRiver so I was wondering if this was added drain/strain on the battery.  About how much time are you getting per charge or do you record with the wall wort plugged in?
Title: Re: Recording via optical-in
Post by: whatboutbob on May 08, 2006, 06:18:43 PM
Sullen,

Interesting question.  You have to enable optical out but it turns off when recording. mborus, have you noticed any significant impact on battery life?  i haven't (but I haven't been paying attention to it).
Title: Re: Recording via optical-in
Post by: sullen on May 08, 2006, 09:13:33 PM
Sullen,

Interesting question.  You have to enable optical out but it turns off when recording. mborus, have you noticed any significant impact on battery life?  i haven't (but I haven't been paying attention to it).

Oh, I didn't realize that.  I had only performed a few tests and didn't pay attention.  When this works well, I may convert to the iRiver full time for optical, but for now I am sticking with my JB3 and MicroTrack for Digital.  iRiver will still be my main analog recording unit though, gotta love it for that!
Title: Re: Recording via optical-in
Post by: whatboutbob on May 09, 2006, 05:32:36 AM
Woot!  Looks like amiconn may have solved the hanging (DMA error) issue.  I can't get recording to hang now anyways.  If there's a signal loss now (eg when the cable is pulled out mid-recording), the recording pauses (the time keeps ticking, but the peakmeter disappears and the size pauses) until the signal's found again.  This isn't obvious when it happens, but I imagine that's something they'll get to eventually. :-)

Here's a precompiled build w/ the new patch for anyone that wants to help test: http://download.yousendit.com/CF490F1E480279DC

Reminder: you'll need to enable spdif out, and its prolly safest to reset settings...not in that order. :-)
Title: Re: Recording via optical-in
Post by: mborus on May 09, 2006, 05:32:44 AM
Quote
Is having the optical out, required to record at this point, draining the battery more?  I don't know the interworkings of the iRiver so I was wondering if this was added drain/strain on the battery.  About how much time are you getting per charge or do you record with the wall wort plugged in?

I've been recording with the power connector plugged in most of the time.

I would expect that the optical output power consumption is nothing compared to the many HD accesses needed to write the WAV file.

I've sucessfully recorded several hours on battery. Currently, I record aprox 3 GB and then connect the Iriver to the PC to transfer the data before I start recording the next 4LP set. So recordings larger than 4 hours are no problem...



Title: Re: Recording via optical-in
Post by: preglow on May 09, 2006, 06:49:43 AM
mborus:
Could you try the build whataboutbob posted and tell me if you still get wrong sample rates on the WAVs that used to be tagged with wrong sample rates? Could you also check with the diagnostic screen and check to be 100% percent sure the sample rate is never correct there either?
Title: Re: Recording via optical-in
Post by: mborus on May 09, 2006, 10:08:15 AM
Quote
mborus:
Could you try the build whataboutbob posted and tell me if you still get wrong sample rates on the WAVs that used to be tagged with wrong sample rates? Could you also check with the diagnostic screen and check to be 100% percent sure the sample rate is never correct there either?

I still get 44.1 kHz files if I record 48 kHz from satellite.
As before changing the playback speed to 48 kHz fixes
the problem.  Also the debug screen still fails to recognize
the 48 kHz signal.

The good news is that there are no more crashes when I start the recording with no signal present.

Title: Re: Recording via optical-in
Post by: Crumbo on May 09, 2006, 07:20:39 PM
Woot!  Looks like amiconn may have solved the hanging (DMA error) issue.  I can't get recording to hang now anyways.  If there's a signal loss now (eg when the cable is pulled out mid-recording), the recording pauses (the time keeps ticking, but the peakmeter disappears and the size pauses) until the signal's found again.  This isn't obvious when it happens, but I imagine that's something they'll get to eventually. :-)

Here's a precompiled build w/ the new patch for anyone that wants to help test: http://download.yousendit.com/CF490F1E480279DC

Reminder: you'll need to enable spdif out, and its prolly safest to reset settings...not in that order. :-)

here's a perm link for whataboutbob's pre-compiled build:

whataboutbob's pre-compiled build 5-9-2006 (http://www.namewithheld.net/irivierh120rockbox/rockbox.zip)
Title: Re: Recording via optical-in
Post by: preglow on May 10, 2006, 08:30:31 PM
OK, here we go with a new patch. This time the only problem I'm aware of is that the recording source doesn't seem to be saved properly. Also worth noting now that starting recording before a signal is applied isn't an error anymore, is that the sample rate is written to the WAV file at the very start of recording. Thus, if you have no valid signal applied at this point, an erronous sample rate will probably be written.
Please test the patch with all sample rates you can. It should work properly with all.

Patch: http://www.pvv.org/~thomj/rockbox/spdif_recording.patch
Pre-compiled build: http://www.pvv.org/~thomj/rockbox/rockbox.iriver

Note that the pre-compiled build can't load plugins and might have some other stuff included, please try to use the patch if possible.
Title: Re: Recording via optical-in
Post by: preglow on May 11, 2006, 06:57:42 PM
Patch commited.
Title: Re: Recording via optical-in
Post by: whatboutbob on May 11, 2006, 07:55:22 PM
\o/
Title: Re: Recording via optical-in
Post by: AGI on May 12, 2006, 05:36:09 AM
Great news!

I have been silently following progress on s/pdif recording, reading IRC logs every day.
I want to thank very much preglow and amiconn for their wonderful work and whatboutbob for testing and gentle pressing ;-)

Thanks guys!
Title: Re: Recording via optical-in
Post by: hellokitty on May 12, 2006, 09:20:28 AM
same with me.

When I first heard about preglow's initiative I was happy to see spdif recording around christmas 2006. In the last weeks it looked better almost every day. And finally...

preglow, whatboutbob, mborus, and everyone else who put rockbox to H1**

Thank you all so much !!!
Title: Re: Recording via optical-in
Post by: mborus on May 12, 2006, 03:12:02 PM
Quote
Patch commited.

Great news.

Just some small feedback:
48 kHhz sample rate is now correctly identified in the recording screen.

The optical output is also working during the recording (and get's activated even if it is not selected.

So everything seems to be OK.


Title: Re: Recording via optical-in
Post by: sullen on May 12, 2006, 05:22:55 PM
Quote
Patch commited.

Great news.

Just some small feedback:
48 kHhz sample rate is now correctly identified in the recording screen.

The optical output is also working during the recording (and get's activated even if it is not selected.

So everything seems to be OK.




Can optical out be turned off during recording?  Is having it on an extra battery drain?  I am thinking in terms of running off of the battery the whole time with an outboard ADC like the AD-20.  Thanks to everyone that made this happen!
Title: Re: Recording via optical-in
Post by: preglow on May 12, 2006, 05:55:06 PM
Can optical out be turned off during recording?  Is having it on an extra battery drain?  I am thinking in terms of running off of the battery the whole time with an outboard ADC like the AD-20.  Thanks to everyone that made this happen!
Depends what you mean. Both have to be powered at the same time thanks to the Iriver hardware construction, but the output should be set in a low-power state if it's not enabled in the playback menu (fixed a couple of hours ago). If it is set to enabled in the playback menu, it monitors the current signal when recording.
Title: Re: Recording via optical-in
Post by: sullen on May 12, 2006, 08:32:43 PM
Can optical out be turned off during recording?  Is having it on an extra battery drain?  I am thinking in terms of running off of the battery the whole time with an outboard ADC like the AD-20.  Thanks to everyone that made this happen!
Depends what you mean. Both have to be powered at the same time thanks to the Iriver hardware construction, but the output should be set in a low-power state if it's not enabled in the playback menu (fixed a couple of hours ago). If it is set to enabled in the playback menu, it monitors the current signal when recording.

You answered my question exactly.  Thank you.  Some people over at TapersSection, and maybe here, have reported accurate recording at 88.2khz with the patch.  Just an FYI.
Title: Re: Recording via optical-in
Post by: preglow on May 13, 2006, 06:55:09 AM
Some people over at TapersSection, and maybe here, have reported accurate recording at 88.2khz with the patch.  Just an FYI.
Good to hear. It should handle all sample rates up to 96kHz (and even higher ones, but that's the highest sample rate it knows about, so that's the highest sample rate you'll see in a WAV).
Title: Re: Recording via optical-in
Post by: pupil on May 15, 2006, 01:41:01 PM
Wow, I'm away for a week and I come back to this!

Incredible work, thanks so much for this :D
Title: Re: Recording via optical-in
Post by: radiated on June 22, 2006, 06:05:35 PM
Thank you very much indeed! Your work is most appreciated (did I spell that right..ehh?).
Title: Re: Recording via optical-in
Post by: jmdearras on August 12, 2006, 04:48:05 PM
Where can I get the firmware that has optical-in record and 48Khz?

Thanks!
Title: Re: Recording via optical-in
Post by: hellokitty on August 13, 2006, 05:10:11 AM
Hi,

if you install rockbox and run a daily build later than May 2006 it is included. Just download the latest daily build!
Title: Re: Recording via optical-in
Post by: hellokitty on August 15, 2006, 10:59:26 AM
And by the way:

THANKS AGAIN TO ALL WHO MADE IT HAPPEN!

Just recorded another digitally broadcasted TV-show. And it sounds great!